By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,332 Members | 1,414 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,332 IT Pros & Developers. It's quick & easy.

DLL problems

P: n/a
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

Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Thu, 14 Aug 2003 00:57:22 GMT, Victor Bazarov <v.********@attAbi.com>
wrote:
"Adam Glauser" <ad*********@gmx.net> 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
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.