473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Using a C# interface in a idl file.

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
project).

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

e.g

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?

Rollasoc
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
0 1524

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jessard | last post by:
Help! Hi, I'm having a bit (well a lot - it's getting annoying) of trouble using a C# class library within a VBScript on a computer other than the development machine. All the class is needed...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
2
by: Robin Tucker | last post by:
I'm having problems with the IPersistFile interface. We have in house objects that support IPersistFile (and have done for years). I would like to load an object using this interface with VB.NET...
4
by: joe bloggs | last post by:
I am writing a mobile application to interface with a legacy system and I am planning to use web services to communicate with this system. The legacy system receives data through a serial port. ...
0
by: rollasoc | last post by:
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();
2
by: garyusenet | last post by:
I could do with something similiar, can you tell me if you think this would work for me, and if there's any advantage in working with controls this way than how I currently am. At the moment...
0
by: =?Utf-8?B?UmFodnlu?= | last post by:
Hi All; I am writing a COM interface that will need to be called from VBScript (Legacy App). I need to return a recordset to the calling app. I am using ADODB to populate the recordset and...
6
by: greek_bill | last post by:
Hi, I'm interested in developing an application that needs to run on more than one operating system. Naturally, a lot of the code will be shared between the various OSs, with OS specific...
0
by: Avi | last post by:
Hello, I am trying to generate a TOC using FOP. I have a XML file as follows: <?xml version="1.0" encoding="iso-8859-1"?> <FILE> <INTERFACE> <NAMEA_B </NAME> <MESSAGEMSG_1 </MESSAGE>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.