Hi,
In my project I want to make a function to a DLL and the call in C++ is like this:
Where, "*pLicenseFile" is pointer to path of license file.
Now, I'm making the same call in VB.NET, this way:
Now, I have created pointers to "InputImageBuffers" and "OutputImageBuffers" like this:
Now I am not getting a way to create a pointer to a string variable which shall hold the path of license file.
The string variable holding path of license file is declared this way:
Can any body please tell me or post code bit to create pointer to string variable holding path of the DLL. The DLL file is placed in application bin\ debug folder.
Also, is my way of making a DLL call is correct, or should I also include any attributes with the DLL import call?
Regards,
Susheelss.
In my project I want to make a function to a DLL and the call in C++ is like this:
Code:
short Get_Processed_Image_Data(unsigned short *pInImageData, unsigned short *pOutImageData, int Columns, int char *pLicenseFile);
Now, I'm making the same call in VB.NET, this way:
Code:
<DllImport("ProcessImage.dll")> Public Function Get_Processed_Image_Data(ByVal pInImageData As IntPtr, ByRef pOutImageData As IntPtr, ByVal iWidth As Integer, ByVal iHeight As Integer, ByVal _pLicenseFile As IntPtr) As Short
End Function
Code:
Dim _pInputImageDataBufferUShort As IntPtr
Dim _pOutputImageDataBufferUShort As IntPtr
Dim InputImageDataUShort((Rows * Columns) - 1) As UShort
Dim OutputImageDataUShort((Rows * Columns) - 1) As UShort
_pInputImageDataBufferUShort = AllocHGlobal(InputImageDataUShort.Length)
_pOutputImageDataBufferUShort = AllocHGlobal(OutputImageDataUShort.Length)
Dim InputArrayHandle As GCHandle = GCHandle.Alloc(InputImageDataUShort, GCHandleType.Pinned)
_pInputImageDataBufferUShort =InputArrayHandleHandle.AddrOfPinnedObject
Dim OutputArrayHandle As GCHandle = GCHandle.Alloc(OutputImageDataUShort, GCHandleType.Pinned)
_pOutputImageDataBufferUShort =OutputArrayHandleHandle.AddrOfPinnedObject
The string variable holding path of license file is declared this way:
Code:
Dim LicensePath As String = AppDomain.CurrentDomain.BaseDirectory & "ProcessImage.dll"
Also, is my way of making a DLL call is correct, or should I also include any attributes with the DLL import call?
Regards,
Susheelss.