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 / Decorated Forms - Mine ain't right!

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Nov 2004 22:25 Edited at: 4th Nov 2004 22:26
I'm running through the DLL creation example that comes with DB pro. I'm trying to add a String Table entry for PrintText. In the example, the String Table entry looks like this:

PRINT TEXT%S%?PrintText@@YAXPAD@Z%String

When I look at my DLL, the decorated form looks like so:

W?PrintText$n(pna)v

Is this a compiler thing? I'm using OpenWatcom, a free IDE and compiler.

Feel free to move to programming Talk, just realised where I am

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 4th Nov 2004 23:17 Edited at: 4th Nov 2004 23:17
Yes, the layout of exported function names is dependant on the compiler - Borland ones would probably give different names to Watcom and Visual C.

It also depends on whether you export C++ functions or C functions...

Walk softly... and carry a big gun...
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Nov 2004 00:34
I've continued, using the syntax my compiler has given me.

Originally it didn't find the String table, my error in compilation. So I got an "unrecognised command". Now the String Table is included, I know it has found it because I no longer get this error message. The message I now get, which I don't understand, is:

Could not find function '?PrintText$n(pna)v' in 0:dbprocore.dll'[b][/b]

Any pointers for me? It looks like it sees the command in the String Table, then looks in the wrong Dll for the function.

The Dll, if it matters, is in plugins-user, and incorporated in the app.

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
IanG
19
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 5th Nov 2004 01:26
use the extern c technique - it might help

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2ghz, 512mb, geforce fx5200 128mb, 200gb, xp pro sp2
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 5th Nov 2004 01:51
Indeed - or possibly the W before ? is causing the problem.

Walk softly... and carry a big gun...
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Nov 2004 04:13
Quote: "use the extern c technique - it might help"


Tried that. It left me with:

PrintText_

...and proceeded to fail miserably.

I'll hack away and see what happens. Maybe I'll have to dust down the Vis Studio disks.

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 5th Nov 2004 06:55
Its possible the function isn't in cdecl format - in which case it will need changing.

Walk softly... and carry a big gun...
Torrey
19
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 5th Nov 2004 07:03
If you have MS Visual Studio, click on Start, then Run. After that type in depends, and click OK. Once you're in that program open up your dll file and check the function names it finds and copy them.

If you don't have that program, the link to go download it is here:

http://www.dependencywalker.com/

It helps out a lot, good luck!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Nov 2004 18:04
It works!!! Confidence boost in the extreme!

I missed the "W" from the front of the string. This is because I was extracting it from the raw Dll and didn't know exactly where it started.

Having looked at it through the dependency checker, I see exactly what I need to type.

Thanks for all the help so far, I will be back with more questions.

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply

Login to post a reply

Server time is: 2024-04-25 13:55:02
Your offset time is: 2024-04-25 13:55:02