Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 7th, 2004, 8:20 AM   #1
Jakykong
Unverified User
 
Join Date: Oct 2004
Location: My computer
Posts: 2
Rep Power: 0 Jakykong is on a distinguished road
I am in the process of moving my old DOS programs into windows versions, and moving all of my efforts into a windows environment.(big job :o) Most of my programs use libraries(don'e most programs use them anyway? <_<). Since windows only supports DLLs as far as i can tell(i could be wrong ), i need to be able to make my libraries into DLLs. I have the C source code for all of my libraries(yes i make my own libraries ). Can anyone tell me how to compile C source code into a DLL file?
__________________
This account no longer is active. If any administrator or forum moderator finds this signature and has time to pay attention to it, please delete this account as it's just wasting space on your server.
Jakykong is offline   Reply With Quote
Old Oct 7th, 2004, 10:43 AM   #2
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
DLLs are the most commonly and best supported dynamic linking libraries you can use within windows. This does not mean that you can not use static libraries however.... I think every compiler out there has support for static libraries (commonly .lib files).

Working with DLLs is a bit complex to explain in a single post though, I actually recommend you take a look through the DLL information provided on MSDN. You can either download the MSDN documentation from the MS website, or you can access it onine at http://msdn.microsoft.com

Personally I recommend you download the documentation since it contains an easy to work with system for accessing all kinds of information and goodies on the Windows API.

There is a VERY THUROUGH overview of working with DLL files in the documentation. Bear these few things in mind though (since the way DLLs load and operate have changed a bit since Windows 3.1)

Windows 3.1: (16bit DLLs) Memory allocated in a DLL is shared amoungst all applications which load the DLL... you have to be very careful here not to corrupt memory... learning critical sections and semaphores here would be an asset to controlling memory usage. Though it is unlikely you will write these types of DLLs today.

Windows 95/98: (32bit DLLs) Each process that access a DLL is given its own stack to use within the DLL file. The DLL is loaded into non-virtual memory at a relative address accessed by all process interested in the DLL. Minor concerns relative to multi-threading should be given though here! You might want to do a bit of research on thread safety here, though non-thread safe functions should be FINE as long as you do not use multiple threads from one process on the DLL.

Windows 2000/XP: (32bit DLLs) In these operating system applications are actually assigned virtual memory, memory addresses relative only to the application accessing them. DLLs are mapped into the virtual memory address (though only loaded once in the memory still). Each process accessing a DLL has its own stack space like in 95/98. Only minor attention to multi-threading need to be given thought here, like in 95/98 based environments.
__________________
Clifford Matthew Roche &lt;geek@cliffordroche.com&gt;
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote
Old Oct 8th, 2004, 1:05 PM   #3
Jakykong
Unverified User
 
Join Date: Oct 2004
Location: My computer
Posts: 2
Rep Power: 0 Jakykong is on a distinguished road
thanks!

i'll look through the docs on MSDN, and i'll progably download them. Microsoft has probably the least-user-friendly site i have EVER SEEN! they have messed up on a lot of things(but you gotta love 'em!)


What about using static libraries, though? I know i use some in my Qbasic programs(Yes, i still use QB. it is a very powerful language if the functions/subs you use are in C or ASM to speed things up). As far a i knew, static libraries were limited to DOS, and weren't available to windows programs... but i guess i am wrong, so would someone please update me on the matter?
__________________
This account no longer is active. If any administrator or forum moderator finds this signature and has time to pay attention to it, please delete this account as it's just wasting space on your server.
Jakykong is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:21 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC