|
OK. I added a flush() statement after every group of lines that reads in text to the file and it worked!
The text file has all the data that I want.
Thanks a lot everyone!
--
dg
|
|
|
|
|
You should probably be using endl instead of \n . Otherwise, caching might be a problem.
"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
|
|
|
|
|
I have a Visual C++ MFC application, and I'm trying to add the ability to have a new Outlook mail message window pop up with some information filled in, just like what happens when you click an email link in a webpage and it opens up a new email message in your default mail client. I have code that (using MAPI) lets me actually send an email automatically through Outlook, but I want this to have the message window pop up and not get sent until the user clicks the send button. Any ideas? Thanks.
|
|
|
|
|
What happens with:
ShellExecute(..., "open", "mailto:jbaird1@company.com?Subject=Test&Body=Unconventional", ...);
"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
|
|
|
|
|
Wow that worked perfectly. Thanks very very much!
|
|
|
|
|
Hi all,
I'm populating a CString with a set of int's however if the int is less than 10 I want to put a 0 (zero) before it.
At present I'm populating the CString by using the format method, so my code looks something like:
myString.Format ( "%d, %d, %d", int1, int2, int3) ;
I though maybe using the float method I could force a preceding zero but that hasn't worked, my code is below:
myString.Format ( "%2.0d, %d, %d", int1, int2, int3) ;
does anyone know how to do this?
cheers,
|
|
|
|
|
figured it out, just needed to do:
myString.Format ( "%02d, %02d, %02d", int1, int2, int3) ;
btw does anyone know the term for doing this?
|
|
|
|
|
mcsherry wrote: btw does anyone know the term for doing this?
The term? The 0 is a flag directive, and the 2 is the width.
"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
|
|
|
|
|
Hello all
I am beginner in C++, and I am studying now ISO/ANSI C++, making Console application, and I have some problems with escape characters like "\a" and "\b"
both of them not working on my console
if any one can help, plz send to me
Best Regards
|
|
|
|
|
A-M-S-S wrote: and I have some problems with escape characters like "\a" and "\b"
both of them not working on my console
Define "not working."
"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
|
|
|
|
|
I mean I heard no sound using \a
and when I used
cout<<"abcd\b";
it prints abcd, and my understanding is that it should be print "abc"
|
|
|
|
|
Have you tried printf() instead of cout ?
"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
|
|
|
|
|
yes I had tried,
but still got no sound with "\a"
but I discovered something when I tried "\b"
both cout and printf do the functionality of the escape character \b as soon as there is no new line after printing "\b"
is there any one have an answer for those 2 problems
|
|
|
|
|
A-M-S-S wrote: but still got no sound with "\a"
Do you actually have a beeper, not a speaker, for the sound to come though?
What exactly are you doing that requires the use of a backspace?
"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
|
|
|
|
|
I don't want to do any thing specific, I am just trying to learn c++, and try every concept,
and till now I couldn't able to hear any beep in my speaker
|
|
|
|
|
Hi all:
Does anyone ever use clapack with VS2005.NET? It's really pain, I have spent a whole day on it but I still can't make it work. Here is what I have done and the problems, could anyone help me out please?
First I copied files "clapack.lib, libF77.lib, libI77.lib, blas.lib" to the "..\Microsoft Visual Studio 8\VC\PlatformSDK\lib" directory, the header files "clapack.h, f2c.h, blaswrapper.h" to the "..\Microsoft Visual Studio 8\VC\PlatformSDK\Include" directory.
I copied the sample code from the website of clapack faq 1.9. I added the input libraries to the project by setting the \project\linker\input property.
When compile the program, I got the following errors:
1>main.obj : error LNK2019: unresolved external symbol "int __cdecl dgesvd_(char *,char *,long *,long *,double *,long *,double *,double *,long *,double *,long *,double *,long *,long *)" (?dgesvd_@@YAHPAD0PAJ1PAN122121211@Z) referenced in function _main
1>D:\Project\VS2005\clapack_test\CLapack_test\Debug\CLapack_test.exe : fatal error LNK1120: 1 unresolved externals
Can anyone help me please???
Thanks very very much!!!
Asura
|
|
|
|
|
I want up , down , left and right arrow keys codes to use in bVk of Keybd_Event API function , but i don't know the codes . could anyone help me ?
|
|
|
|
|
VK_LEFT, VK_UP, ...
"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
|
|
|
|
|
|
|
I have a CTreeCtl drived class which implement OnContexMenu();
but i don't know why the popup menu would popup only when i pressed the scrollbar using right button!
Somebody would tell me why?
|
|
|
|
|
You may want to consider handling the treeview's NM_RCLICK notification instead of WM_CONTEXTMENU.
See How To Display a Context Menu for CTreeCtrl[^] for details.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the letter Z
|
|
|
|
|
I have a word processing app (no source) in which a user can copy bitmaps onto the client area, resize them on the client, and then paste them somewhere else in the client area with their new size (nothing unusual here).
I'm intercepting the paste command msgs of this app (through subclassing, etc.), and for the moment, all I'm trying to do is retrieve the content of the clipboard, duplicate it, and replace the original clipboard content with the duplicate. (not my ultimate objective obviously). However, no matter how I try to retrieve the data and put it back to the clipboard, its apparently being altered, because the bitmap dimensions are destroyed, and when the app pastes the item, its it has the original dimensions (not the user-resized dimensions).
The bitmap is being copied by the app as a metafile, so when I intercept the paste message, I'm retrieving it and putting it back to the clipboard as a metafile. The data can be retrieved from the clipboard as an enhanced metafile or plain metafile, and it makes no difference. I've tried Copy[Enh]MetaFile, Get[Enh]MetaFileBits/Set[Enh]MetaFileBits, Create[Enh]MetaFile/Play[Enh]MetaFile, etc - no matter how I try to copy the clipboard data and just put it back unchanged, everthing *is* unchanged, EXCEPT the dimensions, which always lose the most current dimensions and instead revert to the original dimensions.
|
|
|
|
|
I'm confused (not a rare event ). Are you actually changing the metafile before you put it
back on the clipboard?
If so, what methods/APIs are you using to do so?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the letter Z
|
|
|
|
|
Mark Salsbery wrote: I'm confused (not a rare event ). Are you actually changing the metafile before you put it
back on the clipboard?
If so, what methods/APIs are you using to do so?
As I stated, my goal for the moment is just to succeed in copying the data from the clipboard and replacing the content of the clipboard with the copy. However, the metafile's dimensions I put back to the clipboard are screwed up somehow.
Here's one code sample:
HENHMETAFILE henh = (HENHMETAFILE)GetClipboardData(CF_ENHMETAFILE);
int nSize = GetEnhMetaFileBits(henh,0,NULL);
BYTE* data = new BYTE[nSize];
GetEnhMetaFileBits(henh,nSize,data);
EmptyClipboard();
henh = SetEnhMetaFileBits(nSize,data);
SetClipboardData(CF_ENHMETAFILE,henh);
(yeah, its straight SDK.)
The copy that's put back has bitmap dimension info that has been altered. I say that, because if I don't mess with the clipboard at all, (as above) the bitmap is pasted with the dimensions most recently altered by user. With the code above, (which seemingly does nothing but replace the clipboard with a duplicate) when the paste is completed, the image has reverted to some previous dimensions.
In the above, I'm using GetEnhMetaFileBits/SetEnhMetaFileBits. However the same result occurs when just using CopyEnhMetaFile (as well as with yet another method for copying the metafile).
-- modified at 13:00 Monday 9th July, 2007
|
|
|
|
|