Link to home
Start Free TrialLog in
Avatar of mrchan
mrchan

asked on

Managed Directx 9 in VC++.NET - Creating a device.

Hello,

I am having problems creating a directx 9 device in VC++.NET. Here is my code.


PresentParameters *pp = new PresentParameters();
pp->Windowed = true;
pp->SwapEffect = Direct3D::SwapEffect::Discard;

Device *device = new Device(0, DeviceType::Hardware, this, CreateFlags::SoftwareVertexProcessing, pp);


It does not work and generates many errors.

error C3377: 'Microsoft::DirectX::Direct3D::Device::.ctor' : cannot import method - a parameter type or the return type is inaccessible

error C3377: 'Microsoft::DirectX::Direct3D::Device::get_UnmanagedComPointer' : cannot import method - a parameter type or the return type is inaccessible

..and so on.

The same code works fine in VB.NET. How do I create a device in VC++.NET? Any help is appreciated :).
Avatar of mrchan
mrchan

ASKER

Found solution.

include the d3d9.h header and its good.

ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial