Home Forums Programming Linking dll to C++ at runtime.

This topic contains 3 replies, has 2 voices, and was last updated by  Anonymous 12 years, 2 months ago.

  • Author
    Posts
  • #5129

    Anonymous

    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

  • #30021

    Anonymous

    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

  • #30025

    Anonymous

    Sweet man. Ill give this a shot and let you know the outcome. thanks

  • #30404

    Anonymous

    Cheers , that worked a treat, no more fiddly code.

The forum ‘Programming’ is closed to new topics and replies.