Results 1 to 3 of 3

Thread: DLL fails

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    4
    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

  2. #2
    Addicted Member csammis's Avatar
    Join Date
    Mar 2001
    Location
    /dev/null
    Posts
    226
    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.
    Things I've Said:
    "Life's funny like that...elephants can wear frilly lace panties, and Dubya still looks like a monkey in a big chair"
    "Take four goats and strap one to each foot of a llama. Presto, goat-powered llama!"
    "You want to get me to work more, get me a Coke. No? Then deal with inferior garbage, I'm not coding another line and your clients can go to......thanks, I'd love a Coke right about now!"

  3. #3
    Guest
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width