Click here to Skip to main content
13,866,342 members
Click here to Skip to main content
Add your own
alternative version


33 bookmarked
Posted 4 Nov 2013
Licenced CPOL

Scientific Data Visualizer

Rate this:
Please Sign up or sign in to vote.
ActiveX component for 3D visualization, embedded in different client applications.


Wnen calculating physical fields, rather often than not, one wants to evaluate the results with a graphic plot in 3D space.


Several years ago I published an article at that solves the problem of visualizing the numerical results as a surface in 3D. Now I found that neither the article nor the reference to the author do not exsist at that site. So, here I would like to present the solution that consists of:

  • ATL project - DLL, exposing ActiveX (COM) component,
  • C# Windows Form application consuming that ActiveX component,
  • MFC client app using the same ActiveX component,
  • HTML page that embeds the same ActiveX component and uses JavaScript to control its parameters.

Using the code

As you know COM-object must register several UUIDs: (CLSID, Interfaces, Typelib). It symply can not live without these nasty 128-bit identifiers. So ATL-project must be opened in a studio running under administrator account. Otherwise the project cannot register COM-entities in Windows registry. The other 2 client projects may be opened in a separate instance of VS (running under usual user account). I found out that it is better to develop COM-server and COM-client apps in such environment. While developing applications that uses COM interoperability, there are several (very nasty) pitfalls you may encounter.

  1. Don't forget to include IPersistStorage and IPersistStreamInit interfaces in ATL control Wizard. Otherwise you won't be able to embed ActiveX control in a Windows Form.
  2. Compile DLL, launch Visual Studio Native Tools Command Prompt with administator rights and use the aximp utility to generate proxies as shown below.
  3. C:\Windows\system32>aximp D:\...your path...\ATLServer\Debug\ATLServer.dll /source /verbose

    The utility must answer this:

    Generated Source: C:\Windows\system32\AxATLServerLib.cs
    Generated Assembly: C:\Windows\system32\ATLServerLib.dll
    Generated Assembly: C:\Windows\system32\AxATLServerLib.dll

    Now cut (Ctrl+X) these 3 files and bring them into your project's folders.

  4. In MFC client project use ClassWizard to create proxy as shown below.

Happy programming!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Alexander Chernosvitov
Instructor / Trainer Peter the Great St.Petersburg Polytechnic Universi
Russian Federation Russian Federation
Peter the Great St. Petersburg Polytechnic University professor,
Microsoft Authorized Educational Center trainer,
Microsoft Certified Professional (C# Desktop Apps and MFC)
Lectures on OOP, C# and C++, Windows programming with C# and C++.
Have long practice and experience in finding the right way to formulate and numerically solve differential equations.

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04 | 2.8.190214.1 | Last Updated 7 Nov 2013
Article Copyright 2013 by Alexander Chernosvitov
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid