A
ajtaylor
Hello,
Sorry another question on mixed code assemblys.
I have a static class library containing a lot of unmanged code.
I have created a mixed code assembly which I am attempting to use in a
forms project.
Thus,
Class Library:
"Types.h"
class someType
{
public:
someType(double val);
//load of unmanaged stuff
};
//////////////////////////////////////////////////
CLR Library:
#include "Types.h"
using namespace System;
namespace CLRLibrary {
public ref class MyAssembly
{
public:
MyAssembly(const someType& val);
private:
someType m_value;
};
}
//////////////////////////////////////////////////
Forms project:
#include "Types.h"
double val = System::Convert::ToDouble(textBox1->Text);
CLRLibrary ::MyAssembly^ ass = gcnew CLRLibrary
::MyAssembly(someType(val));
//////////////////////////////////////////////////
Now, I cant see any reason why this wouldnt work - indeed this seems
like a perfectly reasonable thing to want to do.
Problem is when I build the solution I get:-
Form1.h(100) : error C3767: 'CLRLibrary::MyAssembly::MyAssembly':
candidate function(s) not accessible
Can anyone point me in the correct direction please? I have to admit to
getting a bit frustrated with C++/CLI
Sorry another question on mixed code assemblys.
I have a static class library containing a lot of unmanged code.
I have created a mixed code assembly which I am attempting to use in a
forms project.
Thus,
Class Library:
"Types.h"
class someType
{
public:
someType(double val);
//load of unmanaged stuff
};
//////////////////////////////////////////////////
CLR Library:
#include "Types.h"
using namespace System;
namespace CLRLibrary {
public ref class MyAssembly
{
public:
MyAssembly(const someType& val);
private:
someType m_value;
};
}
//////////////////////////////////////////////////
Forms project:
#include "Types.h"
double val = System::Convert::ToDouble(textBox1->Text);
CLRLibrary ::MyAssembly^ ass = gcnew CLRLibrary
::MyAssembly(someType(val));
//////////////////////////////////////////////////
Now, I cant see any reason why this wouldnt work - indeed this seems
like a perfectly reasonable thing to want to do.
Problem is when I build the solution I get:-
Form1.h(100) : error C3767: 'CLRLibrary::MyAssembly::MyAssembly':
candidate function(s) not accessible
Can anyone point me in the correct direction please? I have to admit to
getting a bit frustrated with C++/CLI