471,582 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,582 software developers and data experts.

mixing managed/unmanaged help

I am getting the error:

error C4368: cannot define 'd3dPP' as a member of managed 'FormEx::Form1':
mixed types are not supported

I am trying to mixed managed and unmanaged code (d3dPP is unmanaged, where
the form is managed). Can I not have an unmanaged instance in a managed
class?
Feb 11 '06 #1
2 4313
Hi quat!
I am trying to mixed managed and unmanaged code (d3dPP is unmanaged, where
the form is managed). Can I not have an unmanaged instance in a managed
class?


If you declare it as "private" it should work...

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Feb 11 '06 #2
quat wrote:
I am getting the error:

error C4368: cannot define 'd3dPP' as a member of managed 'FormEx::Form1':
mixed types are not supported

I am trying to mixed managed and unmanaged code (d3dPP is unmanaged, where
the form is managed). Can I not have an unmanaged instance in a managed
class?


No you can not, at least not yet. Maybe in a future version of C++/CLI.

Right now you can have an unmanaged pointer inside a managed class:

ref class Managed
{
private:
// Native n; // error
Native* n; // OK
};

You have to allocate it with new, and delete it from the destructor and
from the finalizer.

Tom
Feb 16 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by kaalus | last post: by
4 posts views Thread by Daniel Lidström | last post: by
3 posts views Thread by frank | last post: by
3 posts views Thread by frank | last post: by
2 posts views Thread by jraul | last post: by
2 posts views Thread by Jon Slaughter | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.