How to use an external dll file in a managed visual c++ project generated through firebreath -
i have use functions of external dll file in firebreath project. project managed c++ project. want know how refer or include external file in project.i not getting add reference option in visual studio 2010 (because managed c++ project). please tell me way this..
assuming know names of functions want call within dll, mechanism have use following:
// these examples of functions --> change return values , params needed typedef char (winapi *dll_func1) (ushort, ushort); typedef char (winapi *dll_func2) (ushort, uchar*, uchar*, ushort, uchar*, ushort*, uchar*); typedef char (winapi *dll_func3) (ushort); // load library hmodule hdll = loadlibrary( l"\\path\\to\\your.dll" ); // check if dll loaded if (hdll == null) { // error return; } // assign functions dll_func1 func1 = (dll_func1) getprocaddress( hdll, "name_of_func1" ); dll_func2 func2 = (dll_func2) getprocaddress( hdll, "name_of_func2" ); dll_func3 func3 = (dll_func3) getprocaddress( hdll, "name_of_func3" ); // use functions --> here func1 example if( func1( 1, 2 ) != ok ) { // or whatever return value // error freelibrary( hdll ); return; } // --> go on working dll functions // not forget call @ end freelibrary( hdll );