473,396 Members | 2,076 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,396 software developers and data experts.

Mixed mode issues with COM

Hi,

I want to create a mixed mode C++ dll that calls a COM object and returns a
managed string. I use the following steps but still get errors:
Create new C++ .Net Class library project
Add the #import directive to my managed objects header file: #import
"C:\Documents and Settings\alowe\My Documents\ePathwayRequestBrokerDev.dll"
rename_namespace("ePathwayCOM")
Add a new method:

System::String* Execute(String* serviceName, String* xml) {
BSTR service = (BSTR)(void*)Marshal::StringToBSTR(serviceName);
BSTR message = (BSTR)(void*)Marshal::StringToBSTR(xml);
ePathwayCOM::_esyv0004Ptr broker;
broker->exec(service, message);
Marshal::FreeBSTR((void*)service);
Marshal::FreeBSTR((void*)message);
return "test";
}

Follow the instructions in
http://support.microsoft.com/default...b;en-us;814472 to make the
necessary project property changes
Add the ManagedWrapper class as stated in the instructions in the link above
I then created a C# project to call the manged method however the
ManagedWrapper class is not available to be called (has disappeared
according to the C# project)
Calling System::String* Execute(String* serviceName, String* xml); fails
with a huge COM error

Can anyone point out any mistakes i'm making please. I'm extremely desperate
to get his working
Thanks a billion in advance

andrew
Nov 17 '05 #1
0 748

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

Similar topics

9
by: Edward Diener | last post by:
I received no answers about this the first time I posted, so I will try again. My inability to decipher an MSDN topic may find others who have the same inability and someone who can decipher and...
8
by: Bern McCarty | last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains other than the default AppDomain? Is there any means at all of doing this? Mixed-mode is incredibly convenient, but if I...
8
by: Nadav | last post by:
Hi, I am writing a performence critical application, this require me to stick to unmanaged C++ as performance is much better using unmanaged C++ ( about 33% better ), Still, I am trying to avoid...
7
by: Staale L. Hansen | last post by:
We have an application which uses some mixed-mode code to expose a .NET 1.1 managed API. Only the necessary files are compiled with /clr. We want to be able to load the application without .NET...
1
by: Tal | last post by:
Do you know if I can use a mixed mode C++ dll from an unmanaged C++ dll? I need it because I want to use C# class located in dll from unmanaged C++ code located in dll. I thought maybe I can...
4
by: bonk | last post by:
This article http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmex/html/vcconconvertingmanagedextensionsforcprojectsfrompureintermediatelanguagetomixedmode.asp seems to be...
2
by: Ubergeek | last post by:
I recently came accross an article that stated that there were unresolved issued with calling native (i.e. "unmanaged" C++) from managed C++. Does anyone know what the precise details of this...
8
by: Edward Diener | last post by:
By reuse, I mean a function in an assembly which is called in another assembly. By a mixed-mode function I mean a function whose signature has one or more CLR types and one or more non-CLR...
0
by: emu | last post by:
Hi All, I have an unmanaged C++ application that references a mixed mode image DLL (mixed managed and unmanaged). Under .NET 1.1 we could trust the dll (the mixed mode dll) by running the...
1
by: Bern McCarty | last post by:
I know how with VC8 you embed your linker generated manifest into an exe with a resource ID of #1 and into a dll with resource ID #2. But what do you do with the linker generated manifest for a...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.