User (Legacy) Posted September 3, 2002 Report Share Posted September 3, 2002 I'm using Chart Fx client server 5.1 in Visual C++ 6.0 I use dll, and load chart dynamicaly in my StdAfx.cpp file #import "sfxbar.dll" no_namespace implementation_only #import "Cfx4032.dll" no_namespace implementation_only I want to run my program on computers where Chart Fx is not installled. So I register dlls like this regsvr32.exe Cfx4032.dll regsvr32.exe SfxBar.dll and use Licence string as in the aticle Q1381002. IClassFactory2 *pFactory2; LPUNKNOWN pUnk; // CoInitialize(NULL); HRESULT hr; char s[] = "__________My Licence String ___________________"; hr = CoGetClassObject(__uuidof(ChartFX),CLSCTX_INPROC_SERVER,NULL,IID_IClassFacto ry2,(LPVOID FAR *) &pFactory2); if (SUCCEEDED(hr)) { hr = pFactory2->CreateInstanceLic(NULL,NULL,IID_IUnknown, (unsigned short *)s, (LPVOID FAR *) &pUnk); if (SUCCEEDED(hr)) { <============= not true! m_pChartFX = pUnk; <=== so not run pUnk->Release(); } pFactory2->Release(); } m_pChartFX.CreateInstance(__uuidof(ChartFX)); if (m_pChartFX!= NULL) { m_pChartFX->CreateWnd((long)hwndParent, nID, x, y, cx, cy, dwStyle ); m_hwndChartFX = (HWND) m_pChartFX->hWnd; } chart is created in my computer. but not in other computer. Please Help me. Link to comment Share on other sites More sharing options...
Software FX Posted September 3, 2002 Report Share Posted September 3, 2002 The License String is a UNICODE string, so instead of: char s[] = "__________My Licence String ___________________"; you must have: unsigned char s[] = L"__________My Licence String ___________________"; -- FP Software FX, Inc. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.