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 / Calling Exported DLL Functions. - Need a little help.

Author
Message
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 27th Feb 2008 18:22 Edited at: 27th Feb 2008 18:34
Ok, I've got a DLL with exported functions. (The RakNet DLL)

Documentation says the command in C++ would be,

peer->Startup(50, 30, &SocketDescriptor(6005,0), 1);

Exported function corresponding to this is shown to be,

?Startup@RakPeer@@UAE_NGHPAUSocketDescriptor@@I@Z

If someone could point me in the direction of an existing doc showing how, or help translate this into a usable command in DBPRo, it would be most appreciated.

I have so far,

LOAD DLL "RakNet.dll, 1
CALL DLL (1, ".....")


(edited for typos..)




Don't think, just code.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Feb 2008 18:40
You can't. There's no way that I know of to call an object member function with standard DBPro (the 'this' pointer is passed in a register, not pushed onto the stack).

You can probably do something with Styx - I believe that allows you to call COM objects from DBPro.

You could also write a simple wrapper:


Or you could write a proper DBPro command, and wrap everything even more nicely.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 27th Feb 2008 18:52
That would explain why it crashes when I did finally start calling the functions with the proper syntax..

CALL DLL 1, "?SetMaximumIncomingConnections@RakPeer@@UAEXG@Z", 50

I would consider myself a pretty good programmer, but a novice in C/C++. Given time I could probably pull of the simple wrapper method, but there's no way I've got the skills at the moment to write my own DBPro command DLL for networking.

I basically thought I would give this a try since we know for sure that RakNet is robust enough to handle an MMO. For the moment I'm writing a test app set up to use a modular subroutine for networking. This way I can use the exact same packets and program flow to test around subroutines written with both Utility 28, and Multisync to see A) which one is faster, and B) how many simultaneous connections they can handle.

I'm doing this bit first since there's little point in continuing down a development path with DBPro if there isn't a network function that can handle at least a few hundred players at the same time.


Don't think, just code.
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 27th Feb 2008 20:43
Quote: "ou can probably do something with Styx - I believe that allows you to call COM objects from DBPro."

While Styx does support exported COM objects it does not support "thiscall"-exported member functions. So it wouldn't work with this DLL. But I might as well add it to the next release.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 27th Feb 2008 21:41
Hmm.. Well, I'm almost done with the test app using Multisync. We'll see how that goes..


Don't think, just code.
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 28th Feb 2008 15:34 Edited at: 28th Feb 2008 15:35
sorry mate i told you to use the dll like that didn`t look into it enough to see that is was com objects..

anyway do you want all the functions in this libary or just some,

I could make you a wrapper if its not too many.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 28th Feb 2008 17:57 Edited at: 28th Feb 2008 18:02
At the moment I'm not sure. I'd have to do some digging into the documentation for it and figure out what I'm going to need.

At this point I'm still looking into whether or not DBPro will be able to handle being a dedicated server for an MMO game. It's been suggested that the overhead in DBPro is high enough that the processing wouldn't be able to keep up.

I need to find a way to organize about 100 people and get them all on the server at the same time. Then see where things are from there.

However, since you are offering..

Is about a dozen to many? All I think I would really need at the moment is the ability to use bitsreams. Compression would be nice, encryption would be awesome, but neither are really necessary at the moment.

Just need to be able to get data back and forth.

What might be an even better solution is if you would be willing to teach me how to build a wrapper. I've done some dabbling in VC++ with the Torque Gaming Engine over the last year, so I'm familiar with some C++ coding. Then I might be able to do a wrapper for the whole thing and make it available for everyone.


Don't think, just code.
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 28th Feb 2008 19:47 Edited at: 28th Feb 2008 19:49
here`s the link for 3rd party commands sdk http://developer.thegamecreators.com/?f=t03/index


try and follow it, if you get stuck post here and i will help ..

about the overhead if that network lib can cope db should be able to as well.

i will have a good look through the docs even though i dont know much about networking ..

more than likely you will be able to wrap the functions exactly.


ps which visual c++ do you have because you cant make string tables easily in the express editions
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 28th Feb 2008 21:05 Edited at: 29th Feb 2008 00:29
I have both Visual Studio 6, and .Net (which I guess is either 7 or 8)

Actually I think it was 2003..


Don't think, just code.
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 28th Feb 2008 21:26
if you post the specific functions you want and i will make a dll
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 29th Feb 2008 00:31 Edited at: 29th Feb 2008 00:58
Ok, I'm assuming that you've downloaded the RakNet ZIP from their web site. Inside the samples directory there's a small project called Bitstream.

That project should have examples of everything I should need to use Bitstreams in a client server scenario.

If you'd like I can pick through the source and write out each function. I wasn't sure if having an example to look at would help you or not.

Let me know..

and Thank You..


Don't think, just code.
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 29th Feb 2008 11:55 Edited at: 29th Feb 2008 19:24
I will get on it, it will give me somthing to do




chunks


[edit]

strugling to get it to work in db pro is there any other libarys which are any simpler , or the win api .
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 29th Feb 2008 19:55
I don't want to hijack the thread but just want to point out (for those who are interested) that this particular DLL is not a COM DLL (else it would work with Styx). COM DLLs do not export functions other than DllCanUnloadNow, DllGetClassObject, DllRegisterServer and DllUnregisterServer.
This library was compiled with VC++ and exports class member functions using the calling convention "thiscall" (which is not supported by DBPro).

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 29th Feb 2008 20:07
Hmm.. Well, thanks for the effort anyways..

I'm sure there are others out there. I'll continue my testing on Multisync for now and then on the Matrix1 Utility 28. If I find that I need something with more umph then I may have to consider moving to DarKGDK..


Don't think, just code.
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 29th Feb 2008 20:25
looks like this dll is no good for db , no wonder it keeps crashing ,cant even get the rakpeer startup command working

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 29th Feb 2008 23:58
Thanks for giving it a go.. I really do appreciate it.


Don't think, just code.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Mar 2008 00:10
That code as it stands is guaranteed to crash, through no fault of RakNet - the pointer 'p' hasn't been populated. You need to either populate the pointer 'p' with an instance of a RakPeer object, or replace it with an actual RakPeer object.

So, either populate the pointer:


or use an object:


That's untested of course - just examples to give you the right idea.

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 1st Mar 2008 07:34 Edited at: 1st Mar 2008 20:43
works a treat i learn somthing new everyday thanks IanM , looks like i can carry on working on this .


chunks

[edit] i haven`t got time to finish this becuse my dads taken ill, anyway heres the source ..

Attachments

Login to view attachments
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 1st Mar 2008 23:54
Chunks,

No worries.. You've already gone above and beyond.

Hope your dad gets better.

Thanks again.


Don't think, just code.

Login to post a reply

Server time is: 2024-09-08 03:20:09
Your offset time is: 2024-09-08 03:20:09