Solved

How to interop private members of COM Dll into .net dll?

Posted on 2006-06-21
5
267 Views
Last Modified: 2006-11-18
Hello,

I am converting COM Dll to .net Dll using tlbimp... It only creates the wrapper for public members of the COM dll not for private members..
Can anyone tell me the way to get the private members too in the .net wrapper?

Thanks
0
Comment
Question by:garima_sikarwar
  • 2
5 Comments
 
LVL 25

Expert Comment

by:dstanley9
ID: 16951185
By design, it will not create a wrapper for private members since those aren't accessible outside the COM DLL anyway.  TLBIMP does not _convert_ the COM DLL, in only creates a WRAPPER, i.e. an interface to access the COM DLL.  The original COM DLL is still the one doing the work.
0
 
LVL 4

Author Comment

by:garima_sikarwar
ID: 16982859
yaa , thats true.. but is there any way to get the information abt private members of COM DLL...

one more thing, can we create .net wrapper dynamically ..I mean through the code ...
0
 
LVL 25

Accepted Solution

by:
dstanley9 earned 250 total points
ID: 16984418
No, there is no way to get the private members.  That's why they're called private...  They wouldn't be accessible even if it was translated to .NET directly.  (Except through a reflection hack)

Do you have the source code?  How do you know what private members are there?

And yes, you can interop with most COM classes dynamically using late-binding:

http://www.c-sharpcorner.com/1/call_com.asp
http://www.codeguru.com/csharp/csharp/cs_syntax/reflection/article.php/c5881/
http://www.google.com/search?q=C%23+COM+late+binding

However, you're most likely going to need intimate knowledge of the COM classes before using them, so I don't know that it buys you a whole lot.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question