Solved

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

Posted on 2006-06-21
5
270 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

695 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