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 / Making a DBPro DLL using C Sharp (a tutorial)

Author
Message
KISTech
11
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 7th Aug 2009 22:49 Edited at: 11th Aug 2009 22:13
This tutorial turned out to be a dud, and has been replaced with this new tutorial.

http://forum.thegamecreators.com/?m=forum_view&t=155990&b=18

Attachments

Login to view attachments
Phjon
13
Years of Service
User Offline
Joined: 28th Nov 2005
Location:
Posted: 8th Aug 2009 00:08
KISTech,

I was hoping you would actually be able to fix the_winch's program to allow it to work under .NET 3.5. As I have mentioned in the other thread, the dll_tool will not allow .dll's made under this particular version of the .NET Framework.

Perhaps I'm jumping in too soon - maybe you're already trying to get the dll_tool to work under .NET 3.5.
wildbill
13
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 8th Aug 2009 00:16
Just downloaded DLL_Tool. Thanks for the tut
KISTech
11
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 8th Aug 2009 00:58
@Phjon,

It does work, or at least that's what I'm using. If you can point me to a place to download the .Net 3.5 SDK I'll do my best to check it out, but I haven't been able to find one. The closest thing I found was over a 1 Gig download and didn't have the SDK tools (ilasm and ildasm), it was just the Windows 2008 SDK with the .Net 3.5 framework redist.

The DLL_Tool in my tests has worked with a .Net 3.5 class library while the DLL_Tool is using the ilasm and ildasm from the .Net 2.0 SDK.

@wildbill,

Hope it helps. It's been driving me nuts..

Phjon
13
Years of Service
User Offline
Joined: 28th Nov 2005
Location:
Posted: 8th Aug 2009 01:03
KISTech,

Type in "dotnetfx35.exe" into Google. It should be the second link from the top which points to where the download is (size 231.5 MB).
KISTech
11
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 8th Aug 2009 01:18 Edited at: 8th Aug 2009 01:23
Not sure what that is, but it's not the .Net Framework SDK for 3.5.

[edit]
That appears to be the full download for the .Net Framework 3.5 redistributables. I haven't been able to find anywhere that says an SDK even exists for it..

Phjon
13
Years of Service
User Offline
Joined: 28th Nov 2005
Location:
Posted: 8th Aug 2009 01:34 Edited at: 8th Aug 2009 01:52
KISTech,

I've just had an idea.

If I uploaded one of my VB dlls to the forum that needs to be converted, could you try and see if it will convert using the dll_tool on your PC?

Edit: I'll be back online in about 11-12 hours time to have a look at any replies...it's approaching midnight where I live.
KISTech
11
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 8th Aug 2009 01:53 Edited at: 8th Aug 2009 04:21
I'll give it a shot. Zip it and send it to my email if you like.

[edit]
Ok, I ran into a snag. I'm not sure exactly where the issue is, but it's likely something I've included in the C# DLL that the .Net 2.0 ilasm can't find.

So now I'm kind of stuck again until we can track down the .Net 3.5 SDK or use a different dev environment that still makes use of .Net 2.0. I'll look into SharpDevelop in the next day or two. http://www.icsharpcode.net/OpenSource/SD/

Phjon
13
Years of Service
User Offline
Joined: 28th Nov 2005
Location:
Posted: 8th Aug 2009 14:49
KISTech,

Are you still able to convert my dll using dll_tool - perhaps using a "less-modified" backup version?

In either case, the dll is attached to this post; its basically the VB equivalent of the C# dll described in your tutorial.

The reasoning behind my idea is as follows:

If you can convert my dll, then you could return it to me (via the forum), and I could then dissassemble it to work out the differences between the converted dll and the non-converted dll. I could then adjust my own dll converter to be able to produce true TPC DBPro-usable dll's, rather than half-way-house dll's that my program can do at the moment.

Attachments

Login to view attachments
KISTech
11
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 8th Aug 2009 19:22 Edited at: 8th Aug 2009 20:02
It didn't work, and ilasm's error output is, well, it stinks. It doesn't tell you anything at all about why it didn't work.

Does anyone still have a copy of the setup file for C# 2005?

I'm installing SharpDevelop now. The latest version supports .Net 2.0, 3.0 and 3.5.

[edit]
For my purposes at least, SharpDevelop isn't working either. I'm currently working on pairing down the functions I've created to figure out which one it's having issues with. Everything looks fine until I go to build it in DLL_Tool, and it gives an error, but there's no real meaning behind the error. Very frustrating..

Phjon
13
Years of Service
User Offline
Joined: 28th Nov 2005
Location:
Posted: 8th Aug 2009 20:09
KISTech,

Have you looked into my suggestion - altering the contents of the drop down boxes?

I'm not entirely sure what you've changed in terms of the dll_tool source.
KISTech
11
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 8th Aug 2009 21:01
Haven't changed anything in the dll_tool yet. The drop downs pull their information from the registry, and then go find and verify the files exist, so they're actually pointing at the right files.

What I'm doing at the moment is running ilasm.exe on the source files that dll_tool outputs. I just ran the first test of that and ilasm gave an actual error in the file to look at, so I'm making a little progress. If I can track down what's causing ilasm to fail, then maybe I can backtrack the source of that and figure out what we're missing.

Phjon
13
Years of Service
User Offline
Joined: 28th Nov 2005
Location:
Posted: 8th Aug 2009 21:12 Edited at: 8th Aug 2009 21:39
KISTech,

Sounds good.

Could you explain what you mean by the "source files", in the context of your post? Are these files just the dll_tool.exe, dissassembled using ildasm.exe, to an .il file and related files, or are they something else entirely?

Edit: I think what might be causing the problem is the dll filename that is passed to the "Load()" function - it doesn't seem to be able to find the file and as there seems to be no error catching in place, it might be this.

Then again, it might not, but if it isn't the ildasm/ilasm exe's that are causing the problem, then it is more likely to be the dll filename.
KISTech
11
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 8th Aug 2009 21:37
Yes, I'm tracking down errors that ilasm says exist in the _dll.il file that dll_tool created.

Right now I'm hung up on this line, which I can't find a resolution for.

[2] class [mscorlib]System.Exception V_2,[3] int32 CS$1$0000)

ilasm says,

syntax error in token '['

Phjon
13
Years of Service
User Offline
Joined: 28th Nov 2005
Location:
Posted: 8th Aug 2009 21:49
KISTech,

As I can at least generate a .il file from a .dll with my own converter, I'll have a look at what .il code my program generates, and see where there could be differences.

I'm thinking that perhaps there should be a space between the comma and the left-hand square bracket, but I won't know for sure until I run some tests.
KISTech
11
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 8th Aug 2009 22:23
That doesn't help either. I even removed the comma and put the [3] int32 CS$1$0000 on a separate line. It still complains about the same line.

Can't seem to find a language reference for MSIL either. So no real way to tell what the syntax should be..

Phjon
13
Years of Service
User Offline
Joined: 28th Nov 2005
Location:
Posted: 8th Aug 2009 22:34 Edited at: 8th Aug 2009 22:36
KISTech,

I have found an instruction set reference for MSIL which might help (type into Google "CIL Instruction Set Specification" ).

I'm not having much luck myself on this, and I'm not sure if I'm able to provide any more help on this thing - trying to adjust the dll_tool via the .il code to fix it may be beyond my capabilities at this time.

The only way forward for me is to try and work out how to add the resource strings needed for DBPro to see the dlls that my program produces as TPC dlls. This may take a little time, as my timetable is becoming a little more inflexible, and the time I might have to look at things like this may diminish.

However, I will put some time aside to tackle this.

----------------------------------------------------

Edit: Aha! the_winch has posted on the other thread with some help!
KISTech
11
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 9th Aug 2009 01:52
You should be able to look at the dll_tool source code and figure out how he's putting together the resource strings. That part shouldn't be to hard.

I think the problem now is coming up with a DLL that ildasm and ilasm from the 2.0 Framework can work with.

I'm still plugging away at this as time allows...

KISTech
11
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 9th Aug 2009 08:59 Edited at: 9th Aug 2009 20:54
Does anyone know what happened to ZKAT8IT's DLL program?

There's broken links to a single use demo, then it just disappears..

KISTech
11
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 10th Aug 2009 01:14
Ok, got my hands on ZKAT8IT's program. Purchased it for $25 US, and it seems to be working perfectly.

I'm abandoning this thread, as it's based on the_winch's DLL Tool, which he stated in another thread that he'll most likely not continue any further development on.

Once I have some things ironed out I'll post a new thread with some information about ZKAT8IT's program, and maybe a replacement tutorial if needed.

Thanks for putting up with my ramblings while I figure this stuff out. It's not rocket science, but to some of us it might as well be.

Login to post a reply

Server time is: 2019-10-18 23:05:24
Your offset time is: 2019-10-18 23:05:24