|
The application crash was by design.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
|
dear all
how to debug just one function? no need to debug other include main function. thanks
Li Zhiyuan
5/10/2006
|
|
|
|
|
What do you mean by "debug only one function" ?
You can set a breakpoint into this function and step line per line with the F10-Key
|
|
|
|
|
F9
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
thanks,
i mean if my project is so big..too much source code, i just want to check my specified function..dun debug anything of project.
thanks
just debug one function..
Li Zhiyuan
5/10/2006
|
|
|
|
|
Are you actually reading the replies you get?
|
|
|
|
|
Keep the cursor in the line of code where you want the execution to stop and then press F9. This will set a breakpoint. Alternatively, you could use DebugBreak(); or use __asm int 3;
Example:
MyFunction(int iVal)
{
i = i+1;
__asm int 3;
}
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Ever heard of a 'break point'?
Regards,
Vijay.
|
|
|
|
|
I think is quite clear what he means:
Debug (compile and run) only one function without having to build+run the whole app; may be passing it some arguments using some kind of dialog.
Im googling the same subject.
I think that a good solution would be to call that function just at the beginning of your app and use a breakpoint as they say.
Reegards.
|
|
|
|
|
hi
i have a application in windows mobile .
when i click a button it opens a file (if the file name is there )..It works .
Now the problem is that when there is no filename a message shows that "this file name does not exist" . at the same time ,previous file is opened in there .
please help how to close the file after i read it ..
advaned thanks
guru moorthy.k
k.guru moorthy
|
|
|
|
|
Since my CPMRU (Code Project Mind Reader Unit) is out of order, could you please post the relevant code?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
SHELLEXECUTEINFO info;
info.cbSize = sizeof(info);
info.hwnd = NULL;
info.lpVerb = _T("open");
info.lpFile = _T(L"\\Programs\\File Explorer\\sample.pdf")
info.lpParameters = _T("");
info.lpDirectory = _T("");
info.nShow = SW_SHOW;
ShellExecuteEx(&info);
this is for pocket pc ... It works prpoerly but when give wrong file name , it diaplays message box like "the file name is not exist "
and also it shows the previous file opened .
help me
k.guru moorthy
|
|
|
|
|
If you need to close the formerly open documents, then you have to terminate the process whose handle corrensponds to the one returned (if any) by hProcess member of SHELLEXECUTEINFO . But gracefully terminating such process isn't a simple task (at least IMHO).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
also adding to CPallini'd reply
guru moorthy.k wrote: Now the problem is that when there is no filename a message shows that "this file name does not exist" .
set SEE_MASK_FLAG_NO_UI to fMask of SHELLEXECUTEINFO to avoid getting the error dialog
|
|
|
|
|
And why don't you simply check if the file exist before opening it ?
|
|
|
|
|
What the hell are you talking about ?
How do you open your file ?
Where is this message coming form ? Do your program display it ?
You really need to explain your problem in a nore understandable way...
|
|
|
|
|
Hi developers....I have one query regarding to my project...
How to generate serial numbers in file?
Thanks n Advance
raju.k
|
|
|
|
|
Rajesh has answered you with the code snippet 1 hour ago!
Maxwell Chen
|
|
|
|
|
|
sorry rajesh i am not getting ur code ..becoz i am not searching ..its my fault ..plz dont use strong word it hurt it ..i am not a specialist in this
domain just i am fresher ..plz dont do it ..
raju.k
|
|
|
|
|
CStdioFile csf;
CFileException cfe;
CString str, sTemp;
CStringArray csa;
int iSize=0, iVer=0;
if ( !csf.Open(_T("E:\\Some.txt"), CFile::modeReadWrite, &cfe) )
AfxMessageBox(_T("Failed to open the file"));
while(csf.ReadString(str))
{
sTemp = str;
str.Format(_T("%d. %s"), iVer+1, sTemp);
csa.Add(str);
++iVer;
}
csf.SeekToBegin();
iSize = csa.GetSize();
for(int i=1; i<=iSize; ++i)
{
sTemp.Format(_T("%s\n"), csa.GetAt(i-1));
csf.WriteString(sTemp);
}
csf.Close();
1. Copy paste the above code into your project.
2. Change the path of the file name.
3. Compile and run.
4. I pity your employer.
Seriously, if you are not good at something, you should not take that as your profession.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
thanks ..rajesh i ll try my level best ..and plz give ur advice ...
raju.k
|
|
|
|
|
There's no advice. Just copy paste the code and use it.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
That hurts? You do not know John Simmons, do you?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|