
Pls help: Calling C++ DLL using MFC from VB
I need to call a DLL from my VB program that was written in C++.
I tried to register the dll with regsvr32 but I get the error: "No DLL
Register Server entry point was found".
When I attempt to call the DLL from VB6 I get a similar error:
"Can't find DLL entry point OpenNosGeo in
c:\sailbase-development\softchart-sdk\NosGeo"
Here is the simple VB test code I used to test the function "OpenNosGeo" in
the CNosDoc class:
Private Declare Function OpenNosGeo Lib
"c:\sailbase-development\softchart-sdk\NosGeo" (FileName As String,
bFastOpen As Boolean) As Boolean
Private Sub Command1_Click() 'run this code when button is clicked
Dim result As Boolean
result = OpenNosGeo("C:\SoftCht\13225", False) 'call the function in the DLL
End Sub
The author of the DLL says in his documentation: "The NosGeo.dll is a DLL
that uses dynamic linking to the MFC classes. If the MFC classes are not
already loaded then they will be required before running with NosGeo.dll".
But how can I load these classes from VB? I know that MFC means Microsoft
Foundation Classes, but where can I find these?
I have the C++ source code of the DLL, but I am not a C++ programmer, but I
could modify the code if necessary with some help.
--
Rgds,
/Ger Rietman
www.sailsoft.nl