I am trying to make it so I can deploy a firemonkey project which uses Midas.dll onto another machine without having to copy the DLL over as well. This article explains how to do this with a delphi project by including MidasLib in your uses clause like so:
program Project1;
uses
MidasLib,
Forms,
Unit1 in 'Unit1.pas' {Form1};
I am not very familiar with delphi, but I assume that in C++ I would want to use an #include
statement in places of the uses
statement. Since MidasLib is a .pas file, I assume I am supposed to include Midas.hpp
. However, even though I include Midas.hpp
in the file that is using it, I still get an exception saying "Midas.dll not found."
How can I deploy my project without having to copy the Midas.dll file over with it?
You should also link the static library and call the RegisterMidasLib
function:
#include <Midas.hpp>
// or use the Project Manager's "Add to Project" option
#pragma comment(lib, "midas.lib")
extern "C" __stdcall DllGetDataSnapClassObject(REFCLSID, REFIID, void **);
void InitMidas()
{
#pragma startup InitMidas 254
RegisterMidasLib(DllGetDataSnapClassObject);
}
Further details here.