Jump to content
Software FX Community

Can ChartFx Client Svr work/be created in thread that uses the free threading model??


User (Legacy)

Recommended Posts

right now I call coinitialize like this:

CoInitializeEx( NULL,COINIT_MULTITHREADED | COINIT_SPEED_OVER_MEMORY );

However when I go to create an instance of ChartFX( using the following ):

CComPtr<IClassFactory2> factory;

CComPtr<IUnknown> unk;

CLSID fac_id =

{0xFFF90AC1,0x4659,0x11D1,{0x8F,0xD4,0x00,0xAA,0x00,0xBD,0x09,0x1C}};

//{FFF90AC1-4659-11d1-8FD4-00AA00BD091C};

if( SUCCEEDED( COM_CHECK( CoGetClassObject( fac_id, CLSCTX_INPROC_SERVER,

NULL, IID_IClassFactory2, (void**)&factory ) ) ) ){

CComBSTR com_bstr( FX_LIC_STR );

if( SUCCEEDED( COM_CHECK( factory->CreateInstanceLic( NULL, NULL,

IID_IUnknown, com_bstr, (void**)&unk ) ) ) ){

if( SUCCEEDED( COM_CHECK( ((IUnknown*)unk)->QueryInterface(

__uuidof( IChartFX ), (void**)&chart_fx ) ) ) ){

//Chart Created Successfully

}

}

}

the QueryInterface for __uuidof( IChartFX ) returns E_NOINTERFACE

BUT if instead I used:

CoInitializeEx( NULL,COINIT_APARTMENTTHREADED | COINIT_SPEED_OVER_MEMORY );

as my coinitialize call then everything works out just fine.

Is there a way to get around this problem for Multithreaded settings?

-Mac

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...