Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

I just downloaded managed directX and I�m trying to run my first application but I cannot even create the device. I always get this error (with another six that I think are related)

 

error C3635: 'Microsoft.DirectX.PrivateImplementationDetails::IDirect3DDevice9': undefined native type used in 'Microsoft::DirectX::Direct3D::Device'; imported native types must be defined in the importing source code

 

Does anybody know what I�m doing wrong?

 

My code is in the txt file attached

 

Thanx

Edited by mutant
Posted

eh?

Send a few snippets of your code rather than a doc, right when you declare your Device and when you instantiate it should be fine.

 

Don't give up on MDX :),

Its hard to get started, I agree - it took me about a half-a-year to get my thoughts organized o_O, and things started to click.

 

Well anyways - send snippets of your code, and tell us what DLLs (actually they're .libs in C++ arent they?) you imported.

 

-Pent

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Posted

Thanx for the support

 

This is what I have.

 

private:

Device* device;

 

 

public:

bool InitializeGraphics()

{

PresentParameters* pres = new PresentParameters();

 

pres->Windowed = true;

pres->SwapEffect = SwapEffect::Discard;

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

return true;

}

 

 

I get an error when creating the device.

I have references to

Microsoft.DirectX.Direct3D

Microsoft.DirectX

Micosoft.DirectX.Direct3DX.

And I also included the namesaces

using namespace Microsoft::DirectX;

using namespace Microsoft::DirectX::Direct3D;

Posted

It seems to me that you're not setting enough flags for the PresentParameters. Mine looks something like this (just ignore the vb and look at the main source :):

 

Protected D3Dpp As PresentParameters = Nothing

Protected DP As DisplayMode = Nothing

DP = Manager.Adapters.Default.CurrentDisplayMode

 

D3Dpp = New PresentParameters()

D3Dpp.BackBufferFormat = DP.Format

D3Dpp.BackBufferWidth = DP.Width

D3Dpp.BackBufferHeight = DP.Height

D3Dpp.SwapEffect = SwapEffect.Discard

D3Dpp.PresentationInterval = PresentInterval.Immediate

D3Dpp.Windowed = True

Also, shouldn't the argument for instantiating the device be, "this.Handle" or your hWnd? (I'm not sure if it is in C++)

 

If that doesn't help, what does the error say? Maybe then we can help you more.

 

-The Pentium Guy

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Posted

Thank you

 

Thanks a lot, but my problem is that it seems like the syntax for MC++ is slightly different from the syntax in VB or C#; and I�ve found almost nothing about MC++ and Managed DirectX, not even in the msdn

 

I found a snippet of code but it doesn�t compile either. Here�s what I found:

 

public: bool InitializeGraphics(void)

{

try

{

// Now let's setup our D3D stuff

PresentParameters *presentParams[] = new PresentParameters *[1];

 

presentParams[0] = new PresentParameters;

 

presentParams[0]->Windowed = true;

presentParams[0]->SwapEffect = SwapEffect::Discard;

device = new Device(0, DeviceType::Hardware, this->get_Handle(),

CreateFlags::SoftwareVertexProcessing, presentParams );

return true;

}

Posted

Here are some of my errors I'm getting

 

Yes, as far as I know in MC++ the PresentParameters is an array. There's a few differences from VB and CSharp.

 

error C3635: 'Microsoft.DirectX.PrivateImplementationDetails.IDirect3DDevice9': undefined native type used in 'Microsoft.DirectX.Direct3D.Device'; imported native types must be defined in the importing source code

 

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

 

Note:

I changed the :: for . because it was not letting me post the reply

Posted

Sorry man, I cant help you out http://www.xtremedotnettalk.com/x_images/images/smilies/frown.gif.

 

I guess your last resort is to paste your entire source in here, with [ code ] //your code [ /code ] tags

 

(no space in between the brackets).

 

If the mods don't allow that then just PM me with the source.

 

-Pent

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Posted

Thx

 

Thanks man, I�m writing some examples in C# now but before I work on the definitive application I�m giving one more try to MC++

 

Thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...