October 20th, 2002, 06:19 PM
Importing a dll
I'm sorta new to dlls, or more explicitly, how to use them. In my program, I have a line:
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.
October 20th, 2002, 06:37 PM
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
October 31st, 2002, 10:50 AM
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.
Articles and commentary on web development
November 4th, 2002, 12:22 AM
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.