as far as i know, plugins are dlls that are enumerated and "linked?" at
runtime as compiled code, them being compiled being the important
part so they go nice and quick.
if anyone can help me with some info on this topic id be greatful.
at the moment, the only things ive thought of were to interpret them
(which isnt good for plugins that are supossed to rasterize, interpreted
rastering doesnt sound like a good combination)
or to put a linker in the directory and link them with an exe whenever a
new part is added (is that a crazy idea or would it be ok?)
thanks.
plugins
Started by rouncer, Jan 02 2007 05:52 AM
4 replies to this topic
#1
Posted 02 January 2007 - 05:52 AM
#2
Posted 02 January 2007 - 06:20 AM
All DLL files are loaded and linked in at run time. Most DLLs provide an accompanying .lib file, called the import library, which contains the code to do this automatically so you don't have to worry about it. But you can also do it yourself. Just use the WinAPI functions LoadLibrary, which loads a DLL and attaches it to a running program, and GetProcAddress, which lets you look up the address of a function in the DLL by its name. To make a plugin interface, all you have to do is create a set of functions that DLLs need to implement that can be looked up and called by your program. You can also provide an API to your plugins, i.e. a set of functions in your program that the DLL can call. This can be done by passing a structure containing pointers to the API functions from the program to the plugin during initialization. You can also do all this in a nice object-oriented way with interfaces and virtual functions (which is how COM works).
reedbeta.com - developer blog, OpenGL demos, and other projects
#3
Posted 02 January 2007 - 06:38 AM
thanks alot.
so you just make a function pointer that points to the address getprocaddress gives you?
[EDIT] dont bother answering, i guess so :)
so you just make a function pointer that points to the address getprocaddress gives you?
[EDIT] dont bother answering, i guess so :)
#5
Posted 05 January 2007 - 08:38 AM
ive made up my dll interface, ive got a dll, and the library is loaded, but how
do you call the function from getprocaddress?
[EDIT] dont worry fixed it, you gotta typedef it. [/EDIT]
hey thanks alot, my programming just went through the roof.
do you call the function from getprocaddress?
[EDIT] dont worry fixed it, you gotta typedef it. [/EDIT]
hey thanks alot, my programming just went through the roof.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












