|
Well, this isn't a fix for the string weirdness, but that code isn't the way to fix the problem with spaces in a filename. Put quotes around the directory name so the OS knows the spaces are part of the name.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
Cool... I attempted to pass the path, which was stored in a variable, while using _execl function from another application. It didnt work. now i created a new variable and added duoble quotes before and after the path. It works fine...
Thanks for helping me fix it...
|
|
|
|
|
Shrinaresh wrote: ...but the space is not being appended...
How are you verifying this?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Shrinaresh wrote: strcat(name, " "); doesnt seem to work. The trailing space is ignored. How can I retain it?
How are you verifying this? Has name been properly initialized prior to calling strcat() ?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I got around my problem (see the reply with title " this is what I am trying to do" in the same post). strcat appends blank spaces.
strcpy(name, "Mickey");
strcat(name, " ");
strcat(name, "Mouse");
returns "Mickey Mouse"...
but when I try to do a similar thing (as in my code in "this is what I am trying to do") the blank is not getting appended. I think the arguments are not null terminated. anyway, this is still interesting but atleast my issue was solved...
|
|
|
|
|
Shrinaresh wrote: I think the arguments are not null terminated.
Your code snippet worked fine for me, although the order of the two strcat() calls should probably be reversed.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello,
I am doing a project in c++ which involves basic file operations i.e. create, copy, rename and delete a file. Here the main thing is performance because the number of times these operations takes palce is 10000. so the program loops for 10000 times and also need to clean up after doing everything.
I have to do this, by mounting a file systems and then i have create a directories on that file system and then perform the operations on the file.
Please suggest me some ideas on how to do this.
|
|
|
|
|
Have you looked at CreateFile() , CopyFile() , rename() , and DeleteFile() ?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I'm trying to obtain when the user starts printing, by having a global hook for StartDoc, what is the name of the printer that is currently selected, any ideas on how to obtain this ? Using VC++ 6.0 and Windows XP.
|
|
|
|
|
|
Is there an article to introduce how to create shapes in a window on codeproject.com or MSDN? A good, simple-to-use tutorial?
I would like to be able to create the shapes in a window (sort of like a tic-tac-toe diagram.
Thanks,
G-Papa
cpp@nearsphere.com
|
|
|
|
|
|
Which article? What does GDI stand for? I am a winapp noob.
G-Papa
cpp/@/nearsphere.//com
cpp/@/nearsphere/./com
|
|
|
|
|
|
???
cpp\@\nearsphere\.\com
|
|
|
|
|
What is your problem? There are several articels that explains how to draw using GDI, start with the first one: http://www.codeproject.com/gdi/paint_beginner.asp[^]
You've posted your question in the C++/MFC forum, so GDI is the easiest option for simple shapes.
If you are looking how to draw in a WinForms/.NET application you should ask your question in the C++/CLI forum.
|
|
|
|
|
Thank you for the direct link to a beginner-oriented article. I am not new to C++, but I am attempting to learn how to create windows applications, starting as simple as possible. I am not sure what CLI even stands for, since my question involved Visual C++, C++ itself, and what I thought would fall under MFC, I deemed this was the correct place to add the question.
The emoticon was included since the same link to the main tutorial page for drawing was in two messages. No problem for me really, just did not clarify.
My problem: Lack of knowledge. Seeking more knowledge, thought this would be a good place.
cpp\@\nearsphere\.\com
|
|
|
|
|
|
hi all!
Is it possible code a "disk catalog program"?
I've got lots of media devices (cd's, dvd's,etc) and it will nice catalog (automaticall) everything on simple database, easy to search.
-- modified at 20:10 Tuesday 27th June, 2006
|
|
|
|
|
Could you provide more spcifics?
Best,
Jun
|
|
|
|
|
A program similar to this, but I wanna make better => http://www.emulator3000.emuita.it/mb.htm
|
|
|
|
|
Hello,
If someone can simply break down the steps, as I think I'm missing something...
My application is a dialog box, with a few buttons. On the button click, I want to launch a new dialog box which I have created in Resources. I have also added classes for it, so it has a cpp and h file.
Now, how do I simply link the button to the dialog box, such that it will simply launch?
Thank you.
|
|
|
|
|
if you are using the MFC class wizard you can double click on the button in the resource editor and it will add a handler for you (you are looking to get an ON_BN_CLICKED handler) Inside the handler declare and instance of the new dialog and away you go
|
|
|
|
|
just to clarify, is this assuming I have created a class for the new dialog as well?
and then you are saying to double click on the button in the old dialog and declare an instance of the new dialog?
I think I am creating too many classes, so please just clarify for me where and for what I am creating the classes, thanks!
|
|
|
|
|
BEGIN_MESSAGE_MAP(CMyMainDlg, CDialog)
ON_BN_CLICKED(IDC_BROWSE_PATH, OnBnClickedBrowsePath)
END_MESSAGE_MAP()
void CMyMainDlg::OnBnClickedBrowsePath()
{
CAnotherDialog dlg;
dlg.DoModal();
}
CMyMainDlg is the dialog for my main application...CAnotherDialog is the new dialog that I want to bring up on the button click.
hope this helps
cje
|
|
|
|