Hi,
I have been having some problems trying to write a simple C++ DLL for use with VB in Microsoft Excel 2003. For some reason VB is not calling the DLL function correctly - can anyone help me with this?
For reference, this is my C++ code, which compiles just fine (I am using Code::Blocks, and the example is taken from "Financial applications using Excel add-in development in C/C++", 2nd edn, by Steve Dalton):
Main.h:
Main.cpp:
The DLL is saved as MDA.dll, and this is the associated VB script, which is supposed to load the DLL and call the function:
When I try to use the formula =Get_C_Sytem_Time(0) on a spreadsheet, it enters the VB function, but does not call the C++ function in the DLL - instead it returns a #VALUE! error.
I am not sure (i) whether VB is unable to find the DLL, (ii) if the functions have not been exported correctly and are therefore not visible (iii) if I have made some other coding/compiler settings error.
Can anyone possibly help with this? If I can get this working, then I will have confidence to go ahead and build something more complex.
Thanks very much in advance,
Sabbir.
Bookmarks