|
Hi Alvaro.
Thanks! You put me on the right track.
I had already tried returning the button selection before popping the message, but your example reminded me that the established routine for this resets the "check" without using a member variable for the radio button group (ah, legacy code!). When I do it your way, the handler repeats once, but not recursively, so I can use a static variable and GetTickCount() to filter out the second call. Kludgy, but it will do.
At least three good-karma credits for you!
David
|
|
|
|
|
Can anyone tell me how to go about resizing a static control according to text size dynamically? Thanks in advance...btw using SDK and not MFC.
|
|
|
|
|
Use DrawText() with DT_CALCRECT to determine the required dimensions.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I have about 20 property pages in a property sheet. They
all just look like a long line of property pages, but it
cuts off the 17th page and the scrolling just doesn't appear on the screen. I tried almost everything to get it to stack the property pages or scroll to see the other pages. Nothing works. Any ideas? Any code?
Please, any response any one can give me will be greatly appreciated.
|
|
|
|
|
DanYELL wrote:
I have about 20 property pages in a property sheet.
My condolences to your poor users
Your incessant rantings indicate you have a brain the size of a pea, and the mental capacity of a bag of hammers. - John Simmons
|
|
|
|
|
I strongly urge you to not use a property sheet. Instead use Chris Losinger's SAPrefs[^] class.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
Hi, I am not good at programming. So, I hope somebody can help me to solve my problem. I already think it for a long time.
My question is I have 2 set of datas. They are stored in variable no[i] and result[i].
no[0]=0.12 result[0]=medium
no[1]=0.27 result[1]=medium
no[2]=0.67 result[2]=short
no[3]=0.43 result[3]=medium
no[4]=0.98 result[4]=high
no[i] and result[i] will combined together( i.e. 0.12 medium, 0.27 medium....)
And my expected result is "0.12medium, 0.67 short and 0.98 high."
How can I program it such that the computer know there have a three type of data, medium, short and high respectively.
The question is so long!!!
Thank you very much!!!
|
|
|
|
|
I would declare an enumeration in one of your header files that the "result" set can see the enumeration like this:
enum {short = 1, medium = 2, long = 3};
Then you can use that code in your array. When you need to make your combined string or output, you will just need to decode a 1 to mean "short", 2 for "medium" and 3 for "high".
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
As has been said, an enum is the obvious answer. The other thing is that if your two values are really one complex type, declare it as such with a struct.
enum Result {short, medium, long}; // can use short = 0, medium =1, etc. with whatever values you want, but unless you use the values directly, it does not really matter what they are and they should be 0, 1, 2 by default.
struct myType
{
float no;
Result result;
}
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
In an MDI application ( well, not really, it's an MDI with only 1 "view" definition )
On my mouse move, I need to hilight items in the view, so I can either draw in the ON_WM_MOUSEMOVE ( in the CView derived class ), or mark item to be drawn, and wait till an Invalidate (WM_PAINT to trigger the OnDraw of the view )comes in to draw it ?
Now, if I want to highlight the item in all the views (frames ? ), with the first option, I'd have to call the Document UpdateAllViews( this ) ( this is the current view ) ?
Ok, I think I get it, the UpdateAllViews call an update on the DIFFERENT views, not the same VIEW in different FRAMES ... Is there a better way to loop true the different "frames" than with a loop on CWnd and check for CWnd::GetWindow(GW_CHILD) ?
and I had a check somewhere that checked only the active view !
And now it's working ... I started writting this 2 hours ago ...
Max.
|
|
|
|
|
Maximilien wrote:
well, not really, it's an MDI with only 1 "view" definition
That's an MDI app. The "MD" refers to multiple open documents, not multiple *types* of documents.
Imho, you should do as little work in a WM_MOUSEMOVE handler, so I think you're doing the "right" thing.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
A simple question, but one I wasn't sure about. Why do you sometimes need lib files along with dlls for everything to work?
|
|
|
|
|
the .lib file that comes with a DLL is allows you to call functions in the DLL as if they were functions in a static library (the .lib). without this .lib, you would have to do GetProcAddress a call for each function in the DLL - no fun.
-c
A conclusion is simply the place where someone got tired of thinking.
|
|
|
|
|
The lib files contains information that the linker (almost like the compiler) needs to know what functions, and where, are in the dll.
The reason why you sometimes need the lib files, is that the linker often finds them automatically.
|
|
|
|
|
In my MDI application one of my views (A FormView ) has a CTreeCtrl .
How can I serialize data in a CTreeCtrl ? I need to be able to reload whatever I saved .
My aim is to read in the serialized TreeCtrl and Display the contents .
Already my FormView has a CTreeCtrl defined (as part of afx data ). How do i make the View's CTreeCtrl be exactly like what I read in using the Serialize() function. By default this CTreeCtrl display an Empty tree .
There is no = Function defined for CTreeCtrl . Please help
|
|
|
|
|
you might look at this[^]
|
|
|
|
|
As it is well known, CStdioFile doesn't support functionality to read text files in neither Unicode, nor UTF-8 formats.
Does anybody know something similar to CStdioFile with function ReadString, that is support Unicode?
Thanks in advance!
Best regards,
Vladimir
|
|
|
|
|
Build .Net app, and take it to a non .NET box. Receive error DLL MFC70.d;ll could not be found. Is there a way to build in release mode so that it will have whatever files it needs no matter what box I take this program to? I want to avoid using an installation program.
|
|
|
|
|
If it's a .NET app then you'll need the .NET runtimes installed on the target machine
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
In the project settings, under general, you can select to use MFC in a static dll, then it's included in your program...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
How can I check if a popup menu closed?
When I click with the right mouse button on my view I show a popup menu and mark something on the view (draw a rect where I clicked).
So, I want to know when the popup window is closed (switched off the screen) to redraw my view, so that my mark will be cleaned!
Is there any message the popup window send to the parent?
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
You could just send a message of your own before the window closes
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
I want my application to have maximized mdi childs and normal (or restored) mdi childs at the same time. Like seen in the Opera web browser.
Any ideas where I can start looking?
|
|
|
|
|
I can't comment on Opera, but with MDI this isn't possible. When one MDI Child is maximized they all are and vice-versa. My guess is that Opera isn't using MDI. You can check with Spy++ or Russ's WinSpector++ here on CP.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|