Click here to Skip to main content
15,898,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: retrieving the default personal folders file path Pin
David Crow18-Apr-07 2:57
David Crow18-Apr-07 2:57 
QuestionRegarding SetupDiEnumDeviceInfo [modified] Pin
VC_RYK16-Apr-07 21:24
VC_RYK16-Apr-07 21:24 
AnswerRe: Regarding SetupDiEnumDeviceInfo Pin
JudyL_MD17-Apr-07 2:11
JudyL_MD17-Apr-07 2:11 
QuestionCFileDialog problem with Vista Pin
Jap61542316-Apr-07 21:09
Jap61542316-Apr-07 21:09 
AnswerRe: CFileDialog problem with Vista Pin
Michael Dunn16-Apr-07 21:20
sitebuilderMichael Dunn16-Apr-07 21:20 
GeneralRe: CFileDialog problem with Vista Pin
Stephen Hewitt16-Apr-07 21:54
Stephen Hewitt16-Apr-07 21:54 
GeneralRe: CFileDialog problem with Vista Pin
Jap61542316-Apr-07 22:08
Jap61542316-Apr-07 22:08 
GeneralRe: CFileDialog problem with Vista Pin
Stephen Hewitt16-Apr-07 22:37
Stephen Hewitt16-Apr-07 22:37 
Here's a program I'll launch with WinExec (I put it in C:\):
// Console.cpp : Defines the entry point for the console application.
//
 
#include "stdafx.h"
#include <iostream>
 
int main(int arvc, char* argv[])
{
	using namespace std;
 
	for (int i=0; i<arvc; ++i)
	{
		cout << "argv[" << i << "] = \"" << argv[i] << "\"" << endl;
	}
 
	return 0;
}


I use the following code to launch it:
// Win32.cpp : Defines the entry point for the application.
//
 
#include "stdafx.h"
 
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
	WinExec("cmd.exe /K C:\\Console.exe C:\\Path name with spaces", SW_SHOW);
	WinExec("cmd.exe /K C:\\Console.exe \"C:\\Path name with spaces\"", SW_SHOW);
 
	return 0;
}


Here's the output from the first WinExec call:
argv[0] = "C:\Console.exe"
argv[1] = "C:\Path"
argv[2] = "name"
argv[3] = "with"
argv[4] = "spaces"


And from the second:
argv[0] = "C:\Console.exe"
argv[1] = "C:\Path name with spaces"


It may not matter for notepad today but that could quite easily change as you're not following established parameter passing conventions. Michael's advice is sound.


Steve

GeneralRe: CFileDialog problem with Vista Pin
Jap61542316-Apr-07 22:49
Jap61542316-Apr-07 22:49 
GeneralRe: CFileDialog problem with Vista Pin
Stephen Hewitt17-Apr-07 2:24
Stephen Hewitt17-Apr-07 2:24 
AnswerRe: CFileDialog problem with Vista Pin
Paresh Chitte16-Apr-07 21:32
Paresh Chitte16-Apr-07 21:32 
GeneralRe: CFileDialog problem with Vista [modified] Pin
Jap61542316-Apr-07 21:53
Jap61542316-Apr-07 21:53 
GeneralRe: CFileDialog problem with Vista Pin
Paresh Chitte16-Apr-07 22:34
Paresh Chitte16-Apr-07 22:34 
GeneralRe: CFileDialog problem with Vista Pin
Jap61542316-Apr-07 22:57
Jap61542316-Apr-07 22:57 
AnswerRe: CFileDialog problem with Vista Pin
Paresh Chitte16-Apr-07 21:38
Paresh Chitte16-Apr-07 21:38 
QuestionHow to gray a Tab in TabCtrl? Pin
narayanagvs16-Apr-07 20:22
narayanagvs16-Apr-07 20:22 
AnswerRe: How to gray a Tab in TabCtrl? Pin
prasad_som16-Apr-07 21:04
prasad_som16-Apr-07 21:04 
QuestionCode-Page? Pin
John R. Shaw16-Apr-07 17:50
John R. Shaw16-Apr-07 17:50 
AnswerRe: Code-Page? Pin
markkuk17-Apr-07 1:58
markkuk17-Apr-07 1:58 
GeneralRe: Code-Page? Pin
John R. Shaw17-Apr-07 4:51
John R. Shaw17-Apr-07 4:51 
QuestionRe: Code-Page? Pin
David Crow17-Apr-07 4:59
David Crow17-Apr-07 4:59 
AnswerRe: Code-Page? Pin
John R. Shaw17-Apr-07 6:33
John R. Shaw17-Apr-07 6:33 
QuestionCTreeCtrl Problem Pin
_anil_16-Apr-07 17:49
_anil_16-Apr-07 17:49 
AnswerRe: CTreeCtrl Problem Pin
aquawicket16-Apr-07 18:03
aquawicket16-Apr-07 18:03 
GeneralRe: CTreeCtrl Problem Pin
_anil_16-Apr-07 18:07
_anil_16-Apr-07 18:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.