Vintersorg
December 16th, 2005, 02:50 AM
Hi.
I'm not very experienced with managed c++, but i'm trying to create a .NET library for later use in Visual Basic.
I have 2 problems:
1. I would like to use a class as return type, the dll will compile, but the function will not be accessible/visible in visual basicm if i change returntype to datetime or other standard .NET class it will work fine, but not with a class defined in my own namespace.
Namespace gfxEngine
public ref class SE_Camera
{
public:
void rotate(int x,int y, int z)
{
}
};
public ref class GfxEngine
{
public:
gfxEngine::SE_Camera createCamera()
{
SE_Camera Cam;
return Cam;
}
};
The method createCamera will not be visible.. If i use dateTime as type it will work fine. I know the code actually does nothing.. but to keep it simple..
2. The other problem appears if i want to expose the SE_Camera class in the GfxEngine class.. In a standard class i would do it this way:
class GfxEngine
{
public:
SE_Camera Cam;
}
It will compile if i do it the same way, but not be visible as a member in Visual Basic.
I've been searching the web for tutorials/code using managed class libraries, but can't really find what i'm looking for.
I'm using Visual C++ 2005.
I'm not very experienced with managed c++, but i'm trying to create a .NET library for later use in Visual Basic.
I have 2 problems:
1. I would like to use a class as return type, the dll will compile, but the function will not be accessible/visible in visual basicm if i change returntype to datetime or other standard .NET class it will work fine, but not with a class defined in my own namespace.
Namespace gfxEngine
public ref class SE_Camera
{
public:
void rotate(int x,int y, int z)
{
}
};
public ref class GfxEngine
{
public:
gfxEngine::SE_Camera createCamera()
{
SE_Camera Cam;
return Cam;
}
};
The method createCamera will not be visible.. If i use dateTime as type it will work fine. I know the code actually does nothing.. but to keep it simple..
2. The other problem appears if i want to expose the SE_Camera class in the GfxEngine class.. In a standard class i would do it this way:
class GfxEngine
{
public:
SE_Camera Cam;
}
It will compile if i do it the same way, but not be visible as a member in Visual Basic.
I've been searching the web for tutorials/code using managed class libraries, but can't really find what i'm looking for.
I'm using Visual C++ 2005.