implement unmanaged interface

G

Guest

Hi,

Can somebody suggest me, how can I implement a vc++ interface in C#.net.
This interface has method CallMe( ) which is used as a CallBack from my main
application.

Thanks,
Baji.
 
N

Nicholas Paldino [.NET/C# MVP]

Baji,

You can't. It has to be a COM interface, or a managed interface written
in C++/CLI. Otherwise, you have to implement it in C++ and then call into
managed code.
 
G

Guest

Yes,

It is a COM interface. & has a method CallMe( ). I need to implement this
interface in C# application. And, this method will be called by unmanaged
application.

can you suggest me something here?

Nicholas Paldino said:
Baji,

You can't. It has to be a COM interface, or a managed interface written
in C++/CLI. Otherwise, you have to implement it in C++ and then call into
managed code.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Baji. said:
Hi,

Can somebody suggest me, how can I implement a vc++ interface in C#.net.
This interface has method CallMe( ) which is used as a CallBack from my
main
application.

Thanks,
Baji.
 
N

Nicholas Paldino [.NET/C# MVP]

Baji,

If it is a COM interface, you should be able to add a reference (on the
COM tab) to that dll (or the type library that stores the interfaces) and
VS.NET will generate managed representations of the interface for you.

Or, if you want to do this by hand, you can use the TLBIMP utility that
comes with the framework.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Baji. said:
Yes,

It is a COM interface. & has a method CallMe( ). I need to implement this
interface in C# application. And, this method will be called by unmanaged
application.

can you suggest me something here?

Nicholas Paldino said:
Baji,

You can't. It has to be a COM interface, or a managed interface
written
in C++/CLI. Otherwise, you have to implement it in C++ and then call
into
managed code.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Baji. said:
Hi,

Can somebody suggest me, how can I implement a vc++ interface in
C#.net.
This interface has method CallMe( ) which is used as a CallBack from my
main
application.

Thanks,
Baji.
 
G

Guest

Nicolas,

I am able to add the dll as a reference & also I have derived my class from
the interface. & the DEV env has also added the interface structure etc., to
my code. Now the interface method :CallMe() need to be called by my unmanaged
application. So, how can I achieve this ?

I am usinng VS 2008. After compilation am putting the dll into GAC & also
registering the tlb

I never get a break on the interface method. I think I am not doing in the
right way, can you suggest me ?

Thanks,
Baji.


Nicholas Paldino said:
Baji,

If it is a COM interface, you should be able to add a reference (on the
COM tab) to that dll (or the type library that stores the interfaces) and
VS.NET will generate managed representations of the interface for you.

Or, if you want to do this by hand, you can use the TLBIMP utility that
comes with the framework.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Baji. said:
Yes,

It is a COM interface. & has a method CallMe( ). I need to implement this
interface in C# application. And, this method will be called by unmanaged
application.

can you suggest me something here?

Nicholas Paldino said:
Baji,

You can't. It has to be a COM interface, or a managed interface
written
in C++/CLI. Otherwise, you have to implement it in C++ and then call
into
managed code.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi,

Can somebody suggest me, how can I implement a vc++ interface in
C#.net.
This interface has method CallMe( ) which is used as a CallBack from my
main
application.

Thanks,
Baji.
 
N

Nicholas Paldino [.NET/C# MVP]

Baji,

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

http://msdn2.microsoft.com/en-us/library/zsfww439.aspx


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Baji. said:
Nicolas,

I am able to add the dll as a reference & also I have derived my class
from
the interface. & the DEV env has also added the interface structure etc.,
to
my code. Now the interface method :CallMe() need to be called by my
unmanaged
application. So, how can I achieve this ?

I am usinng VS 2008. After compilation am putting the dll into GAC & also
registering the tlb

I never get a break on the interface method. I think I am not doing in
the
right way, can you suggest me ?

Thanks,
Baji.


Nicholas Paldino said:
Baji,

If it is a COM interface, you should be able to add a reference (on
the
COM tab) to that dll (or the type library that stores the interfaces) and
VS.NET will generate managed representations of the interface for you.

Or, if you want to do this by hand, you can use the TLBIMP utility
that
comes with the framework.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Baji. said:
Yes,

It is a COM interface. & has a method CallMe( ). I need to implement
this
interface in C# application. And, this method will be called by
unmanaged
application.

can you suggest me something here?

:

Baji,

You can't. It has to be a COM interface, or a managed interface
written
in C++/CLI. Otherwise, you have to implement it in C++ and then call
into
managed code.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi,

Can somebody suggest me, how can I implement a vc++ interface in
C#.net.
This interface has method CallMe( ) which is used as a CallBack from
my
main
application.

Thanks,
Baji.
 

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