• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
monkeyboi

How to open a txt using notepad in directx?

8 posts in this topic

How to open a txt using notepad in directx? Currently I am using system("notepad Config.cfg") which can open a command window and the Config.cfg, but the programm will stop at that line. My expection is open the Config.cfg then keep going and rendering stuffs in directx

Thanks in advance

Jerry
0

Share this post


Link to post
Share on other sites
To launch an application in Windows (it has nothing to do with DirectX). you can use CreateProcess

[url="http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425.aspx"]http://msdn.microsof...p/ms682425.aspx[/url]

link fixed (i hope)

ShellExecute (linked to by alvaro) might be more appropriate though, (It opens the file using the users favourite editor) Edited by SimonForsman
0

Share this post


Link to post
Share on other sites
[url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb762153%28v=vs.85%29.aspx"]http://msdn.microsof...3(v=vs.85).aspx[/url]
0

Share this post


Link to post
Share on other sites
This is my main function. Everything works fine except when I exit the programm there is a Unhandled exception says "Unhandled exception at 0x771b15de in RayTracter.exe: 0x00000000: The operation completed successfully." and it stop at line "if (*lpszCommandLine==DQUOTECHAR) inDoubleQuote=!inDoubleQuote;"
[CODE]
#ifdef _WINMAIN_
/*
* Skip past program name (first token in command line).
* Check for and handle quoted program name.
*/
#ifdef WPRFLAG
/* OS may not support "W" flavors */
if (_wcmdln == NULL)
return 255;
lpszCommandLine = (wchar_t *)_wcmdln;
#else /* WPRFLAG */
lpszCommandLine = (unsigned char *)_acmdln;
#endif /* WPRFLAG */
while (*lpszCommandLine > SPACECHAR ||
(*lpszCommandLine&&inDoubleQuote)) {
/*
* Flip the count from 1 to 0 or 0 to 1 if current character
* is DOUBLEQUOTE
*/
if (*lpszCommandLine==DQUOTECHAR) inDoubleQuote=!inDoubleQuote;//stop here
[/CODE]
[CODE]
INT WINAPI wWinMain( HINSTANCE, HINSTANCE, LPWSTR, int )
{
// Enable run-time memory check for debug builds.
#if defined(DEBUG) | defined(_DEBUG)
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif
// Set the callback functions
DXUTSetCallbackD3D9DeviceAcceptable( IsD3D9DeviceAcceptable );
DXUTSetCallbackD3D9DeviceCreated( OnD3D9CreateDevice );
DXUTSetCallbackD3D9DeviceReset( OnD3D9ResetDevice );
DXUTSetCallbackD3D9FrameRender( OnD3D9FrameRender );
DXUTSetCallbackD3D9DeviceLost( OnD3D9LostDevice );
DXUTSetCallbackD3D9DeviceDestroyed( OnD3D9DestroyDevice );
DXUTSetCallbackDeviceChanging( ModifyDeviceSettings );
DXUTSetCallbackMsgProc( MsgProc );
DXUTSetCallbackKeyboard( KeyboardProc );
DXUTSetCallbackFrameMove( OnFrameMove );
Config();
// TODO: Perform any application-level initialization here
// Initialize DXUT and create the desired Win32 window and Direct3D device for the application
DXUTInit( true, true ); // Parse the command line and show msgboxes
DXUTSetHotkeyHandling( true, true, true ); // handle the default hotkeys
DXUTSetCursorSettings( true, true ); // Show the cursor and clip it when in full screen
DXUTCreateWindow( L"RayTracing" );
DXUTCreateDevice( true, g_Screen_Width, g_Screen_Height );
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
LPTSTR szCmdline = _tcsdup(TEXT("notepad Config.cfg"));
if( !CreateProcess(NULL, szCmdline,
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
0, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure
&pi))
{
printf( "CreateProcess failed (%d).\n", GetLastError() );
}
DXUTMainLoop();
// TODO: Perform any application-level cleanup here
// Wait until child process exits.
WaitForSingleObject( pi.hProcess, INFINITE );

// Close process and thread handles.
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
delete[] szCmdline;
return DXUTGetExitCode();
}
[/CODE]

What causes this problem?

Jerry
0

Share this post


Link to post
Share on other sites
Sorry the Unhandled exception is
Unhandled exception at 0x771b15de in RayTracter.exe: 0xC0000005: Access violation reading location 0x00000000.
0

Share this post


Link to post
Share on other sites
oops my apologize I accidently delete a texture file without tracking the unsuccessful construction.
0

Share this post


Link to post
Share on other sites
[quote name='monkeyboi' timestamp='1344947976' post='4969429']
Currently I am using system("notepad Config.cfg") which can open a command window and the Config.cfg, but the programm will stop at that line
[/quote]
As a side note , system() runs a process and waits for it to finish and only after that it will allow the application to continue its course.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0