Solved

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

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now