473,386 Members | 1,798 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,386 software developers and data experts.

C++ Managed and Unmanaged and the New Command

I'm having horrible, headache inducing problems trying to make a wrapper, or
just a c++ class to interact with a managed class.

I mimiked a managed wrapper to an unmanaged class as showin here:
http://msdn.microsoft.com/library/de...g_overview.asp

but the compiler gives me a linker error, it will not, under any
circumstance, let me run new on any class that isnt purly .net to begin
with.

Quite painful.

Can anybody give me any clues? im sure its a silly error =)
__gc class MCMythBase

{

public:

MCMythBase() { mMythBase = new CMythBase(); }

~MCMythBase() { delete mMythBase; }

void mPlayShow(long ShowID) { };

private:

CMythBase * mMythBase;

};

fails on creation of CMythBase
MythBase error LNK2001: unresolved external symbol "void * __cdecl operator
new(unsigned int)" (??2@$$FYAPAXI@Z)
also in the C++ managed class i built, it fails on this line in the same way
as above:
mythBase = new MCMythBase();
Nov 17 '05 #1
3 2665
Ofer Achler wrote:
I'm having horrible, headache inducing problems trying to make a
wrapper, or just a c++ class to interact with a managed class.

I mimiked a managed wrapper to an unmanaged class as showin here:
http://msdn.microsoft.com/library/de...g_overview.asp
but the compiler gives me a linker error, it will not, under any
circumstance, let me run new on any class that isnt purly .net to
begin with.


Look at the subject, under Managed C++ Extensions in MSDN, of changing a
pure mode DLL to a mixed mode DLL. By default the VS .NET wizards create a
pure mode DLL.
Nov 17 '05 #2
Edward Diener wrote:
woo hoo! it worked! thank you! =)

Ofer Achler wrote:
I'm having horrible, headache inducing problems trying to make a
wrapper, or just a c++ class to interact with a managed class.

I mimiked a managed wrapper to an unmanaged class as showin here:


http://msdn.microsoft.com/library/de...g_overview.asp
but the compiler gives me a linker error, it will not, under any
circumstance, let me run new on any class that isnt purly .net to
begin with.

Look at the subject, under Managed C++ Extensions in MSDN, of changing a
pure mode DLL to a mixed mode DLL. By default the VS .NET wizards create a
pure mode DLL.

Nov 17 '05 #3
Ofer Achler wrote:
Edward Diener wrote:
woo hoo! it worked! thank you! =)
You are very welcome.

Ofer Achler wrote:
I'm having horrible, headache inducing problems trying to make a
wrapper, or just a c++ class to interact with a managed class.

I mimiked a managed wrapper to an unmanaged class as showin here:


http://msdn.microsoft.com/library/de...g_overview.asp
but the compiler gives me a linker error, it will not, under any
circumstance, let me run new on any class that isnt purly .net to
begin with.

Look at the subject, under Managed C++ Extensions in MSDN, of
changing a pure mode DLL to a mixed mode DLL. By default the VS .NET
wizards create a pure mode DLL.

Nov 17 '05 #4

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

Similar topics

0
by: kaalus | last post by:
Hello I have problem mixing managed and unmanaged C++ code in VS.NET 2003. I want to create a windows forms application which uses some C++ code that is incompatible with managed extensions...
1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
3
by: Francis Urquhart | last post by:
I am trying to find the simplest possible way of writing a GUI to run on top of a standard C++ library written in VC++. I would like to avoid MFCs, COM, and if possible .Net wrappers. The goal...
0
by: MPadovani | last post by:
It's tricky setting up a .NET project that wraps around unmanaged C++ code, but if you set your project settings, it will work. I spent many days working out the right settings. My VS-2003 project...
1
by: MC-Advantica | last post by:
Does anyone have a simple "Hello World" like application that demonstrates unmanaged C++ calling managed C++ developed in VS2005? I'm confused by many posts as they discuss managed extensions from...
9
by: Amit Dedhia | last post by:
Hi All I have a VC++ 2005 MFC application with all classes defined as unmanaged classes. I want to write my application data in xml format. Since ADO.NET has buit in functions available for...
16
by: DaTurk | last post by:
Hi, I have a c# application that needs to access c++ libraries, so it does this by using a managed layer of c++ CLI. Anyway, in the CLI function call, that calls the unmanaged function it...
25
by: Koliber (js) | last post by:
sorry for my not perfect english i am really f&*ckin angry in this common pattern about dispose: ////////////////////////////////////////////////////////// Public class...
3
by: Klaus | last post by:
Hi, I have an existing VC 6 MFC application which communicates asynchronly with a VC 2005 managed code dll. I use an unmanaged base class with virtual functions to access methods in the MFC...
20
by: =?Utf-8?B?VGhlTWFkSGF0dGVy?= | last post by:
Sorry to bring up a topic that is just flogging a dead horse.... but... On the topic of memory management.... I am doing some file parcing that has to be done as quick as posible, but what I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.