Home › Forums › Programming › Linking dll to C++ at runtime.
- This topic has 3 replies, 2 voices, and was last updated 18 years, 9 months ago by Anonymous.
-
AuthorPosts
-
-
07/03/2006 at 2:32 pm #5129AnonymousInactive
Hi All,
I am trying to link to a dll in c++ when I run my application. I am using a database called SQLITE. To access it I want to use SQLPI++. There is a DLL with it called libsqlapi.dll. Instead of having to install it every time i go to a deployment computer I want to “register” the DLL for use by my C++ application (Asteroids Game) at runtime.
Does anyone know a way fo doing this, prefereable for any DLL. I am sure it is used in game programming, instead of having to create a specific installer for my game :(
Any insight would be greatly appreciated.
I am using BloodshedDEV C++, but also have access to Visual Studio 6 is anyone knows links to code examples, but im not worried about Environment specific issues,Rob
-
07/03/2006 at 3:34 pm #30021AnonymousInactive
Hi All,
I am trying to link to a dll in c++ when I run my application. I am using a database called SQLITE. To access it I want to use SQLPI++. There is a DLL with it called libsqlapi.dll. Instead of having to install it every time i go to a deployment computer I want to “register” the DLL for use by my C++ application (Asteroids Game) at runtime.
Does anyone know a way fo doing this, prefereable for any DLL. I am sure it is used in game programming, instead of having to create a specific installer for my game :(
Any insight would be greatly appreciated.
I am using BloodshedDEV C++, but also have access to Visual Studio 6 is anyone knows links to code examples, but im not worried about Environment specific issues,Rob[/quote:e21e991c33]
Think what you need is LoadLibrary.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/loadlibrary.asp
Basically you provide it with the path to your where your .dll resides (game directory). Do this at the very beginning of you game code and the functions within it should be exposed to your code. Hope that helps.
Peter
-
07/03/2006 at 4:55 pm #30025AnonymousInactive
Sweet man. Ill give this a shot and let you know the outcome. thanks
-
30/03/2006 at 11:49 am #30404AnonymousInactive
Cheers , that worked a treat, no more fiddly code.
-
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.