
I need help from a vb and vc++ expert
Jonathan,
If the parametars are passed correctly, I would guess GFP is caused by
the function itself. Here is a small basic sample.
From VC++:
extern "C" BOOL Pascal EXPORT ExportedFunction(int i,char* szTest)
{
char szChr[10];
itoa(i,szChr,10);
AfxMessageBox(szChr);
AfxMessageBox(szTest);
return TRUE;
Quote:
}
In DEF file:
EXPORTS
; Explicit exports can go here
Calling From VB:
Declare Function ExportedFunction Lib "yourdll" (ByVal i As Integer,
ByVal szChar As String) As Boolean
Private Sub Command5_Click()
Dim bRetval As Boolean
bRetval = ExportedFunction(100, "Made it - Have Fun")
End Sub
Run your VC++ app in debug mode with breakpoints and check out passing
parameters from your VB app. I do it all the time.
HTH
Quote:
> I am having trouble getting vb to call my vc++ dll. Everytime I run my
> demo,
> I get a GPF. The
Visual C++ demo program I wrote works fine. If there
is
> anyone
> out there who is an expert on matters concerning the use of and
writing
> of vc++
> dlls for vb then e-mail me and I will send you the visual c++ dll and
> source
> and the vb demo program and source. BTW I am using visual studio 6 to
do
> all this.
> --
> Jonathan Wilson
> http://www.*-*-*.com/
Sent via Deja.com http://www.*-*-*.com/
Before you buy.