User (Legacy) Posted November 30, 2005 Author Report Posted November 30, 2005 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
User (Legacy) Posted November 30, 2005 Report Posted November 30, 2005 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
ztang Posted July 16, 2008 Report Posted July 16, 2008 Hi Mac: I am having the exact same problem with you. I just want to know have you sorted this problem out? If you do, could you please tell me how to achieve this? Tons of thanks.. Kindly Regards Tom
ztang Posted July 16, 2008 Report Posted July 16, 2008 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.