|
Inquiry about using ChartDirector for .NET as a COM component |
Posted by Antonio Cerrato on Mar-04-2025 16:59 |
|
Good morning,
We are a software development company currently using ChartDirector to display charts in various options of our application. In the past, we acquired the version of ChartDirector for ASP/COM/VB, and now we are interested in migrating to the current version for .NET, but using it as a COM component.
To do this, we have downloaded the latest version of ChartDirector (using the "Download ChartDirector" option) and registered the netchardir.dll library using the REGASM tool (Registration of .NET Assemblies). However, when trying to access the methods of the classes included in the DLL using the CreateObject(NameSpace.ClassName) command from our development environment (which uses the Alaska Xbase++ language), we do not get a valid object.
Therefore, we would like to ask the following:
• Does the version of ChartDirector for .NET allow its use as a COM component?
• If so, what is the class name or ProgID that we should use to create the object using CreateObject()?
• Are there any additional configurations or specific steps we need to follow to ensure the library is registered and accessible correctly?
We would appreciate any information, documentation, or code examples you can provide to facilitate the integration of ChartDirector into our project. If necessary, we can provide more details about our development environment or the specific requirements of the project.
We look forward to your response.
Best regards. |
Re: Inquiry about using ChartDirector for .NET as a COM component |
Posted by Peter Kwan on Mar-05-2025 02:08 |
|
Hi Antonio,
I am Peter Kwan from Advanced Software Engineering. I received your email about using ".NET as COM component" twice, and I replied both emails within 1 day. It seems you did not receive my reply email. May be you can check your spam filter to see if you can find my reply email. The email address I used is pkwan@advsofteng.net
The short answer is that the ChartDirector for .NET assembly "netchartdir.dll" cannot be used directly by COM, because COM does not support the following features, which are used in ChartDirector for .NET API:
- COM does not support constructors
- COM does not function overloading (multiple functions with the same name and differ by its argument types).
- Some COM implementations (such as VBScript) does not support strongly typed arrays. .NET must use typed arrays. (VB6 and VBA do support strong typed arrays.)
To make ChartDirector for .NET usable in COM, it is necessary to write wrappers to work around all the limitations. For example, all constructors have to be wrapper with factory methods. Overloaded functions have to be wrapped with renamed functions so they use different names. If it is necessary to support untyped arrays (Variant arrays), the wrapper function needs to convert the Variant array to the strongly typed array expected by the .NET API.
Would you consider to continue using ChartDirector for ASP/COM/VB? The “ChartDirector for ASP/COM/VB” is essentially a wrapper for ChartDirector for C++.
Best Regards
Peter Kwan |
|