DLL problems

Discussion in 'C++' started by Adam Glauser, Aug 13, 2003.

  1. Adam Glauser

    Adam Glauser Guest

    Hi -

    I am trying to write a simple test DLL in C++ for use in VB.
    Unfortunately, when I try to access functions in the DLL, I get the error
    "Can't find entry point square in SquareTest.dll". I have tried compiling
    the DLL on different machines (in case there was a Visual C++ installation
    problem), tried starting with both an empty Win32 DLL project, and with a
    "simple" Win32 DLL project, and now I am lost.

    Here is the code:
    VB:
    Private Declare Function square Lib "C:\Documents and
    Settings\Administrator\My Documents\BootsWork\dllTest\squaretest.dll"
    (ByVal x As Long) As Long

    Private Sub btnCompute_Click()
    txtOutput.Text = square(txtInput.Text)
    End Sub


    C++:
    //squaretest.cpp
    #include "stdafx.h"
    #include "squaretest.h"

    BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID
    lpReserved
    )
    {
    return TRUE;
    }

    extern "C" double __stdcall square(double x) {
    return x * x;
    }

    //squaretest.h
    extern "C" double __stdcall square(double x);
    BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID
    lpReserved
    );

    Thanks in advance for any help,
    Adam
    Adam Glauser, Aug 13, 2003
    #1
    1. Advertising

  2. Adam Glauser

    Adam Glauser Guest

    On Thu, 14 Aug 2003 00:57:22 GMT, Victor Bazarov <>
    wrote:

    > "Adam Glauser" <> wrote...
    >> I am trying to write a simple test DLL in C++ for use in VB.
    >> [...]

    >
    > Please don't post this to comp.lang.c++. It's off-topic there
    > regardless of your cross-posting or setting follow-ups. How
    > to make a DLL so that VB could use it is beyond the scope of
    > Standard C++ language, the subject of comp.lang.c++. You might
    > want to post this to comp.os.ms-windows.programmer or to the NG
    > for the C++ compiler you're using (microsoft.public.vc.language).
    >
    > Thank you.
    >
    > Victor
    >
    >
    >


    My apologies. I was not aware that this was off-topic. I am a bit new at
    to the Usenet world, and simply assumed from the group name that any C++
    related question was ok. I appreciate the gentle guidance, as opposed to
    the chastisement that others may opt for, assuming that everyone knows
    better. Thank you also for the suggestions of alternative groups to try.

    --
    Adam
    Adam Glauser, Aug 17, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anushi
    Replies:
    5
    Views:
    8,624
  2. Weston Fryatt
    Replies:
    2
    Views:
    947
    Weston Fryatt
    Jan 1, 2005
  3. NGM
    Replies:
    0
    Views:
    2,284
  4. wpy
    Replies:
    1
    Views:
    357
    -=Chris=-
    Nov 11, 2003
  5. H. Simpson
    Replies:
    4
    Views:
    243
    H. Simpson
    Aug 3, 2004
Loading...

Share This Page