PC Review


Reply
Thread Tools Rate Thread

Create .NET Interface definitions for COM

 
 
Bogey
Guest
Posts: n/a
 
      14th Nov 2007
I am trying to implement the interfaces (well, actually create the COM
Interop interface definitions first), but am unsure how to create the
interface.cs files needed.

The interfaces in particular I need right now are IE7 interfaces
IInternetSecurityManagerEx and IInternetSecurityManagerEx2.

I found that IInternetSecurityManagerEx is defined in the IDL file for
UrlMon.IDL - so is there an automated mechanism for creating the many
CS assembly files for a particular interface?

IInternetSecurityManagerEx2 seems to only be defined on MSDN and I
can't find the C# code for the interface definition...

 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      14th Nov 2007
Bogey,

You could use the MIDL compiler and compile the IDL file into a type
library, and then use TLBIMP to import the definition. However, I think
doing it by hand is a better idea. These definitions look pretty simple, so
I would recommend creating them by hand as well.

You might want to check out the section of the MSDN documentation titled
"Exposing COM Components to the .NET Framework ", located at:

http://msdn2.microsoft.com/en-us/library/z6tx9dw3(VS.80).aspx

To help you with creating the definitions of the interfaces in code.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)


"Bogey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am trying to implement the interfaces (well, actually create the COM
> Interop interface definitions first), but am unsure how to create the
> interface.cs files needed.
>
> The interfaces in particular I need right now are IE7 interfaces
> IInternetSecurityManagerEx and IInternetSecurityManagerEx2.
>
> I found that IInternetSecurityManagerEx is defined in the IDL file for
> UrlMon.IDL - so is there an automated mechanism for creating the many
> CS assembly files for a particular interface?
>
> IInternetSecurityManagerEx2 seems to only be defined on MSDN and I
> can't find the C# code for the interface definition...
>


 
Reply With Quote
 
Bogey
Guest
Posts: n/a
 
      14th Nov 2007
Trouble with the interfaces I'm particularly interested in, is that
running MIDL on UrlMon.IDL does not generate a TLB (even using the TLB
option). I was hoping for a less manual approach.

I had already Google'd that reference you mentioned, but thanks
nonetheless.

There's also the problem that I can't even find the documentation (or
the GUID) for IInternetSecurityManagerEx2. In the online docs, it
talks about using SID_IInternetSecurityManagerEx2 in QueryService, but
I can't actually find a definition for that constant.

tonyB.

On Nov 13, 6:40 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.com> wrote:
> You could use the MIDL compiler and compile the IDL file into a type
> library, and then use TLBIMP to import the definition. However, I think
> doing it by hand is a better idea. These definitions look pretty simple, so
> I would recommend creating them by hand as well.


 
Reply With Quote
 
Bogey
Guest
Posts: n/a
 
      14th Nov 2007
Trouble with the interfaces I'm particularly interested in, is that
running MIDL on UrlMon.IDL does not generate a TLB (even using the TLB
option). I was hoping for a less manual approach.

I had already Google'd that reference you mentioned, but thanks
nonetheless.

There's also the problem that I can't even find the documentation (or
the GUID) for IInternetSecurityManagerEx2. In the online docs, it
talks about using SID_IInternetSecurityManagerEx2 in QueryService, but
I can't actually find a definition for that constant.

tonyB.

On Nov 13, 6:40 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.com> wrote:
> You could use the MIDL compiler and compile the IDL file into a type
> library, and then use TLBIMP to import the definition. However, I think
> doing it by hand is a better idea. These definitions look pretty simple, so
> I would recommend creating them by hand as well.


 
Reply With Quote
 
Bogey
Guest
Posts: n/a
 
      14th Nov 2007
Trouble with the interfaces I'm particularly interested in, is that
running MIDL on UrlMon.IDL does not generate a TLB (even using the TLB
option). I was hoping for a less manual approach.

I had already Google'd that reference you mentioned, but thanks
nonetheless.

There's also the problem that I can't even find the documentation (or
the GUID) for IInternetSecurityManagerEx2. In the online docs, it
talks about using SID_IInternetSecurityManagerEx2 in QueryService, but
I can't actually find a definition for that constant.

tonyB.



On Nov 13, 6:40 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.com> wrote:
> You could use the MIDL compiler and compile the IDL file into a type
> library, and then use TLBIMP to import the definition. However, I think
> doing it by hand is a better idea. These definitions look pretty simple, so
> I would recommend creating them by hand as well.


 
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
VPN * Can no longer create or use exsisting VPN definitions =?Utf-8?B?cm9u?= Windows XP Work Remotely 2 3rd Jun 2006 09:54 PM
Building VB.NET Interface definitions from a COM interface Rob Perkins Microsoft VB .NET 3 22nd Mar 2006 09:42 PM
multiple definitions in attributed interface header =?Utf-8?B?UGV0ZXI=?= Microsoft VC .NET 0 25th May 2005 02:51 PM
Create popup word definitions on click =?Utf-8?B?U2NvdHRETA==?= Windows XP General 2 21st Jul 2004 10:43 PM
Best Practice: Interface definitions - where? Ole Olsen Microsoft C# .NET 3 18th Apr 2004 02:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:06 AM.