I am trying to create a DLL with functions that I would like to use in MS Excel. I am receiving the error msg "Can't find DLL entry point ..." when I step debug a test sub-routine that includes the C++ function.
I believe I am having trouble w/ getting the compilier to "attach" the .def file that I created with the clean names to the process. I suspect this because I edit only the .def file, re-compile the project, and the compiler responds that the build is up-to-date. Can someone please explain to me how to properly attach a .def file to a build/project for DLLs in Visual C++ 2008 Express Edition? Or some advice on how to sidestep this problem all together? Thank you for your help.
As an alternative to the DEF file, you could mark your functions with __declspec(dllexport). If you are using C++, then you might want to use extern "C" __declspec(dllexport). See:
I am at the office now and am using Dev-C++ to attempt this.
I am been stuck on this all morning, trying the "__declspec(dllexport)" method, editing the .def file, and extern "C". I just can't get it to work. Please help as I am tired on being stuck on this problem!
'Prototype the interface of the function from the library
Declare Function square_in_C _
Lib "C:/Documents and Settings/Administrator/Desktop/MyXLLib/MyXLLib.dll" (arg1 As Double) As Double
Sub test_square_in_C()
Dim t As Double
t = square_in_C(10.5)
End Sub