DynaPDF Manual - Page 38
Previous Page 37 Index Next Page 39

Language Bindings
Page 38 of 860
VB .Net supports more data types than VB 6.0 but the usage of the new integer data types is
more complicated since signed integer values cannot be passed to unsigned integer values
without explicit conversion.
To make the usage of DynaPDF less complicated the VB .Net interface uses only basic data
types which are already available since VB 6.0. An exception is the definition of pointers. VB
.Net supports the new Data IntPtr that is a variable pointer type with a length of 32 bit on a 32
bit Windows machine and 64 bit on a 64 bit Windows machine. This data type is used for all
pointers so that the .Net interface can also be used on a 64 bit Windows machine. Note that the
64 bit version of DynaPDF must be used in this case.
Data types used by DynaPDF
DynaPDF uses a large set of enums and other data types which are mostly declared within the
class CPDF. However, a few data types are declared in the file DynaPDFInt.vb, this must be
taken into account when developing VB .Net applications. If you cannot find a data type in the
class CPDF then take a look at the file DynaPDFInt.vb or DynaPDFInt2.vb.
Exception handling in VB .Net
The exception handling in Visual Basic .Net is the same as in Visual Basic 6.0. The class CPDF
uses per default events instead of callback functions. This makes the usage easier and frees you
from handling with unmanaged data types. Please take a look into Visual Basic Exception
handling for a detailed description.
The DoEvents problem
The usage of events in VB .Net is quite easy; however, there is a special behaviour that must be
taken into account when developing .Net applications. When using the DoEvents procedure in
a function you must make sure that the function cannot be executed again while a previous call
of the function is still running.
DoEvents enables the asynchronous processing of the message loop so that the user interface
can be updated and the user can execute something while a function is still running (e.g. press a
break button). DoEvents is often used because it is an easy way to avoid blocking of an
application without using of threads.
However, when using DoEvents it is possible that a user clicks on the button again that executes
DynaPDF functions while a previous call is still running. This is normally no problem but when
using events the event functions become invalid. This is the same behaviour as in Visual Basic
6.0 with the exception that .Net does not crash, a System.NullReferenceException is raised
instead.
Previous topic: Visual Basic .Net, 64 Bit Applications, General Note:
Next topic: Visual C#, .Net Core compatibility, Using DynaPDF with Visual Studio, 64 Bit Applications