The Game Creators
The Game Creators Home Click to Login
  Hot: Official TGC CompetitionLee is tweeting!July NewsletterSmart PackerBox2DWeb Hosting SurveyDGS BonanzaFPS Creator Bonanza;
The Game Creators
PureGDK / Resolving Dependencies For A DBPro Plugin (Non PureGDK)

Go to the first page of this board Return to the Forum Menu Post Message
11 Messages - Page   of 1   
Bookmark and Share Search the Forum

Author Message
D Ogre

User


Joined: Wed Nov 19th 2003
Location: Cyberspace
Posted: 27th Jan 2010 21:48           | link | toggle

Hi. Sorry to bring this question up here since it doesn't exactly pertain to PureGDK. I figured you or someone would know since it does concern Purebasic and writing a TPC plugins for DBPro.

I know how to use the Constructor/Destructor functions for init/de-init stuff to be used in the plugin with DBPro.

What I need is an example in Purebasic of how to use the ?GetNumDependencies@@YAHXZ and ?GetDependencyID@@YAPBDH@Z to force the DBPro compiler to include the plugin dependencies.

I'm using PB version 4.40 and DBPro version 7.4 just so you know.
Back to top
Report this message as abusive
Mistrel

PureGDK Moderator


Joined: Wed Nov 9th 2005
Location: Cyberspace
Posted: 28th Jan 2010 14:19           | link | toggle

PureGDK handles plugin dependencies differently than DBP. I don't know anything about either of those two functions and the method I use isn't portable back to DBP.

Sorry I couldn't help.

Back to top
http://puregdk.com Send AIM user a message
Report this message as abusive
D Ogre

User


Joined: Wed Nov 19th 2003
Location: Cyberspace
Posted: 28th Jan 2010 21:41     Edited: 28th Jan 2010 23:17     | link | toggle

IanM posted an example a little while ago about this the C++ way. I just need the method the Purebasic way. Maybe I'm just to ignorant to do the translation.

Here is a shortened snippet just dealing with two functions in question in C++:
+ Code Snippet

If I assume correctly, these two functions are used to force a DBPro DLL or other 3rd party DLLs to be added into the executable when using a plugin you created that needs them. This way they can pass data and use functions from them. For example using memblocks like in the above code from inside your plugin.

So, I would place these to Procedures as CDLL in my plugin code written in purebasic. If a command from my plugin is used, DBPro will call those two functions when present to get the dependencies upon compliation. Similar setup to the Constructor/Destructor functions usage for init/de-initing stuff.

After compiling the plugin code in Purebasic, I will have to change the function names to mangled with either a hex editor or with the PPFixer utility.
Back to top
Report this message as abusive
Mistrel

PureGDK Moderator


Joined: Wed Nov 9th 2005
Location: Cyberspace
Posted: 28th Jan 2010 22:08     Edited: 28th Jan 2010 22:52     | link | toggle

I haven't tested it but you would need to do something like this:

+ Code Snippet

No promises on it working without some tweaking. Also, don't forget to edit the DLL to add the the name mangling.

Back to top
http://puregdk.com Send AIM user a message
Report this message as abusive
D Ogre

User


Joined: Wed Nov 19th 2003
Location: Cyberspace
Posted: 28th Jan 2010 22:38           | link | toggle

Ok, thanks for your help.

I was thinking of something along those lines, but wasn't quite sure about it. I will play around with it and see what I can come up with. I may also have to inquire more about these functions and how DBPro sees and uses them.

I think Freddix would know more about how to set these functions up for DBPro plugins written in Purebasic, but I don't know if he is around these days. I think he is working on some Amiga projects like AMIDark since he gave up the copyrights to Oddyssey-Creators software like PurePlugin.

If I get it working, could I post my findings on your board for people who wish to write a TPC plugin in Purebasic? Possibly a sticky thread.
Back to top
Report this message as abusive
Google Ad
Back to top
 
Mistrel

PureGDK Moderator


Joined: Wed Nov 9th 2005
Location: Cyberspace
Posted: 28th Jan 2010 22:51     Edited: 28th Jan 2010 22:53     | link | toggle

Sure.

I made a small error in the code I posted before and corrected it.

Back to top
http://puregdk.com Send AIM user a message
Report this message as abusive
D Ogre

User


Joined: Wed Nov 19th 2003
Location: Cyberspace
Posted: 28th Jan 2010 23:13           | link | toggle

Thanks again.

I will look it over and try it out this weekend.

It would be nice to have some detailed and up to date documentation for the community. Some of the existing stuff is old and a lot of this sort of stuff is just left out.
Back to top
Report this message as abusive
D Ogre

User


Joined: Wed Nov 19th 2003
Location: Cyberspace
Posted: 2nd Feb 2010 16:49     Edited: 2nd Feb 2010 17:42     | link | toggle

Hi. Sorry to keep bugging you about this.

I posted some questions about this in the DBPro Discussion forum along with a rough draft of my example source code in PureBasic. I'm still having trouble with it working. I have to do more testing and debug here.

If you have some time away from PureGDK, could you take a look at it? I'm going to update the PPFixer utility to allow fixes to the RecieveCoreDataPtr function for the name mangling. I should be able to upload the source of this utility since it's considered a free contribution in the PurePlugin developement package. I will check on that first before posting though.

Forum link:
http://forum.thegamecreators.com/?m=forum_view&t=165205&b=1

Thanks again,
D Ogre
Back to top
Report this message as abusive
D Ogre

User


Joined: Wed Nov 19th 2003
Location: Cyberspace
Posted: 3rd Feb 2010 00:25           | link | toggle

Nevermind. I got it working! The changes were actually very minor in my original code example.

I'm going to start working on some material for a sticky thread over the next day or so. I also want to do some further testing before I post anything. That is if you will still let me make a sticky thread.
Back to top
Report this message as abusive
Mistrel

PureGDK Moderator


Joined: Wed Nov 9th 2005
Location: Cyberspace
Posted: 3rd Feb 2010 19:22           | link | toggle

This information would be more relevant to the DLL Talk board.

Back to top
http://puregdk.com Send AIM user a message
Report this message as abusive
D Ogre

User


Joined: Wed Nov 19th 2003
Location: Cyberspace
Posted: 3rd Feb 2010 19:48           | link | toggle

I don't have a problem with posting it in the DLL Talk board. I didn't want to post something here unless I checked with you first.

Thanks again for your help from earlier.
Back to top
Report this message as abusive

Go to the first page of this board Return to the Forum Menu Post Message
11 Messages - Page   of 1   
Search the Forum

Sorry, but it has been so long since anyone replied to this Thread that it has been automatically locked.
You may read it but not reply.

Forum Search

Enter a word or phrase to search our Forum for:

Thread Subject Search
Search Phrase:
Search Scope: Entire forum
Just this board
 
Google Forum Search
Search Phrase:
 
Apollo v2.02


Game Creator Store
Privacy Policy AUP Top of Page