Jump to content
Software FX Community

Is there a way to create an instance of ChartFX without using a windows handle?


User (Legacy)

Recommended Posts

Hi I was just wondering if it was possible to create an instance of ChartFX

without having to use CWnd?

In client server version 5.5 I could do the following:

bool created = false;

if( !chart_fx ){

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 ) ) ) ){

COM_CHECK( ((IUnknown*)unk)->QueryInterface( __uuidof(

IChartFX ), (void**)&chart_fx ) );

}

}

}

Thanks for your time.

-Mac

Link to comment
Share on other sites

Hi I was just wondering if it was possible to create an instance of ChartFX

without having to use CWnd?

In client server version 5.5 I could do the following:

bool created = false;

if( !chart_fx ){

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 ) ) ) ){

COM_CHECK( ((IUnknown*)unk)->QueryInterface( __uuidof(

IChartFX ), (void**)&chart_fx ) );

}

}

}

Thanks for your time.

-Mac

Link to comment
Share on other sites

  • 2 years later...

Hi MAC:

I know in Version 5.1  we can do this as well. But I tried on Version 6.2 and replace the cfx4032.dll with ChartFX.ClientServer.Core.dll, seems the code you listed above doesn't work as expected. If we use m_pChartFX -> Export(Cfx62::Fileformate_Bitmap,L"C://anybitmap.bmp") then GPF.Or an empty bmp file generated.

 

Tom

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...