I have to take input from the PDA. The probelm is the vendor has provided C++ library files to the programmer. Can we compile these files for .Net and then use it? If yes, how?
Printable View
I have to take input from the PDA. The probelm is the vendor has provided C++ library files to the programmer. Can we compile these files for .Net and then use it? If yes, how?
If the c++ library is a dll then use this (example for RAS-API but works for all dlls):
<DllImport("rasapi32.dll", CharSet:=CharSet.Auto)> _
Private Shared Function RasHangUp(ByVal lphRasConn As IntPtr) As Integer
End Function
Be aware of the fact that if your c++ functions have structs with fixed sizes,e.g. TCHAR etc., as parameters you have to use Marshaling for your VB Structs to be fixed size to...
The file is a static C++ library i.e .lib file and I want to use its functions into a VB.Net application which only supports a dynamic link library i.e. a dll or a COM object i.e. an .ocx file. Problem is how to convert that static library into a dll or .ocx.
I hope you understand the problem in a better way now.
Regards,
Zubair Younas.
Ok, I understand...
My C++ knowledge is a little bit afflicted. :(
Perhaps you better post in C++ Forum about how to get a dll from the .lib . . .
Ur static VC++ dll can be converted into dynamic dll... U will hv to do that in VC++. There's an option where u can change from static to dynamic... After that u can use dllimport like asSiDeluxE! has mentioned...