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.

PureGDK / Resolving Dependencies For A DBPro Plugin (Non PureGDK)

Author
Message
D Ogre
16
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 28th Jan 2010 04:48
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.
Mistrel
Retired Moderator
14
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 28th Jan 2010 21:19
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.

D Ogre
16
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 29th Jan 2010 04:41 Edited at: 29th Jan 2010 06:17
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++:


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.
Mistrel
Retired Moderator
14
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 29th Jan 2010 05:08 Edited at: 29th Jan 2010 05:52
I haven't tested it but you would need to do something like this:



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

D Ogre
16
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 29th Jan 2010 05:38
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.
Mistrel
Retired Moderator
14
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 29th Jan 2010 05:51 Edited at: 29th Jan 2010 05:53
Sure.

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

D Ogre
16
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 29th Jan 2010 06:13
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.
D Ogre
16
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 2nd Feb 2010 23:49 Edited at: 3rd Feb 2010 00:42
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
D Ogre
16
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 3rd Feb 2010 07:25
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.
Mistrel
Retired Moderator
14
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 4th Feb 2010 02:22
This information would be more relevant to the DLL Talk board.

D Ogre
16
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 4th Feb 2010 02:48
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.

Login to post a reply

Server time is: 2020-10-27 14:39:53
Your offset time is: 2020-10-27 14:39:53