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 do you make dll's ?

Author
Message
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 27th Apr 2005 15:47
can the process be explained?
i am thinking maybe i can write a lot of functions in c++
(which i am new to) and have them used in DBP,
but i don't really know how to do it...
thanks,
bob

http://astrumgames.com
completed games: Astrum Erus, Centipoid, Hero Of Garaven, WarpFlight, Higher Ground , Circular Breakout
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 27th Apr 2005 15:51 Edited at: 27th Apr 2005 15:52
Certainly :

1. Buy Visual Studio. Preferably Visual Studio .Net 2003
2. Install on computer
3. Learn C whilst being installed - you'll have enough time...
4. Create Win32 DLL project
5. Type in functions and da codez
6. Create String resource
7. Compile program
8. Get decorated function name somehow
9. Put in the name you want to call the function, the function name and comment into string details
10. Copy DLL into plugins-user directory.

Simple...

Visit http://homepages.nildram.co.uk/~nickk
Calm down dear! Its only an election...
IanG
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 28th Apr 2005 01:34
Quote: "8. Get decorated function name somehow"


use dependency walker which comes with ms vs.net 03

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 28th Apr 2005 06:01
But most people use notepad

Visit http://homepages.nildram.co.uk/~nickk
Calm down dear! Its only an election...
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Apr 2005 08:29
I use either wordpad or dumpbin ('dumpbin /exports xxx.dll') myself.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 28th Apr 2005 17:22
you can't do it with dev-c++ ?
do you just 'make exe' and use that?
or is there a 'make dll' on some compilers?

6. Create String resource
8. Get decorated function name somehow
what is meant by these?

thanks ,
bob

http://astrumgames.com
completed games: Astrum Erus, Centipoid, Hero Of Garaven, WarpFlight, Higher Ground , Circular Breakout
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Apr 2005 22:04
Yes, you can use Dev-Cpp, but it's more difficult to get hold of DBPro internals.

Make exe? Make dll? C'mon, you need to be a 'real programmer' if you are going to write plugins

6. Create string resource.
This is where you instruct DBPro which commands and functions you have provided in the DLL, as well as what arguments they take, and the results they return (if any).

8. Get decorated function name.
In C++, you can have multiple functions with the same name, as long as their argument types are different, and the compiler works out which you want. When exporting the functions, the compiler gives them different names by adding 'decorations' to the name based on the argument types, making them unique.

For example, in Visual C++:
void MyFunc(int,int,int,int) becomes MyFunc@@YAXHHHH@Z
char* MyFunc(char*,int,int) becomes MyFunc@@YAPADPADHK@Z

Dev-CPP does the same, but uses a different name mangling system.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
IanG
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 29th Apr 2005 02:15
Do you actually know what the decorated function means - i know you can read them with the dependecy walker, but do you know what each letter is for??

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 29th Apr 2005 21:19
It's possible to work it out for both Visual C++, and GCC ... it's a lot simpler for GCC. I did get to the point where I'd get around 80-90% accurate with VC++ - talk about needing to get out more

I just use the 'undname' command to convert a mangled name back now.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
1tg46
20
Years of Service
User Offline
Joined: 1st Feb 2004
Location: I dont know!
Posted: 30th Apr 2005 12:35
You could use Visual Basic.NET and use the_winch's dll_tool to convert the dll to a dll that DBP can understand.


Click sig for DB Network X
EddieB
20
Years of Service
User Offline
Joined: 29th Sep 2004
Location: United Kingdom
Posted: 30th Apr 2005 21:47 Edited at: 30th Apr 2005 21:49
You can use DevC++ to make .dlls for Dbpro. Apex now's importer is made using it.

All you have to do is somthing with string tables .

Look in issue 24 of the newsletter theres a tool for this.

Many Thanks
Eddie

[href]http:www.graphics-monkey.co.uk[href]
"Him? A guru? Rich is the guru, David T is just good"
Metel Artz
19
Years of Service
User Offline
Joined: 13th Apr 2005
Location: Vermont USA
Posted: 14th May 2005 14:39
Quote: " But most people use notepad
"
me being a noob in dll, i didnt know you could make one in notepab but would you save it as .dll?

EddieB
20
Years of Service
User Offline
Joined: 29th Sep 2004
Location: United Kingdom
Posted: 15th May 2005 20:12
Quote: " but would you save it as .dll?"


no! You compile it in DevC++ or another Compiler.

You cant just save it as a .dll

Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 15th May 2005 20:15
Quote: "Quote: " But most people use notepad
"
me being a noob in dll, i didnt know you could make one in notepab but would you save it as .dll?"

That's to find the decorated name for use in the string table

Pi = 8
IanG
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 16th May 2005 00:54
i think he's talking about actually writing the code

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 21st May 2005 13:35
hmm c++ i recoommend but c and c++ is quite similar until u start getting to a few high level points which u may or may not be able to use in your projects
i actually prefer C because pellesC is free, has a well developed ide, supports stringtables, and should work with globstruct.h(havent tested using it any but the actual file compiles)




actually i cheated a bit and made a few functions with bcx(basic to c translator) but about 10 functions are made without bcx


anyway if that helps any

formerly shadows of emptiness
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 22nd May 2005 00:26
Pelles C will only work with DBPro if you remove all DirectX headers and calls.

Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 22nd May 2005 02:22
yes i just figured that out when i got globstruct and included the dx headers but still it lets me use the win32api which is most of the time all i need besides strings (thats really annoying about strings)

formerly shadows of emptiness

Login to post a reply

Server time is: 2024-11-23 09:59:23
Your offset time is: 2024-11-23 09:59:23