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

Newb w/ simple wrapping ?

Just trying to work through some examples I have seen on the web.... I'm
getting an unresolved external linker error for operator new and delete.

Here is the code, VERY simple.
#pragma once
using namespace System;
namespace AB_Wrapper
{
// unmanaged class
class CMyOldClass
{
public:
CMyOldClass(int i)
{
m_i = i;
}

int GetValue(){ return m_i; };

private:
int m_i;
};
// managed class
public __gc class Class1
{
public:
Class1()
{
m_pOldClass = new CMyOldClass(666);
}
int GetValue()
{
return m_pOldClass->GetValue();
}

private:
CMyOldClass* m_pOldClass;
};
}
anyone have any ideas?
Nov 17 '05 #1
2 953
Try linking with mfcs71.lib and mrcext.lib. One small request, it would be
always easier if you can post the error message too.

Thanks
Saran

"SteveK" wrote:
Just trying to work through some examples I have seen on the web.... I'm
getting an unresolved external linker error for operator new and delete.

Here is the code, VERY simple.
#pragma once
using namespace System;
namespace AB_Wrapper
{
// unmanaged class
class CMyOldClass
{
public:
CMyOldClass(int i)
{
m_i = i;
}

int GetValue(){ return m_i; };

private:
int m_i;
};
// managed class
public __gc class Class1
{
public:
Class1()
{
m_pOldClass = new CMyOldClass(666);
}
int GetValue()
{
return m_pOldClass->GetValue();
}

private:
CMyOldClass* m_pOldClass;
};
}
anyone have any ideas?

Nov 17 '05 #2
Thanks for the quick response, Saran!

adding "msvcrt.lib" to the input solved it. Makes sense...

Thanks again!

"Saran" <Sa***@discussions.microsoft.com> wrote in message
news:A9**********************************@microsof t.com...
Try linking with mfcs71.lib and mrcext.lib. One small request, it would be
always easier if you can post the error message too.

Thanks
Saran

"SteveK" wrote:
Just trying to work through some examples I have seen on the web.... I'm
getting an unresolved external linker error for operator new and delete.

Here is the code, VERY simple.
#pragma once
using namespace System;
namespace AB_Wrapper
{
// unmanaged class
class CMyOldClass
{
public:
CMyOldClass(int i)
{
m_i = i;
}

int GetValue(){ return m_i; };

private:
int m_i;
};
// managed class
public __gc class Class1
{
public:
Class1()
{
m_pOldClass = new CMyOldClass(666);
}
int GetValue()
{
return m_pOldClass->GetValue();
}

private:
CMyOldClass* m_pOldClass;
};
}
anyone have any ideas?

Nov 17 '05 #3

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

Similar topics

3
by: Amy G | last post by:
I have a whole bunch of tuples that look something like this, aTuple = ('1074545869.6580.msg', 't_bryan_pw@gmcc.ab.ca', 'Your one stop prescriptions') now that I have this I try for x, y, z...
13
by: Roy Smith | last post by:
I've got a C library with about 50 calls in it that I want to wrap in Python. I know I could use some tool like SWIG, but that will give me a too-literal translation; I want to make some...
2
by: David K. Worman | last post by:
So this is probably a simple thing I'm missing, but then I just started working with perl tonight - and of course I bought the Camel book, and conveniently left it at work on my desk where it does...
4
by: Donald Newcomb | last post by:
I'm a real Python NEWB and am intrigued by some of Python's features, so I'm starting to write code to do some things to see how it works. So far I really like the lists and dictionaries since I...
3
by: Marc Llenas | last post by:
Hi there, I'm stuck on a validation function for a form and I cannot figure out what the problem is. The page is in ASP. Any ideas? The function being called is: <script...
10
by: Douglas G | last post by:
I've tried various ideas on this problem, but I don't see word wrapping. Can you point out what is wrong? It's a K&R exercise, and I'm still new to programming. Other pointers would be helpful...
4
by: Steven Blair | last post by:
I have the following number: 64521234567890 and need to apply some sort of simple encryption. Does c# have any classes for doing this. I cant use 3DES or anything as complex as. The size...
1
by: HateSpam | last post by:
Total newb here. I've built a custom library called ClassLib1. I want to use the 3 classes I've got defined in there in a simple 1-form windows app. I added the reference to the .dll to the...
12
by: joaotsetsemoita | last post by:
Hello everyone, im completly new to vb.net and I was assigned to do a simple piece of software that just had to select from um db in a MS access data base and insert into a SQL server Database....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.