PC Review


Reply
Thread Tools Rate Thread

com pntr to interop ___gc: how ?????

 
 
Jim G
Guest
Posts: n/a
 
      7th Dec 2003
How do you set an interop managed class instance to an
actual com created instance.

why doesn't this work????

CComPtr<IHTMLDocument2> spDoc;

mshtml::IHTMLDocument2* doc=(mshtml::IHTMLDocument2*)
spDoc.p;

Thank you for your help
 
Reply With Quote
 
 
 
 
Stu Smith
Guest
Posts: n/a
 
      9th Dec 2003
Off the top of my head, can you use

System::Object *pObject =
System::Runtime::InteropServices::Marshal::GetObjectForIUnknown(spDoc.GetInt
erfacePtr())

and then cast that to your managed interface pointer?

I haven't tested it but it might get you started.


"Jim G" <(E-Mail Removed)> wrote in message
news:1c1c01c3bcab$9297fe90$(E-Mail Removed)...
> How do you set an interop managed class instance to an
> actual com created instance.
>
> why doesn't this work????
>
> CComPtr<IHTMLDocument2> spDoc;
>
> mshtml::IHTMLDocument2* doc=(mshtml::IHTMLDocument2*)
> spDoc.p;
>
> Thank you for your help



 
Reply With Quote
 
 
 
 
JIM g
Guest
Posts: n/a
 
      10th Dec 2003


Stu,

Thank you, you gave me just what i needed.

Good Luck to you and yours!!!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interop.CDO uses Interop.ADODB which has a higher version... muriwai Microsoft C# .NET 7 27th Oct 2011 08:00 PM
interop mapi32.dll Miguel Jimenez Microsoft Outlook Discussion 0 13th Sep 2004 06:34 PM
Interop without interop Tamir Khason Microsoft C# .NET 11 1st Dec 2003 07:01 PM
FS/WinXP interop issues Gunter Ohrner Windows XP Networking 0 24th Nov 2003 10:13 PM
Is there a published COM Interop Wrapper for Interop.MSDASC.dll? Burton G. Wilkins Microsoft ADO .NET 0 10th Nov 2003 02:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:07 AM.