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.

Dark GDK / dbLoadDLL is an undeclared identifier

Author
Message
Briere
19
Years of Service
User Offline
Joined: 28th Feb 2005
Location: Amherst New York, United States
Posted: 20th May 2006 17:05
Can anyone point me to the correct name for it?

I am calling it like this, and it isnt working.



5/14/06- 1427 lines into my 3D game engine! Player Movement and File System completed. Working on weapon inventory and player classes.
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 20th May 2006 17:32
Didn't think load dll was implemented.

Web Site:http://www.nicholaskingsley.co.uk
Al:If we knew the unknown, the unknown wouldn't be unknown.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th May 2006 19:15
I think it wasn't implemented for the same reason that I didn't implement it as part of the Interface library.

@Azkel,
Look up examples of LoadLibrary and GetProcAddress in google.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
Briere
19
Years of Service
User Offline
Joined: 28th Feb 2005
Location: Amherst New York, United States
Posted: 25th Jun 2006 08:15
Im having trouble with this.
Here is what I have so far...

multisync.h


calling



and error is



Current Project: CTA Beta
Lines: 762
Last Updated: 6/24/06 at 1:26 PM EST.
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 25th Jun 2006 10:50
You need to convert the function into the correct format. (FARPROC &)

Come to the last Unofficial DBPro Convention (http://convention.logicstudios.net/)
Dont do anything I wouldn't do. But if you do, take pictures.
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 25th Jun 2006 16:39 Edited at: 25th Jun 2006 16:40
I havn't fully tested this yet but, if you change the function name to.....



This is the prototype name in the header and is the same in the library too, this compiles ok, but like I say I havn't tried to load and call a dll yet.. give it a try.

I know the voices aren't real, but they have good ideas!
Briere
19
Years of Service
User Offline
Joined: 28th Feb 2005
Location: Amherst New York, United States
Posted: 25th Jun 2006 19:01
Mono that doesnt work.

Flappy, like this??



Current Project: CTA Beta
Lines: 762
Last Updated: 6/24/06 at 1:26 PM EST.
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 25th Jun 2006 20:36
Well Briere, I have just tried it and it seems to work ok see code below...



I have attached a copy of the compiled executable and the dll.

I know the voices aren't real, but they have good ideas!

Attachments

Login to view attachments
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 25th Jun 2006 23:22
Quote: "Flappy, like this??"

Yes, seems correct

Come to the last Unofficial DBPro Convention (http://convention.logicstudios.net/)
Dont do anything I wouldn't do. But if you do, take pictures.
VRMan3D
19
Years of Service
User Offline
Joined: 3rd Apr 2005
Location: New England
Posted: 14th Oct 2006 10:25 Edited at: 14th Oct 2006 10:27
Monotonic,

The reason your type-cast 'shouldnt' be working right is because you are casting a long string of chars into a single dword. By doing that you are clobbering memory. A dword can't hold that many chars, so C++ just goes ahead and does it anyway, potentially writing characters into memory that wasn't allocated for the purpose, and will cause you headaches and memory leaks (potentially =)

Silly graphical representation of what I'm talking about:


Hope that helps you picture it a bit better.

Everyone please set me straight if I'm way off.

Best regards,
-=VRMan=-

PS> I still am tempted to try your cast just to get my program working ha ha. I've been fussing with the old fashioned LoadLibrary like mentioned above but can't get it to compile, geesh. If anyone can supply a complete, working code snippet in C for loading and calling a dll that compiles and runs, I'd be most grateful. Thanks.

World Famous 3D Screensavers
-- http://www.vrman3d.com --
Miguel Melo
19
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 14th Oct 2006 13:46 Edited at: 14th Oct 2006 13:47
Actually, I think monotonic may be correct. A string (constant or otherwise) is stored somewhere in memory as a null terminated array of chars, and when C/C++ refers to a string it does so via the memory pointer to those chars. So something like

char foo[] = "physics.dll";
dbDLLLoad ((DWORD)foo, 1);

Will certainly work (in terms of param passing, don't know if dbDLLLoad() actualy works). So, I assume that

dbDLLLoad ((DWORD)"physics.dll", 1);

albeit yucky looking may just work.

I have vague plans for World Domination
VRMan3D
19
Years of Service
User Offline
Joined: 3rd Apr 2005
Location: New England
Posted: 15th Oct 2006 03:45
Yeah you're right about that Miguel. I had just done a similar thing and it works fine that way.

I think the difference being that you are allocating the string with the line char foo[] = "physics.dll". You do have to be careful type-casting in similar situations, but as long as it's allocated ahead of time it works fine.

And dbDLLLoad does work fine that way, although not sure why they decided to declare it that way.

Thanks for clarifying.

World Famous 3D Screensavers
-- http://www.vrman3d.com --
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 16th Oct 2006 12:38
When you use a literal like that doesn't it become a const char* ??? I may be wrong but I have never had any problems with this is the past.

I know the voices aren't real, but they have good ideas!

Login to post a reply

Server time is: 2024-11-19 08:29:18
Your offset time is: 2024-11-19 08:29:18