Click here to Skip to main content
15,902,635 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionUndeclared Identifier Pin
faceninja22-May-08 13:25
faceninja22-May-08 13:25 
AnswerRe: Undeclared Identifier Pin
Dan22-May-08 14:53
Dan22-May-08 14:53 
AnswerRe: Undeclared Identifier Pin
tataxin22-May-08 15:13
tataxin22-May-08 15:13 
AnswerRe: Undeclared Identifier Pin
Nemanja Trifunovic22-May-08 16:52
Nemanja Trifunovic22-May-08 16:52 
AnswerRe: Undeclared Identifier Pin
Stephen Hewitt22-May-08 18:41
Stephen Hewitt22-May-08 18:41 
AnswerRe: Undeclared Identifier Pin
faceninja23-May-08 7:11
faceninja23-May-08 7:11 
Questionwhats wrong with this code Pin
lahom22-May-08 13:02
lahom22-May-08 13:02 
AnswerRe: whats wrong with this code Pin
Rajkumar R22-May-08 20:26
Rajkumar R22-May-08 20:26 
what you are doing in vbGetCommandLine() you are trying to form a single string while the command line is already managed to separate the parameters to separate buffers (argument vectors __argv) and you are trying to bound with quotes if a single parameter has space, do you know if the parameter has space it is split into individual __argv element. These should be taken care when executing the application.


lahom wrote:
the main idea here is: after saving the file with any data it contains....
when i double click it ...it should open ..first by checking the path of the file then open that file.


if you want to get the file path, just take the first argument, better is to parse the parameters for flags,
Since you are using MFC, you can use CWinApp::ParseCommandLine, in the application InitInstance do the following,

BOOL <yourappclass>::InitInstance()
{
	....
	CWinApp::InitInstance();

	....
       
   	<big>CCommandLineInfo cmdinfo;
	ParseCommandLine(cmdinfo);</big>
	CBmpDlgDlg dlg;
        // set the file name to the member of your dialog class so that in the InitDialog create the file
	<big>dlg.m_strFileName = cmdinfo.m_strFileName; </big>
	m_pMainWnd = &dlg;
	INT_PTR nResponse = dlg.DoModal();
        .....


and in the InitDialog of your dialog class open the file,

BOOL CBmpDlgDlg ::OnInitDialog()
{	
	CDialog::OnInitDialog();
        ....
        CFile f;	
        f.Open(<big>m_strFileName</big>, CFile::modeRead);	
        CArchive ar(&f, CArchive::load);
        .....

GeneralRe: whats wrong with this code Pin
lahom22-May-08 20:50
lahom22-May-08 20:50 
GeneralRe: whats wrong with this code Pin
Rajkumar R22-May-08 20:58
Rajkumar R22-May-08 20:58 
GeneralRe: whats wrong with this code Pin
lahom22-May-08 21:10
lahom22-May-08 21:10 
GeneralRe: whats wrong with this code Pin
Rajkumar R22-May-08 21:35
Rajkumar R22-May-08 21:35 
GeneralRe: whats wrong with this code Pin
lahom22-May-08 21:47
lahom22-May-08 21:47 
GeneralRe: whats wrong with this code Pin
Rajkumar R23-May-08 0:42
Rajkumar R23-May-08 0:42 
GeneralRe: whats wrong with this code Pin
lahom23-May-08 6:59
lahom23-May-08 6:59 
GeneralRe: whats wrong with this code Pin
Rajkumar R24-May-08 3:23
Rajkumar R24-May-08 3:23 
QuestionFile Serialization versus old style data saving on files Pin
Kwanalouie22-May-08 5:56
Kwanalouie22-May-08 5:56 
AnswerRe: File Serialization versus old style data saving on files Pin
CPallini22-May-08 6:02
mveCPallini22-May-08 6:02 
GeneralRe: File Serialization versus old style data saving on files Pin
toxcct22-May-08 6:30
toxcct22-May-08 6:30 
GeneralRe: File Serialization versus old style data saving on files Pin
CPallini22-May-08 7:28
mveCPallini22-May-08 7:28 
AnswerRe: File Serialization versus old style data saving on files Pin
Hamid_RT22-May-08 6:46
Hamid_RT22-May-08 6:46 
AnswerRe: File Serialization versus old style data saving on files Pin
David Crow22-May-08 6:48
David Crow22-May-08 6:48 
QuestionProblem with CHttpFile and HTML Pin
Sylv3322-May-08 4:06
Sylv3322-May-08 4:06 
QuestionHow long int can the threads ID be... Pin
pl_kode22-May-08 4:03
pl_kode22-May-08 4:03 
AnswerRe: How long int can the threads ID be... Pin
CPallini22-May-08 4:13
mveCPallini22-May-08 4:13 

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.