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 / How to make a simple dll in VB.net2005?

Author
Message
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 18th Jan 2007 18:56
OK,i have bein wondering how i could do this lately...as well,i know DBP and i'd like to try giving my DBP a more well,a touch of myself.

I have bein looking trough these forums and havent realy found any good tutorial or example how to make a working DLL in VB.net2005,and as i know.CattleRustler makes them in VB.net.

So it is possible,but...How?

Thanks for your time.

CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 18th Jan 2007 19:39
the best way would be to use ZK's .net converter.
you'll code your dll as a class project, and scope everything to Public or Private Shared, everything else is as it would be coded for a .NET caller. Only thing to remember is you cant pass complex types between dbp and the dll, so forget functions that return or accept arrays and the like. Oh also strings needs a helper module that zk and apex worked out, but its only called if a function returns a string. I have examples for this stuff, and can help you along the way if you like, but first see if you can get ZKAT8IT's converter app.

Basically what that does is take your compiled dll and decompiles the IL, makes some adjustments, and allows you to embed the string table (which it generates ). Very neat stuff imho

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 18th Jan 2007 20:58
I dont understand a part of those classes you say something about

CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 19th Jan 2007 00:21
I dont understand which part you dont understand.

Mr Anderson
20
Years of Service
User Offline
Joined: 14th Oct 2003
Location: NYC
Posted: 24th Jan 2007 04:48 Edited at: 24th Jan 2007 05:28
I was interested in this too.

So you are saying that the IL dll that the vb.net compiler generates can be consumbed by DBPro directly?

I mean of course after modifications are made to the IL (for example using that tool) which gives the native code generator the right information so that DBPro can consume the dll?

I don't get it

Could you link us to that .NET tool thread?
[Edit]
Here are some informative links
http://forum.thegamecreators.com/?m=forum_view&t=42944&b=8&p=0

http://forum.thegamecreators.com/?m=forum_view&t=85711&b=5
[/Edit]

I still want to know the manual coding process.

IDIC (Infinite Diversity Infinite Combinations)
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 24th Jan 2007 13:58
yes, the converter makes a new dll from the .net dll which is directly consumable from dbp (its not a wrapper). The new dll gets dropped inside the plugins-user folder like any plugin written in c++ would.

Quote: "I still want to know the manual coding process."

Do you mean the process of whats occurring to the dll via the converter, or the coding process for the .net dll portion?
(I won't be able to help you if its the former)

the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 24th Jan 2007 18:02 Edited at: 24th Jan 2007 18:05
Quote: "I still want to know the manual coding process."


Google for inverse pinvoke or reverse pinvoke.

Essentially it requires using ildasm to disassemble the dll into MSIL.
Then making some modifications to the disassembly before assembling it again with ilasm.
If you are using .net v2 the modifications are very small and simple. See the first post by Serge Lidin in this thread. .net v1 is a bit more work.

dll tool is my free tool that attempts to automate the process.

Alternatively tgc sell a plugin called Styx which allows you to use .net dlls without modifying them.

By way of demonstration, he emitted a batlike squeak that was indeed bothersome.

Login to post a reply

Server time is: 2024-04-20 14:42:21
Your offset time is: 2024-04-20 14:42:21