|
CFileStdio saptxt;<br />
saptxt.Open("temp_170807.txt",CFile::modeRead);
In the above case the file temp_170807 has to be located in the same folder as the application. How can i change it to something like "C:\My folder\temp_170807.txt"??
Also how can i make this text-file name generic ie. like "temp_*.txt"??
I m using VC++ MFC application
|
|
|
|
|
Isn't it CStdioFile?? And you can just include the path also with the file name.
saptxt.Open("C:\\My Folder\\temp.txt",CFile::modeRead);
But you can’t open a bunch of files using *, if that’s what you meant by generic file name.
"What's on your mind, if you will allow the overstatement?"
|
|
|
|
|
yashveer wrote: In the above case the file temp_170807 has to be located in the same folder as the application. How can i change it to something like "C:\My folder\temp_170807.txt"??
Err, saptxt.Open("C:\My folder\temp_170807.txt",CFile::modeRead); or am I missing something here?
|
|
|
|
|
Well thanks Swathee
i was putting single back-slash"\"
double back-slash solved the problem...thnks[ ]
but the problem of temp_*.txt still remains
what can i do to get rid of this problem??
Program doesnt take temp_*.txt
|
|
|
|
|
hi,
please mention the complete error...
also,change the line to
saptext.Open("C:\\My folder\\temp_170807.txt",CFile::modeRead);
note the slashes...
swaroop
|
|
|
|
|
What are you trying to do exactly?? you have to open files separately you can't open them in a bunch.
"What's on your mind, if you will allow the overstatement?"
|
|
|
|
|
hi swaroop
double back-slash solved that problem...
In the location C:\Myfolder i could have, lets say:
temp_170807.txt
temp_180807.txt, etc....
But only one file at a time will be present
so i need to give a generic criteria like:
C:\\My folder\\temp_*.txt
Hope you got the problem
|
|
|
|
|
i m opening only one file at a time....
only one file at any given time will be present in the folder:
C:\\My folder\\
i.e. i have either text_1000.txt or text_1001.txt in that location
so i need to give something like text_*.txt
i hope its clear...
|
|
|
|
|
better u don use the multiple selection like this, use a CFileDialog class for that purpose, refer MSDN
swaroop
|
|
|
|
|
I guess you will have to find the file name at runtime and then read it?!!
There is a class called CFileFind MFC, you can use that,
<br />
CFileFind finder;<br />
finder.FindFile("C:\\Design Docs\\temp*.txt");
<br />
finder.FindNextFile();
<br />
CString filename = finder.GetFilePath();
<br />
finder.Close();<br />
Hope this solves your problem. Happy weekend.
"What's on your mind, if you will allow the overstatement?"
|
|
|
|
|
actullay by giving * wont solve ur problem, os else wat u can do is , if the file name ends with constant increase like temp_001, temp_002, etc just put the file open in a loop , concat the file name with the count (eg001,002) and open it and use it, don forget to close before u leave the loop
swaroop
|
|
|
|
|
Thank you very much Swathee
It solved my problem
Happy weekend
|
|
|
|
|
I suggest studying up on the concept of absolute vs. relative paths.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hey friends..
CDC::Arc/CDC::Pie are not supported in Windows CE..
I have tried to draw Arc using simple for loop and x = cos(Angle) * radius...
and then CDC::SetPixel used to Glow it...
but
there is Aliasing problem...
Is there any efficient Algorith to Draw Arc/Pie
Thanks in advance...
|
|
|
|
|
It's going to involve some math... But can you use CDC::Ellipse, and CDC::SetClipRegion with a triangle to make the arc, and then just draw the sides of the Pie using plain old lines?
(and yes, I'm too lazy to do the math / code here!)
Iain.
|
|
|
|
|
Hi!
I having a bit of trouble with drawing an arc and I hope somebody
here could give me a hint.
What I want is to draw an arc given the following parameters: a
bounding box (x1,y1,x2,y2) and a start- and end-angle.
The center point of the arc is the same as the center point of
the bounding box, and the start- and end-angle determines how
long the arc should be.
In example, a square bounding box and a start-angle of 0 and end-
angle of 360 will give a perfect circle (the inscribed circle of
the bounding box), while a "squashed" box and angles of 110 - 200
will give a quarter of an equally squashed circle (starting at 110
degrees).
Moreover, I would like to draw filled arcs (like a pie slice)
as well.
Can anybody give me a hint or an algorithm to look at? I've looked
at the normal Bresenham circle algo and think it should be possible
to adapt this, but I've been unsuccessfull so far.
WinCE Does not support MFC's ARC/Pie .
|
|
|
|
|
Hello,
I have created 2 windows with styles
WS_VISIBLE | WS_CHILD | WS_BORDER |WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_THICKFRAME |WS_OVERLAPPEDWINDOW | WS_VSCROLL | WS_HSCROLL.
When I maximize one window the child window gets merged with the mainframe window and now I can neither minimize this window nor can I see other windows. The restore icon is missing with this window.
What kind of styles should I include or exclude from the above styles of is there any coding involved?
Thanks
Prithaa
|
|
|
|
|
hi
Refer to MSDN before making a dialog window as child,remove the WS_CHILD it will work for now..
swaroop
|
|
|
|
|
If I remember, there was a setting somewhere to prevent stepping into template classes while debugging. ie. If I dereference a vector iterator while passing it to a method, I want to be able to hit F11 and step directly into the method, not the dereferencing.
Could anybody jog my memory?
|
|
|
|
|
I have see this in someones tip here[^]
|
|
|
|
|
Hello Friends,
can anybody tell me how to convert wchar to plcwstr. and how to use OutputDebugString() fun to print other datatypes such as int
|
|
|
|
|
WCHAR is a wide character and LPCWSTR is a pointer to a string of WCHARs.
You can use CString::Format to convert any datatype to string and pass that CString to OutputDebugString.
"What's on your mind, if you will allow the overstatement?"
|
|
|
|
|
If you want to print numerics in OutPutDebugString(), I would suggest you first create the string using sprintf() then pass the whole string into OutputSebugString().
|
|
|
|
|
I really don't know if this is the right place to put this question, but I'm sure here are many professionals that will know what I'm interested in. Can somebody direct me to the BT mouse programming? I mean where I can get some good resources how the whole thing works? If I buy BT mouse and connect it to the PC do I have to do pairing, etc.? Actually what I want to do....I want to connect BT mouse to Symbian based smart phone and use it as an external device that controls mouse pointer in the Safari web browser. I'm not familiar with the technologies involved. I know that I need bluetooth stack which is already in the phone, but I don't really know how this is conceived on Windows. Who does the preliminary connection? PC or mouse? Do I need some kind of driver that will do the message translation from the mouse to the coordinates or at least directional movement? And yes, IS THIS INTERFACE STANDARDIZED? I mean, I'm sure all BT mouses work on Windows with basic functions. If you need additional buttons, then you install manufacturers mouse driver.
Best regards,
Rostfrei
|
|
|
|
|
Hi everybody,
is it possible to add a message loop to a simple DOS-Application (with a _tmain starting-function)?
Big thanks for help
|
|
|
|