Is it possible for me to write a module in C for VB to use? And if so, will I be able to pass variables to and from that function? Rob
"Programming is like art...It makes me feel like chopping my ear off."
Yes, you can write a C DLL that you can pass information back and forth. When you write your functions, forget about using __declspec(dllexport), you'll need to include the name of the functions in a .DEF file
I just made a dll that is currently used in VB, two weeks before.
Even though in the MSDN documentation about DLL I read that you cannot create a MFC DLL for Visual Basic I found a workaround and I made my MFC DLL(much easier to contruct then a classic DLL) be used by VB.
The workaround was that I made public function call member functions of my CWinApp derived class, and voila it worked.
A very important issue to take into account when you create DLLs for vb is how to pass parameters and what calling convention to use. Also avoid using callback funtions even though you have the addressof operator in VB.
For that please read my question on the Visual C++ Forum:
"calling a DLL function from VB with ByRef arguments" thread
thread116-88011
Hope this helps, s-)
Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.