atkin
October 25th, 2004, 08:45 AM
I know this has been covered before, but what if you dont have the code for the unmanaged dll, but you know the names of all the methods as follows.
I created a c++ object and exported the funtion I wanted to use with dllexport. Then created a managed wrapper that linked with my unmanaged
code. I used c# Windows application that made use of the managed wrapper.
All this works fine. Yipee
Now i am trying to export the entire c++ object. SO i have
//------------------------------------------------------
class __declspec(dllexport) Sum
{
public:
Sum();
~Sum();
public:
double Add( double num1, double num2 );
};
//------------------------------------------------------
Is it possible to export the entire class.
Now the MC++ was
//------------------------------------------------------
extern "C"
{
double Add( double num1, double num2 );
}
//--namespace stuff and other declaration
__gc class Class1
public: double DoAdd( double n1, double n2 )
{
return Add( n1, n2 );
}
//------------------------------------------------------
My question is what do I replace the extern "C" part with now and assuming that I dont have the source code for the c++ code, just the dll and lib files.
Thanks, thanks !!!!!!
I created a c++ object and exported the funtion I wanted to use with dllexport. Then created a managed wrapper that linked with my unmanaged
code. I used c# Windows application that made use of the managed wrapper.
All this works fine. Yipee
Now i am trying to export the entire c++ object. SO i have
//------------------------------------------------------
class __declspec(dllexport) Sum
{
public:
Sum();
~Sum();
public:
double Add( double num1, double num2 );
};
//------------------------------------------------------
Is it possible to export the entire class.
Now the MC++ was
//------------------------------------------------------
extern "C"
{
double Add( double num1, double num2 );
}
//--namespace stuff and other declaration
__gc class Class1
public: double DoAdd( double n1, double n2 )
{
return Add( n1, n2 );
}
//------------------------------------------------------
My question is what do I replace the extern "C" part with now and assuming that I dont have the source code for the c++ code, just the dll and lib files.
Thanks, thanks !!!!!!