[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

Using .NET Framework classes as COM objects

Flo

1/20/2003 12:04:00 PM

Hello,

I want to use .NET Framework classes in COM. Therefore I=20
used the Assembly Registration-Tool (Regasm.exe) to=20
register the classes which are contained in Mscorlib.dll=20
(command Regasm.exe mscorlib.dll) as COM object. After=20
that there are a lot of namespaces in the registry. Now=20
it is possible to reference e.g. system.random as COM=20
object. But there are many namespace which are registered=20
but that can=B4t be referenced as COM object. Why not?=20
There are many namespaces which are contained in=20
Mscorlib.dll which are not registered like e.g.=20
system.console. This is propably because non-public types=20
are not registered. How can these types be registered,=20
respectively how can these non-public types changed to=20
public types?

Thank you

Kind Regards
Flo
2 Answers

NETMaster

1/20/2003 1:58:00 PM

0

PLEASE don't multi-post!
The newsgroup for this COM-Interop question is:
microsoft.public.dotnet.framework.interop


> Regasm.exe ...register the classes ...in Mscorlib.dll

IMHO this is not a good idea.

If at all, use
http://staff.develop.com/jasonw/clr/...


--
Thomas Scheidegger - MVP .NET - 'NETMaster'
http://www.cetus-links.org/oo_d... - http://dnetm...


Cowboy \(Gregory A. Beamer\)

1/21/2003 8:10:00 PM

0

Overall, I would not advise this, as there are equivalent functions in the
API, accesible from VB, that perform the same function. By using .NET
Framework components, you are mucking up the system. It would be better to
create a new .NET object that calls the functions you wish to use and create
a COM Callable Wrapper for it than to make numerous calls across the COM -
.NET barrier.

Microsoft did not expose .NET in this manner for a reason, which was
primarily performance related. In addition, going from unmanaged to managed,
directly to the Framework classes may introduce some system problems (not
sure how likely this is). It is better to play by the rules established for
the game than invent new rules. When you make up new rules, you only have
yourself to blame are less likely to find support.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge

****************************************************************************
****
Think outside the box!
****************************************************************************
****
"Flo" <Florian.Helmecke@web.de> wrote in message
news:024801c2c073$bdd80c60$cef82ecf@TK2MSFTNGXA08...
Hello,

I want to use .NET Framework classes in COM. Therefore I
used the Assembly Registration-Tool (Regasm.exe) to
register the classes which are contained in Mscorlib.dll
(command Regasm.exe mscorlib.dll) as COM object. After
that there are a lot of namespaces in the registry. Now
it is possible to reference e.g. system.random as COM
object. But there are many namespace which are registered
but that can´t be referenced as COM object. Why not?
There are many namespaces which are contained in
Mscorlib.dll which are not registered like e.g.
system.console. This is propably because non-public types
are not registered. How can these types be registered,
respectively how can these non-public types changed to
public types?

Thank you

Kind Regards
Flo