-
I reinstalled Visual C++ 4.0 on my old Pentium I 133 machine (under NT4.0-sp6). I tried to compile an old DLL that USED TO work perfectly when using it in my VB-app.
The file compiles well (no errors), links ok and the file is saved. I copy the DLL to my \winnt\system32 dir. But when I try to use it in my Visual Basic program, I suddenly get the following error message:
"Run-time error '453':
Can't find DLL entry point sum in myDLL.dll"
Source code of the DLL:
double __stdcall sum(double a, double b)
{
double DataValue;
DataValue = a + b;
return(DataValue);
}
Please note: I found an old DLL from the same source code, which I compiled and built about a year ago. When I copy that DLL to \winnt\system32 dir, everything works fine in my VB app.
So what could have gone wrong in the meantime???
Any help will be greatly appreciated!!
Sipke
-
I don't know a lot about this, and don't shoot me if I'm wrong, but you have to register new (never-before-used) DLLs before they'll work. Go to a command prompt and use the command "regsvr" (I don't know what the syntax is; I've never used it) to register the DLL, it should work then. Most installer programs automate this process, but for what you described I think it'll work.
-
Try and see if this works:
Code:
extern "C" __declspec(dllexport) double _stdcall sum(double a, double b)
{
double DataValue;
DataValue = a + b;
return DataValue;
}
Now use Dependancy Walker to find the name of it, and either use a DEF file, or use an Alias in VB.