0
0to60
I'm trying to create a .dll with VS.NET 2003 Architect that contains a math
computational component. I need the guts of the thing to be in native code,
as performance is key for that part. But, I need a .net wrapper because
this "calculator" is actually a component used by an enterprise app written
entirely in .net.
What I want to do is have one project. I've created an MC++ .dll project.
Its got a __gc class (the wrapper) and a handful of __nogc classes. I'm
having a number of problems with this. First off, as soon as I put a set a
pointer to the __nogc class from within my managed wrapper class'
constructor, the linker complains of unresolved external symbols for __cdecl
operator new and delete.
Here is the source code so far, its as basic as you can get:
// Calculator.h
#pragma once
using namespace System;
class InnerClass;
namespace Calculator
{
public __gc class Class1
{
public:
Class1();
private:
InnerClass* inner;
};
}
__nogc class InnerClass
{
public:
InnerClass();
~InnerClass();
};
// Calculator.cpp
#include "stdafx.h"
#include "Calculator.h"
Calculator::Class1::Class1()
{
inner = new InnerClass();
}
InnerClass::InnerClass()
{}
InnerClass::~InnerClass()
{}
Again, this project was created with File->New->Project, choosing VC++ class
library (.net). As for project properties, I haven't changed them from what
VS gave me.
computational component. I need the guts of the thing to be in native code,
as performance is key for that part. But, I need a .net wrapper because
this "calculator" is actually a component used by an enterprise app written
entirely in .net.
What I want to do is have one project. I've created an MC++ .dll project.
Its got a __gc class (the wrapper) and a handful of __nogc classes. I'm
having a number of problems with this. First off, as soon as I put a set a
pointer to the __nogc class from within my managed wrapper class'
constructor, the linker complains of unresolved external symbols for __cdecl
operator new and delete.
Here is the source code so far, its as basic as you can get:
// Calculator.h
#pragma once
using namespace System;
class InnerClass;
namespace Calculator
{
public __gc class Class1
{
public:
Class1();
private:
InnerClass* inner;
};
}
__nogc class InnerClass
{
public:
InnerClass();
~InnerClass();
};
// Calculator.cpp
#include "stdafx.h"
#include "Calculator.h"
Calculator::Class1::Class1()
{
inner = new InnerClass();
}
InnerClass::InnerClass()
{}
InnerClass::~InnerClass()
{}
Again, this project was created with File->New->Project, choosing VC++ class
library (.net). As for project properties, I haven't changed them from what
VS gave me.