I want to use the MSChart ocx and embed it in a web page. On my DEVELOPMENT machine (Frontpage, VC++ 5.0, VB 5.0, etc) everything appears to be working wonderfully.
The web page has an <OBJECT> tag with the MSChart class id and CODEBASE referring to http://activex.microsoft......./MSChart.cab
Now, on my TEST machines (one NT 4.0 sp5 & one Win 98) when I open the web page, a dialog pops up asking about DL and running signed control MSChart blah blah. I click OK, and the MSChart control is installed on the test machine(s). (ALL machines are running IE 5.0). However, IE does not display the MSChart control, but instead simply shows the box with the crappy red "X" indicating that the control failed to load and run.
I know what you are thinking - possibly the control was not registered.
- Nope, the control was correctly registered on both test machines.
How about this one - possibly dependent DLLs and OCXs were not installed.
- Nope, it would appear that all dependent DLLs and OCXs were also installed. It actually turns out that the the MSChart control is not dependent on any other DLLs or OCXs.
Could I be wrong about no other dependent OCXs or DLLs?
-Possibly, but when I ran IE through Visual C++, I noticed that no other pertinant DLLs were loaded.
What about the VB runtime DLLs?
-Installed those for good measure.
At this point I wrote both a VB exe and a VC++ exe that creates a MSChart control USING THE VISUAL TOOLS. i.e, in VB I plopped a MSChart control on a VB form and I did the same for the VC++ exe. Guess what - it worked on both the DEVELOPMENT and TEST machines.
With this in mind, I created a new dialog based VC++ project and attempted to create an instance of the MSChart control using CWnd::CreateControl. It worked on the DEVELOPMENT machine but didnt work on either of the TEST machines.
Now, at this point I became VERY frustrated, so I installed VB 5.0 on the NT 4.0 TEST machine. Guess what happened...it worked (both the web page and the aforemention example (the CWnd::CreateControl one) that previously failed)! <grumble> I figured that it worked with VB 5.0 installed - lets uninstall VB 5.0 from the TEST machine and attemped the to run the test again. It continued to work (of course many of the VB 5.0 dlls and registry changes were intact even after I performed the uninstall).
So, here is what I am left with.
1. MSChart is easily redistributable when it is placed on a dialog or form.
2. CWnd::CreateControl doesnt work with MSChart unless VB 5.0 has at one point been installed.
3. VB 5.0 install does some registry magic or installs some dependent DLL that I am not aware of.
4. Apparently, there is some difference (as far as ActiveX and COM is concerned) between placing an ActiveX control on a dialog (form) and creating one programmatically.
5. I am going nuts trying to solve this problem.
6. Depending on the responses to this question, I willing to up the ante on this question to a great number of points.
Thank you all in advance for your responses.