Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
how to make a DLL with c++

 
Post new topic   Reply to topic Printable version
 View previous topic  Files/programs to include in Server.zip Post :: Post CatId biller to include in Server.zip  View next topic  
Author Message
kinghellz
Guest


Offline

PostPosted: Sun Oct 07, 2007 9:18 am   Post maybe stupid    Post subject: how to make a DLL with c++ Reply to topic Reply with quote

I know C++ up to functions, and i just want to ask can any one tell me how dlls work and how to use them.

My first question, in the exe file do you have to type in like #include code.dll or something like that so that program would use the dll


in the dll do you have to do something like #include helloworld.exe for it to attach the code?

Can any one just write a quick tutorial how to do hello world, like so the exe file would say hello world skip a line, and then code from dll say hello world.(also how to do it in DEV c++)

I searched on google nothing helped me
Back to top
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Sun Oct 07, 2007 12:25 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

basicly the dll file contains functions implementations (.cpp or .c), and shares a header file (.h) with the executable.

The executable can then lookup functions by name, in the case of dynamic linking anyway. You also need to set certain flags in the compiler so that it knows your compiling a .dll rather than an .exe.

Attached is a simple example of this (using inheritance too, which you can ignore). dlltest is the actual .dll, and dllcaller is the program that calls the dll.
_________________
SubSpace Discretion: A Third Generation SubSpace Client




dll!.zip - 848.91 KB
File downloaded or viewed 31 time(s)
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Dr Brain
Flip-flopping like a wind surfer


Age:39
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sun Oct 07, 2007 6:32 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Bak's example is of run time linking, which it isn't clear that you need. For static linking (you know which dll to use when you compile it), you should tell your compiler to link against your dll. I don't know the exact settings for dev c++, but if that's what you want then maybe someone else can fill in the missing details.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Tue Oct 09, 2007 3:04 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

In Devcpp you can start a new dll project which should come with a template.

Once you have your dll you can link it via project options, parameters, then click on "add library or object". Usually you link to the .a file (gets generated when you compile the dll) but the actual .dll file works too (you'll need to change the filter to all files to see the .dll file).
_________________
ss news
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Trash Talk All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 30 page(s) served in previous 5 minutes.

phpBB Created this page in 0.815792 seconds : 29 queries executed (94.3%): GZIP compression disabled