Jump to content
Software FX Community

Problems in distributing to window2000 Server

User (Legacy)

Recommended Posts


I'm using Chart Fx client server 5.1

with Visual C++ 6.0, on Windows XP.

Few days ago I ask for "license and distribution" problem.

Thank to fast reply, I can solve the problem.

My program show charming chart on other XP computer.

But, today I found the program does not show chart on computers whose O/S is

"Windows 2000 server",

Same situation as it's license is not registered.

detail information goes from here.....................

I use two dl files, 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

making chart routine is this.....................................

IClassFactory2 *pFactory2;



unsigned short s[] = L"___MY_LICENSE_STRING____";

hr =


ry2,(LPVOID FAR *) &pFactory2);

if (SUCCEEDED(hr)) {

hr = pFactory2->CreateInstanceLic(NULL,NULL,IID_IUnknown, s, (LPVOID FAR

*) &pUnk);

if (SUCCEEDED(hr)) {

m_pChartFX = pUnk;






if (m_pChartFX!= NULL) {

m_pChartFX->CreateWnd((long)hwndParent, nID, x, y, cx, cy, dwStyle );

m_hwndChartFX = (HWND) m_pChartFX->hWnd;

m_chartFlag = TRUE;



return m_chartFlag;

Awaiting the pleasure of your reply.

Link to comment
Share on other sites

Thanks for fast reply.

Yes, "hr" return value is not valid.

I compare with old version, and I found the reason.

I move the "CoInitialize(NULL);" command to other position, but it was wrong


In early version, "CoInitialize(NULL);" run every time chart is maked.

I want it to be initialize once, but it was wrong.

Now I put the code to "CMyProgramApp::CMyProgramApp() {}"

And It works!

I hope it is useful to the others.

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.

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.


  • Create New...