Jump to content
Software FX Community

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


User (Legacy)
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...