|
In principle it should not interfere with MFC's message handling. But your message loop does not conform to the MFC standard. You would loose PreTranslateMessage and idle time processing (which updates menus and toolbars). Some MFC classes might stop working properly.
The msdn contains some articles how to write an MFC conformant message loop: Idle Loop Processing.
Another (maybe better) method is described in knowledge base article Q99999.
regards Oliver
|
|
|
|
|
Thanks Oliver.
I was expecting more responses though.
Your reply was the single solace
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Dear friends
Will you please help me how to display contents by maintaining scrollbar movement.I think i have to display line by line an WM_PAINT but it didn't work and access violation error comes.
Actually i am displaying the contents of clipboard so it should be of varying length and i am accessing it line by line from clipboard.
so please give me solution to do it in a right way.If possible please send me some code example.
i shall be ever great ful to you for this.
Thanking you in advance.
Binnu
|
|
|
|
|
Dear friends
Will you please help me how to display contents by maintaining scrollbar movement.I think i have to display line by line an WM_PAINT but it didn't work and access violation error comes.
Actually i am displaying the contents of clipboard so it should be of varying length and i am accessing it line by line from clipboard.
so please give me solution to do it in a right way.If possible please send me some code example.
i shall be ever great ful to you for this.
Thanking you in advance.
Binnu
|
|
|
|
|
how do you make it so a string or some variable that changes whithin the program will be dislayed in a tooltip box?
-Raffi
|
|
|
|
|
Do you want tooltip to the controls?
Eugene Pustovoyt
|
|
|
|
|
Hi,
Does anyone here have a favorite algorithm and/or method for generating serial numbers for users on applications you have written? If so, I would be very appreciative if you would share them
I am on the verge of writing my first shareware application and would like to implement this feature.
Also if you have any other ways or methods I would greatly appreciate hearing them...(i.e. links to articles on web pages, links to algorithms or methods, etc...)
I am not looking for something CRACK proof but something just to make it look a little more professional, and have casual users register.
TIA for any answers.
Sam C
----
Systems Manager
Hospitality Marketing Associates
|
|
|
|
|
How can I retrieve the desktop patterns and wallpaper displayed in the control\display pane?
|
|
|
|
|
There is a DrawDesktop api call ( that might not be the name, but it's something *like* that ).
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
This registry key has a list of all the patterns
HKEY_CURRENT_USER\Control Panel\Patterns
I cant figure out where it saves the current pattern
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Nish [BusterBoy] wrote:
This registry key has a list of all the patterns
HKEY_CURRENT_USER\Control Panel\Patterns
I cant figure out where it saves the current pattern
Open this key
HKEY_CURRENT_USER\Control Panel\Desktop
and take a look at the value "Pattern"
Now compare the value of "Pattern" with all the patterns to find out which of the named patterns is the current pattern
If there is no current patter "Pattern" will return a null string
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
For getting wallpaper info do this -
Open this key :-
HKEY_CURRENT_USER\Control Panel\Desktop
Query the following values :-
TileWallpaper [can be 1 or 0]
Wallpaper [the fullpath filename of the wallpaper]
WallpaperStyle [can be 0-for center and 2-for stretch] -- [I dont know what 1 stands for ]
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Hi all!
I have a tree in a dialog. The dialog has other controls on it also. When I select a branch in my tree, the branch changes color (it's highlighted). If click on different control, say a button outside the tree, then the branch change color back to before it was selected(it's not highlighted any more). How do I keep its highlighted color when the tree looses focus?
Thank You
Vu
vucsuf
|
|
|
|
|
Make sure you check "Show Selection Always" in the resource editor.
|
|
|
|
|
use the TVS_SHOWSELALWAYS style
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Help!
I'm having problems understanding. I am reading a binary file using a structure to hold the data:
MY_STRUCT myStruct
fread(&myStruct,sizeof(MY_STRUCT),1,inFp)
When I examine the elements of myStruct, it looks like data is stored correctly in the structure's data elements.
HOWEVER, when I try to read the file again, the file pointer inFp is not at the end of the just read structure -- it doesn't advance to the end of the just read block of binary data, but instead looks to be positioned half-way between the start and end of the block.
Any help? I just want to read binary data one logical block at a time.
Thanks.
Johnny
|
|
|
|
|
fread should act just as you assume - it reads and sets the fp to the place it stopped reading. check the return from fread, or call feof, to make sure you're not out past the end of the file...
-c
Smaller Animals Software, Inc.
|
|
|
|
|
That's what I thought and hence my (utter) bewilderment %-)
thanks, I'll keep trying.
|
|
|
|
|
Just a thought, as this is a problem I have encountered myself. In the debugger, try seeing what sizeof(MY_STRUCT) is and compare it to what you're expecting. I've found that the program that generates the structured files can be using a pragma pack (see MSDN for details) might result in a different value of sizeof(MY_STRUCT) than another program that is not using it.
I believe that VC++ tries to align structures to 4-byte boundaries (not sure - I'd have to check MSDN) so if it is not packed, the sizeof call could return a value larger than expected.
Hope this helps.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
To fix the byte alignment problem you can change the packing for your structure so the extra bytes are not added.
#pragma pack(push, 1)
typedef struct
{
blah
} MY_STRUCT;
#pragma pack(pop)
Todd Smith
|
|
|
|
|
Thanks.
I am using a #pragma pack as follows:
#pragma pack (push, enterImportExport)
#pragma pack (2) // 1,2,4,8,16
// Restore enterImportExport settings at end of this header file.
typedef struct
{
blah,
blah,
} MY_STRUCT;
...
typedef struct
{
blah,
} ANOTHER_STRUCT;
...
// Restore enterImportExport settings.
#pragma pack (pop, enterImportExport)
I don't think I have tried all the alignment values (1,2,4,8,16), but byte alignment did pose a problem when I was reading another binary file using ANOTHER_STRUCT -- this works.
Thanks for the suggestions. Curious on results?
Johnny
|
|
|
|
|
Ah!
I found my critical mistake. Yes, the byte-alignment would be an issue and I did account for this as my binary file read is based on a similar operation I performed successfully in the same application.
MY PROBLEM WAS in how I opened the file. I orginally was reading a text file and then when I changed to reading a binary file, I forgot to use the parameter in the fopen() statement:
fopen (sSourceFile,"rb") instead of just fopen (sSourceFile,"r")
Thanks for all those who offered help and advice.
Johnny
|
|
|
|
|
Hello,
What would be the easiest way to extract just a file name from a CString containing a full path and file name?.. I realize there are other ways of getting the file name besides parsing the string but for right now I need to extract the info from a string..
eg..
CString strPath;
strPath = "c:\\some path\\that could be deep\\this is\\file.txt";
What would be the best way to extract the "file.txt"? The problem I am having is the file is not all ways the same name and the path varies in length(depending where the file is located."
Thanks,
Rob
Rob Jones
|
|
|
|
|
You may have got the answer already, but here is what I would offer:
pos = strPath.ReverseFind('\\') and
strPath.Right(pos)
It would be proper to test if strPath actually is in the format you expect, i.e. DriveName:\...\filename.extension
a slick routine would except:
c:\filename.ext
c:\dir1\filename.ext
filename.ext
Good luck.
|
|
|
|
|
Take a look at the MFC routine AfxGetFileName. You probably can't use it directly, but you can lift the code and use it in your app.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|