|
To simultaneously read and write to a file, you have to always open the file whether for reading or writing with the shared read and shared write access.
For reading till a linefeed you can use CStdioFile::ReadString[^].
|
|
|
|
|
Thank you so much. I'll give that a try.
|
|
|
|
|
I am calling MainFrame's RecalcLayout() to refresh while showing/hiding a dialogbar.
But this is causing a problem, status bar of application got hidden after RecalcLayout() call.
But If I minimize and restore application or resize it, status bar is appearing again.
I want to show status bar always... How to solve this problem?
Same post at msdn: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/d885ea7c-b61e-4550-8029-3d19521fd1bc
Thanks
--
"Programming is an art that fights back!"
|
|
|
|
|
Try calling UpdateWindow after RecalcLayout .
|
|
|
|
|
Tried UpdateWindow(), but no luck... Thanks
--
"Programming is an art that fights back!"
|
|
|
|
|
%s is for ANSI and %ws for UNICODE, but what is the TCHAR equivalent?
i.e.
printf("%???", _T("foo"));
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
sashoalm wrote: what is the TCHAR equivalent?
%s, assuming UNICODE is define'd for wide-character builds.
|
|
|
|
|
Hi .I am getting a WM_PAINT message for a window.
How can I find out where is the source of the WM_PAINT?
But from my regular code flow it is not being called. The window is not being invalidated manually / in code.
Debugging didnt help.
Is getmessageextrainfo() the solution?
In general for any WIndows messages is there a mechanism to find the function/ trigger which is the source of the messages.
|
|
|
|
|
Elsie wrote: How can I find out where is the source of the WM_PAINT?
From MSDN: "The WM_PAINT message is generated by the system ..."
Elsie wrote: is there a mechanism to find the function/trigger which is the source
No.
|
|
|
|
|
Wrong.
Of course you can get the source..
|
|
|
|
|
Not sure its possible but, Spy++ gives you a graphical view of the system’s processes, threads, windows, and window messages.
Using Call Stack[^] you can view the function or procedure calls that are currently on the stack but not the source of windows messages.
--
"Programming is an art that fights back!"
|
|
|
|
|
Elsie wrote: In general for any WIndows messages is there a mechanism to find the function/ trigger which is the source of the messages.
There are no documented methods to determine the source of a window message. However the InSendMessageEx Function[^] can be used to determine if your window is currently processing a message from SendMessage.
Anyway... your application needs to handle WM_PAINT as the system generates it. If you have Vista Aero/Glass enabled then your application may recieve a greater number of WM_PAINT messages and your window update region is not completely under your control.
Best Wishes,
-David Delaune
|
|
|
|
|
Using MFC VC6.0
I have a Dialog box with simple buttons on it. In the buttons caption I have used the '&' symbol to define an accelerator key to the button. ie I have "&Exit" in my exit buttons caption. The resource view shows the button correctly with an underscore below the 'E' in the exit. However if use the "test" (ctrl T) option within the resource editor or compile and run the code then I don't see the undersocre below the 'E' on the button.
Why might this be ? Have missed some option I should have set ?
|
|
|
|
|
Press and release the Alt key. The underscores are hidden until you do this.
|
|
|
|
|
Press the Alt key when your dialog is up, that should make your underscores visible.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Yes, that works, thanks. Is there an option I can add to OnInitDialog() to make them appear straight away ?
|
|
|
|
|
This is a user option. Even if there is a way to do this programmatically, it would be a Bad Thing.
|
|
|
|
|
Not that i know of but that doesn't mean it can't be done.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Neil Urquhart wrote: Is there an option I can add to OnInitDialog() to make them appear straight away ?
You can modify the registry to turn on the "Hide underlined letters for keyboard navigation until I press the Alt key" checkbox. Let me check my notes. As Hans has said, making a change to something that the user may have turned off/on might not be looked upon highly.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
A user can control this (on XP) by going to Display Properties | Appearance | Effects and clicking the checkbox "Hide underlined letters for keyboard navigation until I press the Alt key".
|
|
|
|
|
Hello,
i've created several dialogs for my Tab-Control.
Now i'd like to update a ListBox on the main Dialog by clicking a Button inside one of the Tab-Dialogs.
How may i address the control variables from my main-Dialog?
When i try "GetParentOwner" i cant see the functions or variables, i have declared in my Dlg-Class.
Any guess?
Ty
|
|
|
|
|
Don't have to guess, this is a standard situation that comes up with all dialogs. Look at CFontDialog , for example. You will see a bunch of GetXXXXX() APIs, that the parent can use to access dialog info, after the user hits OK.
In this case, you can set a UserClickedButton variable in your dialog class, that the parent can access. Or even better, implement a GetUserClickedButton() API. If you need to update the listbox immediately, the tab dialog can send a user message to the parent.
|
|
|
|
|
But it aint possible to access membervariables or even instanced classes?
|
|
|
|
|
You can access any member variable declared public. However, it is better form to use accessor APIs.
|
|
|
|
|
Due to my low knowledge on API's and due to the fact that adressing public variables is my lifetime goal i need to know how i may adress them.
i tried to pass the this pointer from the main dialog to the tab dialog. this worked well, but the pointer didn't hold any of the functions or variables declared public.
how is it possible then?
|
|
|
|