The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> C Programming
|
Importing a dll
Discuss Importing a dll in the C Programming forum on Dev Shed. Importing a dll C programming forum discussing all C derivatives, including C#, C++, Object-C, and even plain old vanilla C. These languages are low level languages, and used on projects such as device drivers, compilers, and even whole computer operating systems.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

October 20th, 2002, 06:19 PM
|
|
Contributing User
|
|
Join Date: Jan 2002
Location: Seattle WA
Posts: 863
  
Time spent in forums: 22 sec
Reputation Power: 13
|
|
|
Importing a dll
I'm sorta new to dlls, or more explicitly, how to use them. In my program, I have a line:
Code:
#import <msxml3.dll>
which obviously imports the Microsoft XML Parser. Now what exactly does this do? Does the pre-processor directive literally import all the classes and methods, such that the dll file is not needed to run the program? Or does it just allow the program to link to the dll, and it's still required?
Turns out, everyone who uses my program will have the dll, but I'm just not sure what's happening here, and I'd like to know.
-mj
|

October 20th, 2002, 06:37 PM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
|
The #import statement is used to import a type library. Basically, it causes the compiler to create a set of function prototypes and definitions for the type library into a header file. Wrapper functions and Helper classes are also generated by the compiler. The actual code from the DLL is not imported into your compiler, just the function prototypes, so your friends will still need the DLL for your program to work.
Hope this helps!
|

October 21st, 2002, 02:39 AM
|
|
Contributing User
|
|
Join Date: Jan 2002
Location: Seattle WA
Posts: 863
  
Time spent in forums: 22 sec
Reputation Power: 13
|
|
|
Excellent, thanks.
|

October 31st, 2002, 10:50 AM
|
|
Contributing User
|
|
Join Date: Oct 2002
Location: Flint, MI
Posts: 328
Time spent in forums: 1 h 19 m 25 sec
Reputation Power: 11
|
|
|
There's a second step that is generally necessary. Somewhere on your system is a file msxml3.lib that you will need to link against. This .lib file contains the function stubs so that you won't get unresolved references when you link your program.
The .lib file itself contains the necessary instructions to load the .DLL into memory and access its functions.
__________________
Clay Dowling
Lazarus Notes
Articles and commentary on web development
http://www.lazarusid.com/notes/
|

November 4th, 2002, 12:22 AM
|
|
Offensive Member
|
|
Join Date: Oct 2002
Location: in the perfect world
|
|
|
The library is created when you create the DLL. It is only needed when implicitly linking the DLL.
Else you can use the Dependancy walker ect and find the functions and then explicitly link using
GetProcAddress() and LoadLibrary() ect
__________________
The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.
Frank Zappa
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|