Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > DLL problems

Reply
Thread Tools

DLL problems

 
 
Adam Glauser
Guest
Posts: n/a
 
      08-13-2003
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

 
Reply With Quote
 
 
 
 
Adam Glauser
Guest
Posts: n/a
 
      08-17-2003
On Thu, 14 Aug 2003 00:57:22 GMT, Victor Bazarov <(E-Mail Removed)>
wrote:

> "Adam Glauser" <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory Allication (Managed VC++ DLL to Unmanaged DLL) [Second Try] Weston Fryatt ASP .Net 2 01-01-2005 11:31 AM
How to determine if a DLL is a COM DLL or .NET DLL Anushi ASP .Net 5 10-28-2004 01:59 PM
Why does Ruby use both tcl83.dll and tk83.dll (instead of just tk83.dll)? H. Simpson Ruby 4 08-03-2004 04:45 PM
mprapi.dll --> samlib.dll --> ntdll.dll issue. Some1 Computer Support 4 04-05-2004 02:02 AM
msvcrt.dll, msvcirt.dll, msvcrt20.dll and msvcrt40.dll, explanation please! Snoopy NZ Computing 16 08-25-2003 12:34 PM



Advertisments