Assistance with global object in C++ dll
Status: Open
Selected Providers: -
Budget: $30-250
Created: 09/19/2009 at 23:26 EDT
Description
Attached is a simple dll with a CodeBlocks project using MingW. It uses the Vole library to call a COM object (http://vole.sourceforge.net).I have run into a stumbling block in that the object g_pTradeDesk2 needs to be global so it can be accessed from other dll functions (such as the FXCMSecond). However, Vole won't allow the creation of an object and then an assigning of what that object is in two steps. Compile the enclosed sample and change the line that reads:
object g_pTradeDesk2 = oCore.invoke_method9object)(L"CreateTradeDesk", L"trader");
to this:
g_pTradeDesk2a = oCore.invoke_method(object0(L"CreateTradeDesk", L"trader");
This will error out since g_pTradeDesk2a is the global variable that needs to be global (in some method).
This is a simple task for a seasoned C++ programmer, but I cannot get past it.
Thanks!
freelance it jobs
0 comments:
Post a Comment