Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
The Access Show: Access 2010 demo of Access Services and web databases
Oct 19, 2009 at 5:10 PMI love that hat.
VC++ 2005: IDE Tips and Tricks
Jul 10, 2006 at 1:28 PMVC++ 2005: IDE Tips and Tricks
Jul 10, 2006 at 1:27 PMTrackerball, I was definitely not trying to skirt the issue, it's more that I was not always expecting those questions
The short answer to your question is this:
- a managed class (ref class A {}) can only hold pointers to native types
- a native class (class B {}) can not hold a managed handle directly, instead you should use gcroot<T> as follows:
#include <vcclr.h>
using namespace System;
class B {
public:
gcroot<String^> str; // can use str as if it were String^
B() {}
};
int main() {
B b;
b.str = gcnew String("hello");
Console::WriteLine( b.str ); // no cast required
}
I hope that answers the question. If you want to learn more, I gave a talk about interop at Tech-Ed and I have some posts about it over at http://blogs.msdn.com/borisj.
-- Boris