Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 34

Previous Page 33   Index   Next Page 35

Language Bindings
Page 34 of 750
Visual Basic .Net
The usage of DynaPDF with Visual Basic .Net is essentially the same as with C or C++ except
that the exported DLL functions are encapsulated in the wrapper class CPDF to make the usage
easier. The instance pointer IPDF that is used by every DynaPDF function is hidden for the user
in VB .Net. The instance pointer is controlled by the wrapper class so that you don't need to
create PDF instances manually.
To use DynaPDF with VB .Net proceed as follows:
Add the file /include/Visual_Basic_Net/CPDF.vb to your project (menu Project/Add
Existing Element…).
Finally, make sure that the dynapdf.dll can be found; just copy the DLL into
Windows/System32, finished!
64 Bit Applications
With VB .Net you can develop 32 bit and 64 bit applications. One thing that must be considered
is that the target CPU type in Visual Studio must not be set to UseAny. This is impossible since
you can either link the 32 bit dynapdf.dll or the 64 bit version but not both.
So, a 32 bit and 64 bit version must be compiled separately. Another thing that is often
misunderstood is the right system directory for the dynapdf.dll. If you develop a 32 bit
application on a 64 bit Windows version then copy the 32 bit version of the dynapdf.dll into
Windows/SysWow64 and the 64 bit version into Windows/System32. Yes, this is correct!
Both versions can be used simultaneously. Windows loads automatically the right version if
you have copied the DLLs into the right directories.
Note that the DLL should be copied into the system folder on your development machine only
so that Visual Studio is able to load it. The installer of your application should copy the DLL
into the application directory instead.
General Note:
Visual Studio .Net copies the interface files into your project directory if the option “Link file” is
not selected when adding the files to your project. Make sure that you always link the files to
your project. Otherwise you must update the interface files manually whenever you install a
newer version of DynaPDF.
All DynaPDF functions are encapsulated in the wrapper class CPDF. This class makes sure that
the DynaPDF functions can be used without limitations and programming with DynaPDF
becomes more comfortable. You don't need to consider specific return values of the DLL; the
class converts API data types automatically to VB .Net data types.
 

Previous topic: The DoEvents problem

Next topic: The DoEvents problem