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 / Using C# DLL in DBP - do I need a C++ wrapper?

Author
Message
Net Commander
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: United Kingdom
Posted: 7th Jul 2006 00:08
Could someone please enlighten me as to how to make a C# DLL usable in DBP... I've read around the forums about having to create a C++ wrapper that calls my DLL, but couldn't find an example.

So what's the process? Can someone out there give me a link to some articles on it?

Thanks.
EsteemDE
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 7th Jul 2006 01:28
C++ wrapper or DLL converter. C++ wraper is harder, DLL converter you just run it through a program and it is compatible with DBP with a full string table written for you.

I cant give you the converter I have, I am a tester of it and he wants to sell it once he is out of college. It is done, as far as "it works". He wants to add a keyword generator to it also. But I will convert your DLL for you if you send it to me. I use the same converter for all my Dark NET DLL's.

Current Project - Dark NET System Framework DLL
Percentage - 14%.......Lines of Code - 9,171
This Info Updated - 6/18/06 12:10pm
Net Commander
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: United Kingdom
Posted: 7th Jul 2006 11:34 Edited at: 7th Jul 2006 11:34
So you don't know of any free converters out there at the moment?
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 7th Jul 2006 13:52
the_winch had one
not sure if it worked too well tho

Science, Mathematics, and Physics do not lie - only people do.
EsteemDE
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 7th Jul 2006 16:40
I tried the converter winch made and it didnt work. It has many errors that make it almost impossible to work with. For example, if you have more than 30(i think) functions the string tables wont write correctly and cause serious errors. It also doesnt find C# functions correctly, only VB seemed to work for me.

Current Project - Dark NET System Framework DLL
Percentage - 14%.......Lines of Code - 9,171
This Info Updated - 6/18/06 12:10pm
Net Commander
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: United Kingdom
Posted: 7th Jul 2006 17:59
I'm a competent enough coder (but not C++) and have Visual Studio 2005, so can anyone just give me a quick tutorial (or point me to one), or maybe some example C++ wrapper code that I can alter and compile, then perhaps I can work the rest out... I'd really appreciate that
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 7th Jul 2006 20:51
youd want to speak to Exeat. He wrapped the DBP_NETLIB plugin for me. Do a deep search in this forum, you might find some more info when others asked the same questions, and he was nice enough to divulge a ton of info.

Science, Mathematics, and Physics do not lie - only people do.
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 7th Jul 2006 21:00 Edited at: 7th Jul 2006 21:07
Mine doesn't appear to work well with dlls compiled with .net v2.0. Not surprising really because it uses .net v1.1 ilasm and ildasm.
.net v2.0 was still in beta when I wrote it. Perhaps one day I will get it working with .net v2.0.

Stick to v1.1 and it works fine. There was a longstanding bug where it would lockup when building dlls with lots of functions. The work around was just to force quit it and ilasm would finish building the dll.

I fixed that bug today.

You can download it from here. Don't forget to read the docs and the dbpro TPC docs that should be at
C:\Program Files\Dark Basic Software\Dark Basic Professional\Help\documents\1 Third Party Commands.htm

Google inverse pinvoke if you want to learn how it all works.

By way of demonstration, he emitted a batlike squeak that was indeed bothersome.
Net Commander
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: United Kingdom
Posted: 7th Jul 2006 23:48
Think I found my answer in the 2nd to last post in this thread: http://forum.thegamecreators.com/?m=forum_view&t=31598&b=5. Hopefully, it should work for c# as it does for vb.net - I just need to learn how to do a string table now... think that's in the DBPro docs somewhere...
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 8th Jul 2006 01:09
cool, thats the thread I was thinking of where TheOneRing was asking about the c++ innards which I can't splain

Science, Mathematics, and Physics do not lie - only people do.
Matteroflight
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location:
Posted: 4th Aug 2006 22:15
I'm working on getting a certain DLL open again. I used the DLL Tool Kit a few years back for this DLL, and for some reason (a year later) it freezes when I try to open the DLL.

For those curious the DLL is (a freeware version) for a biofeedback device. I'm trying to isolate 2 commands, but there were too many to choose from. Which is why I put it away for a year.

I'm just trying to reopen the DLL. I have 1.1 .NET SDK installed, the DLL is C++. What other criteria do I need to meet for it to work? It was much easier last time...

Peace,
-Michael

"Imagination is more important than knowlege"
"Reality is merely an illusion, Albeit a very persistant one."
-Albert Einstien

Login to post a reply

Server time is: 2024-11-22 06:11:35
Your offset time is: 2024-11-22 06:11:35