PDA

View Full Version : How do I include OpenGL in MC++ program



03-27-2002, 04:58 AM
How do I include OpenGL in a C++ program which uses purely Managed
Extensions.? (the 3d frame is mixed in with other screen objects using
windows forms).

I have tried doing this by taking the ATL ActiveX Cube sample that comes
with VC++. I ran the aximp tool to generate a wrapper class that lets me use
it as a control in the application.

My program compiles and links correctly, but when I run it (in debug mode) I
get the following error:

An unhandled exception of type 'System.Threading.ThreadStateException'
occurred

in system.windows.forms.dll

Additional information: Could not instantiate ActiveX control

'72d0889c-0ebd-11d0-bf0d-0000e8d0d146' because the current thread

is not in a single-threaded apartment.

Can anyone suggest how I can get round this problem? Or alternatively is
there any other way to include an OpenGL view in a MC++ form?

I would appreciate any ideas,

Martin

kabir
03-27-2002, 10:58 AM
You might find the answers you're looking for here:
http://www.mfcogl.com/

It has a number of tutorials on integrating OpenGL with various Windowsy stuff (MFC).