Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Memory Error

Author
Message
Eddie B
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location:
Posted: 13th Aug 2005 15:22
Hello I am using this code in my dll:



But I get a memory error in pro, Can anyone see what's wrong here..?
Many thanks, Eddie

IanG
19
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 13th Aug 2005 16:53
First of all have you loaded the dll?

second of all can you do it like that using (void(*) (int,int)) - i've never seen it done like that before, i usually do it like this



but of course you are using the header, so i'm not sure how you would do it

what memory error are you getting?


amd athlon xp 2600+,1280mb,FX 5200 128mb,200gb,xp pro sp2
Eddie B
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location:
Posted: 13th Aug 2005 17:13 Edited at: 13th Aug 2005 17:17
The instruction at 0x0000000 could not be read at 0x00000000 or something like that.

My Hole code:



OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 13th Aug 2005 19:29 Edited at: 13th Aug 2005 20:17
I hope _DOT is defined like :

void (PASCAL *_DOT)(int x,int y);

You should initialise it like :

(FARPROC &) _DOT=GetProcAddress(g_pGlob->g_Basic2D, "?Dot@@YAXHH@Z");

Make sure g_pGlob->g_Basic2D is a correct handle

You should then call it like :

(_DOT)(x,y);

AtomZ - its got an A. Its got a Z. Now its just needs U
Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk
empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 13th Aug 2005 20:11
The function name is ?Dot@@YAXHH@Z%X,Y.
DOT%LL%?Dot@@YAXHH@Z%X,Y is the string table entry.


Play Nice! Play Basic! Version 1.08
Eddie B
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location:
Posted: 13th Aug 2005 20:51


There is my new code, Still doesnt work..

OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 14th Aug 2005 02:15
Is ReceiveCoreDataPtr actually being called ?

AtomZ - its got an A. Its got a Z. Now its just needs U
Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk
Eddie B
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location:
Posted: 14th Aug 2005 14:06 Edited at: 14th Aug 2005 14:09
ah ok... But how do I call it.. What argument should LPVOID _Core be? Something like ReceiveCoreDataPtr("Path/DBProBasic2DDebug.dll");

OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 14th Aug 2005 14:35
ReceiveCoreDataPtr is called by DBPro itself, if, I remember correctly the constructor and destructor are present.

AtomZ - its got an A. Its got a Z. Now its just needs U
Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk
Eddie B
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location:
Posted: 14th Aug 2005 14:53
Line this:



Eddie B
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location:
Posted: 14th Aug 2005 15:04
My new Code:

Main.cpp:


main.h:


It still does not work.

Ianhfar
19
Years of Service
User Offline
Joined: 8th Jul 2004
Location: UK
Posted: 15th Aug 2005 13:35
Eddie B

What compiler are you using,
if VC6, then why not set a break point in you dll, set you executable to be the DBPRO app. and run the "DLL".

this way you'll be able to check if you are receiving a valid pointer for

g_pGlob,
_DOT


Any other problems, just ask!

Ianhfar

Login to post a reply

Server time is: 2024-05-05 22:19:50
Your offset time is: 2024-05-05 22:19:50