Jump to content
  • Advertisement
Sign in to follow this  
AquaMacker

Device Initialize In VS2003, VS2005 Debug mode - NotSolved yet T.T

This topic is 4158 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi EveryOne. I speak English badly. I beg you to understand. Simple Code ------------------------------------------
[STAThread]
static void Main() 
{
	Form1 frmMain = new Form1();
	frmMain.Show();
	frmMain.Init();
	Application.Run(new Form1());

	frmMain.Dispose();
}

Form1.Init()
{
	PresentParameters ppPresentParameters = new PresentParameters();
	ppPresentParameters.Windowed = true;
	ppPresentParameters.SwapEffect = SwapEffect.Discard;

->	m_device = new Device( 0, DeviceType.Hardware, this, CreateFlags.HardwareVertexProcessing, ppPresentParameters );
}







I Use DEBUG Mode in VS2003, VS2005. I Use "Direct Execution" In Debug mode, In VS2003, VS2005, too. -> "m_device.SamplerState[0]" VS2003 : System.IndexOutOfRangeException throw VS2005 : No Exception.(Normal) What's the Answer In VS2003 ? I now programming In VS2003. I am insanning now :-( Please Help ME !!! [Edited by - AquaMacker on February 1, 2007 9:48:24 PM]

Share this post


Link to post
Share on other sites
Advertisement
Have you checked that the device is created ok in VC2003? Is the device null? What is the return code from CreateDevice()? Any relevant debug output? Do you have the debug runtimes installed?

Share this post


Link to post
Share on other sites
Have you checked that the device is created ok in VC2003?
-> Sure, Of course.

Is the device null?
-> not null

What is the return code from CreateDevice()?
-> I don't understand. What is CreateDevice() function ? Is it .Net version function right ?

Any relevant debug output?
-> I don't understand that. Sorry.

Do you have the debug runtimes installed?
-> Yes, Of Course.

Anyway Thanks, Evil Steve.

Share this post


Link to post
Share on other sites
Quote:
Original post by AquaMacker
What is the return code from CreateDevice()?
-> I don't understand. What is CreateDevice() function ? Is it .Net version function right ?


'CreateDevice' is the function that actually creates the DirectX device.

It will return a 'HRESULT' (which is just an integer) to show if the function succeded or failed.

Let me show you how I create my Direct3d9 device:


// create the device
IDirect3DDevice9* d3d9_device = NULL;
HRESULT result;
if( FAILED( result=temp->CreateDevice( D3DADAPTER_DEFAULT, // use the primary display adapter (primary monitor)
D3DDEVTYPE_HAL, // hardware rasteriztion
window_handle, // the window handle
// set hardware or software vertex processing
settings.hardware_vertex_processing ? D3DCREATE_HARDWARE_VERTEXPROCESSING : D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp, // the settings for d3d9
&d3d9_device ) ) )
{
// get a string describing the error that occured
std::string str_result = getDirect3DError(result);

util::LogManager::log( boost::format("%1%: D3D9 Device creation failed for reason: \"%2%\"") % __FUNCTION__ %
str_result, util::MSGTYPE_ERROR );
return false;
}// if FAILED( temp->CreateDevice(......) )





See? You can use the macros SUCCEDED() and FAILED() like this to run code if the call fails.

Quote:
Original post by AquaMacker
Any relevant debug output?
-> I don't understand that. Sorry.


There is also a window in which DirectX will log error messages that you can see while you are debugging.



In the bottom right hand corner. This window shows up when you press the "debug" button to run your program. You might also have to click on the "output" tab to see it.

This is where DirectX will log many error messages that can tell you what is going wrong.

Share this post


Link to post
Share on other sites
Thanks very much, Endar.

You are rock man. ^^a

--------------------------------
What is the return code from CreateDevice()?
-> .Net version CreateDevice() function has No return value;
Only simple ONE line;

Device device = new Device( ... )

No Exception. No Error.

But In Command window(Direct Execution(?)) of Debug mode, I Check "device.Samplerstate[0]" ONLY.
But I can't check this.
In Command Window show "Error : device.Samplerstate Object have no Indexer"(same as included img)

Any relevant debug output?
->
'DefaultDomain': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll', No Symbols loaded.
'exDevice': Loaded 'E:\Test Program 2003\exDevice\bin\Debug\exDevice.exe', No Symbols loaded.
'exDevice.exe': Loaded 'c:\windows\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\system.windows.forms.dll', No Symbols loaded.
'exDevice.exe': Loaded 'c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', No Symbols loaded.
'exDevice.exe': Loaded 'c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll', No Symbols loaded.
'exDevice.exe': Loaded 'c:\windows\assembly\gac\microsoft.directx.direct3d\1.0.2902.0__31bf3856ad364e35\microsoft.directx.direct3d.dll', No Symbols loaded.
'exDevice.exe': Loaded 'c:\windows\assembly\gac\microsoft.directx\1.0.2902.0__31bf3856ad364e35\microsoft.directx.dll', No Symbols loaded.

==== Shortly
'exDevice': Loaded 'E:\Test Program 2003\exDevice\bin\Debug\exDevice.exe', No Symbols loaded.

The BEST ANSWER is ONLY "Use VS2005" T.T
Too sad, Too Angry ! MS !!!


Oh~~ My money T.T
--------------------------------
Anyway Thanks very much, Endar.
Have a nice day~~~ ^^a

[Edited by - AquaMacker on February 1, 2007 10:47:30 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!