By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,428 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,428 IT Pros & Developers. It's quick & easy.

Using a C# interface in a idl file.

P: n/a
In C#

I have the following in a file in a DLL on its own. Which is registered
from Com Interop

public interface IOpenCloseSomething

bool Open();

bool Close();


This allows me to create a reference in my C++ DLL and get my class to
implement this interface. This works fine. (using Visual C++ .Net ATL

However what I actually want to do is in my C++ DLL have an interface
defined that uses IOpenCloseSomething as a parameter in function.


interface ITestingInterop : IDispatch{

[id(1), helpstring("method SendSomething")] HRESULT
SendSomething([out,retval] IOpenCloseSomething* OpenCloseSomethingObject);


The midl compiler complains of undefined symbol IOpenCloseSomething

How can I import my C# dll into my idl.

Ideally I'd like to implement a new interface in the C++ idl derived (and
thus extending) the original C# interface.

I've tried using importlib in the library section, but that didn't help me
use my interface. (I repeated this with importing a COM library built in
C++ and had the same problem until I imported the library's idl into my idl
and set up appropriate paths). Though importlib didn't cause an error.

Do I need to convert the C# interface file to an idl file (and then hand
implement a .h file to get the C++ project to compile)?

Any tips?

PS Yes this should have been, and has been posted in the interop group, but
after 24 hours and no further forward I thought I'd open it up to the gurus
in the general newsgroup, (who possibly don't frequent the interop group).
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.