Create .NET Interface definitions for COM

B

Bogey

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...
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
B

Bogey

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.
 
B

Bogey

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.
 
B

Bogey

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top