Click to See Complete Forum and Search --> : VB and C++


November 8th, 1999, 10:57 AM
Is there any way that I can call C/C++ functions from VB? I like the interface to VB better but I have some C/C++ functions that I need to call. Can I use VB or do I have to create my app in VC so I can use those functions?

November 8th, 1999, 01:21 PM
if you have the C++ functions in a DLL you can use them in VB
Example: the following line lets you use the function Sleep from then kernel32.dll


private Declare Sub Sleep Lib "kernel32" (byval dwMilliseconds as Long)




In VC you have to declare the function as follows:

extern "C" __declspec(dllexport) void Sleep(DWORD dwMilliseconds);

hope I could help
Tom