Solved

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

Posted on 2006-06-21
5
268 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

829 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