Compiler error creating managed c++ directx app
From: Mark Snyder (snyderm_at_otc.edu)
Date: 04/22/04
- Next message: Rich [Microsoft Direct3D MVP]: "Re: Compiler error creating managed c++ directx app"
- Previous message: Moon Majumdar: "Re: Help with Mesh.Intersect. Getting strange bug."
- Next in thread: Rich [Microsoft Direct3D MVP]: "Re: Compiler error creating managed c++ directx app"
- Reply: Rich [Microsoft Direct3D MVP]: "Re: Compiler error creating managed c++ directx app"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 22 Apr 2004 12:24:39 -0500
Hello,
I'm trying to create a simple program using managed C++ and DirectX. I
can't even get started because I can't get my program to compile, when all
I'm doing is trying to create a Device object.
Here is the source code I am using:
System::Void InitializeGraphics()
{
PresentParameters* pp = new PresentParameters();
pp->Windowed = true;
pp->SwapEffect = SwapEffect::Discard;
pDevice = new Device(0, DeviceType::Hardware, this,
CreateFlags::SoftwareVertexProcessing, pp);
}
I get the following errors on the line where I call the constructor for
Device:
---------------------------------------
c:\Documents and Settings\snyderm\Desktop\Try3D\Form1.h(75) : error C3635:
'Microsoft.DirectX.InteropData::IDirect3DDevice9': undefined native type
used in 'Microsoft::DirectX::Direct3D::Device'; imported native types must
be defined in the importing source code
did you forget to include a header file?
c:\Documents and Settings\snyderm\Desktop\Try3D\Form1.h(75) : error C3377:
'Microsoft::DirectX::Direct3D::Device::.ctor' : cannot import method - a
parameter type or the return type is inaccessible
c:\Documents and Settings\snyderm\Desktop\Try3D\Form1.h(75) : error C3635:
'Microsoft.DirectX.InteropData::IDirect3DDevice9': undefined native type
used in 'Microsoft::DirectX::Direct3D::Device'; imported native types must
be defined in the importing source code
did you forget to include a header file?
c:\Documents and Settings\snyderm\Desktop\Try3D\Form1.h(75) : error C3377:
'Microsoft::DirectX::Direct3D::Device::GetUnmanagedPointer' : cannot import
method - a parameter type or the return type is inaccessible
c:\Documents and Settings\snyderm\Desktop\Try3D\Form1.h(75) : error C2664:
'Microsoft::DirectX::Direct3D::Device::Device(int,Microsoft::DirectX::Direct
3D::DeviceType,System::IntPtr,Microsoft::DirectX::Direct3D::CreateFlags,Micr
osoft::DirectX::Direct3D::PresentParameters __gc * __gc[])' : cannot convert
parameter 5 from 'Microsoft::DirectX::Direct3D::PresentParameters __gc *' to
'System::IntPtr'
No constructor could take the source type, or constructor overload
resolution was ambiguous
---------------------------------------
The only changes from a basic Windows Forms Application are:
1. I went to Tools-Options, Projects-VC++ Directories, Reference Files, and
added an entry for the "C:\WINDOWS\Microsoft.NET\Managed DirectX\v9.02.1195"
folder,
2. I have added references to "Microsoft.DirectX.Direc3D" and
"Microsoft.DirectX" to References in Solution Explorer,
3. I added "using namespace Microsoft::DirectX::Direct3D;" to my source
file, and
4. I added a data member to my Form1 class like: "Device* pDevice;"
My guess is that there is some other configuration step I am missing?
Any help appreciated,
Mark
- Next message: Rich [Microsoft Direct3D MVP]: "Re: Compiler error creating managed c++ directx app"
- Previous message: Moon Majumdar: "Re: Help with Mesh.Intersect. Getting strange bug."
- Next in thread: Rich [Microsoft Direct3D MVP]: "Re: Compiler error creating managed c++ directx app"
- Reply: Rich [Microsoft Direct3D MVP]: "Re: Compiler error creating managed c++ directx app"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|