Kbase P140401: How to use .NET controls registered using the Microsoft Assembly Registration Tool (Regasm.exe)?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  1/27/2009 |
|
Status: Unverified
GOAL:
How to use .NET controls registered using the Microsoft Assembly Registration Tool (Regasm.exe)?
GOAL:
How to use .NET controls registered using Regasm.exe ?
GOAL:
Should a .NET control registered using Regasm.exe be accessed like a .NET class or as a COM control?
FACT(s) (Environment):
Progress 9.1x
OpenEdge 10.x
Windows
FIX:
.NET controls registered using the Microsoft Assembly Registration Tool (Regasm.exe) should be treated as COM Controls / ActiveX Automation Servers and not .NET classes.
As Microsoft's Regasm documentation states:
"The Assembly Registration tool reads the metadata within an assembly and adds the necessary entries to the registry, which allows COM clients to create .NET Framework classes transparently. Once a class is registered, any COM client can use it as though the class were a COM class."
Syntax similar to the following can be used to instantiate and use the COM object:
DEFINE VARIABLE hExcelObject AS COM-HANDLE NO-UNDO.
CREATE "Excel.Application" hExcelObject.
...
<code>
...
RELEASE OBJECT hExcelObject.
hExcelObject = ?.