|
You could create a dialog in the ressource dialog editor, with 2 buttons and 1 Editbox. Press Strg+W and the Classwizzard will come up, here you can add variables linked to the Editfield or functions that operate when buttons are pressed and more. If you set up all fine you can include the dialogclass in your app, write the sentense you want to the variable in your dialogclass,say mydialog.DoModal();, react on buttons, and have a good time. No more than 10 minutes on it all.
|
|
|
|
|
ryuki wrote:
You could create a dialog in the ressource dialog editor, ... No more than 10 minutes on it all.
True.
But I think my solution is "better" for at least these reasons:
- It can be generically applied to any kind of message box.
- Less internationalization required.
- Takes less than 10 minutes to implement.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Might want to add some handling for strings that do not use correct spacing (i.e. do not have a single space after a comma, colon, etc.). Wrapping can also be done right after a hyphen.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Good point. I'll genericize it and will post an article soon. Thanks!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I am using CHTMLView in my application, but am not overriding any methods related to redrawing or resizing.
Yet, there is significant flashing on resize that is not present in IE with the same content. It's a bit better, when building with .net 2003 instead of VC 6, but still visible.
Has anybody got a fix for this?
Thanks,
-- Harald
|
|
|
|
|
Make sure the windows behind it are not set to draw over it. You might have parent windows (views, frame windows, etc.) that are not set to clip children, and will happily redraw themselves whenever resized - only to be drawn over again by the child CHTMLView.
|
|
|
|
|
Hi,
Right now I'm working on an ActiveX control. We have a very large message map defined with BEGIN_MSG_MAP, a number of MESSAGE_HANDLERs, ended with END_MSG_MAP. For each of the handler functions specified in the MESSAGE_HANDLERs, we return a value. Looking into the macros, it seems that the return value of our handler becomes the value of the lResult reference argument of ProcessWindowMessage function defined by BEGIN_MSG_MAP, and ProcessWindowMessage returns this lResult, to the window procedure.
So now you guys understand the scenario. What I don't understand is what exactly the point of handler return value/lresult is! What does it mean? In our handlers (mostly written by other people) sometimes every path of execution returns 0, sometimes some return 1 and the other/s 0. There is no correlation between whether the handler succeeded or failed. Could someone please explain what these values mean? Thanks.
|
|
|
|
|
In many cases, the windows message handlers originally had the notion that 'return 1 if you processed the message, return 0 if you did NOT process the message'. Then, the idea was that as messages were passed down to child windows or passed through a message handler chain, it could be determined if the function handler 'you' just called processed the message or not. This has changed over time, and now you basically have to read documentation for every message handler to see what the return value might mean and if you are suposed to return one thing or another if you process it.
For example, you can read about WM_INITIDIALOG and it will say something like 'return 0 if you set focus to a control, otherwise return 1', and what that means to the default window procedure is that it will set the focus to first valid control it can find 'unless you already set the focus'.
|
|
|
|
|
|
Hi, every one
There is a message in MSDN about EngModifySurface and EngAssociateSurface:"driver must implement the corresponding function for every bit that it sets in flHooks".
But how to do? I have no idea after searching in MSDN and Internet.
Someone CAN help me?
My E-Mail is :XHZXLQT@163.COM
Thanks Very Much!
__________
\\ //
\\ //
\\ //
\\//
\/
|
|
|
|
|
Are you trying to create a GDI device driver? If so, then you will need to implement the DrvXxx() functions as described in the documentation for EngAssociateSurface() .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks,DavidCrow.
I'll try to create not a GDI driver,but a Video FILTER driver(In my driver ,I'll hook the functions DrvXXX)
The message for EngAssociateSurface and EngModifySurface means that Coder must implement the corresponding function for each DrvXXX function that be hooked.
The problem is: how to implement the CORRESPONDING FUNCTION? How to name the corresponding function ,use the same name DrvXXX or other? And the system how to known which corresponding function maps the GDI function DrvXXX?
|
|
|
|
|
xhzxlqt wrote:
The problem is: how to implement the CORRESPONDING FUNCTION? How to name the corresponding function...
See here. Click on each of the functions in the second column to see what their signature looks like.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi all,
I have 3 dockable views in my application.
In my Overrided "OnEraseBkgnd" message handler,Depending on some useractions
sometimes,I have to redraw the background,some times not.
BOOL C_View::OnEraseBkgnd(CDC* pDC)
{
if//something;;can be many useractions reqiring no redraw
return FALSE;
else// ;can be many useractions reqiring a redraw
return CScrollView::OnEraseBkgnd(pDC);
}
what would be the best way,I could do that...
Thanks...
|
|
|
|
|
Make the background a view too. That helps allot, since windows keeps your backround image clean. If you realy need to redraw it you only need to call backview.invalidate();. You have to create a OnSize() Function that redraws the whole background in the view.
|
|
|
|
|
|
Hello
I want to use image scanner in my program. how can I start?
please some one tell me where can I start !
Thank you,
Iman Ghasrfakhri
|
|
|
|
|
What kind of scanner? If you mean the technologie that is used to build parsers and compilers and such, a Google[^] search will provide you ample results.
Also the most wonderfull programming community on the world has a large collection of articles that are usefull for you: search here for parsers and scanners[^]
Hope this helps
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
|
|
I have the following declaration:
TCHAR uniChar = _T("\xFEFF");
The problem is, on compile it whines that if TCHAR is 8 bits then I'm trying to put an array of chars into 1 char. How would I keep the above statement but so that if TCHAR is set to 8, it cuts off either FE or FF?
|
|
|
|
|
Hello,
You declare one variable of type TCHAR, but you try to assign an array! Try the following instead:
<br />
const TCHAR* pszUniChar = _T("\xFEFF");<br />
Hope this helps
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
If you want it to be a string, do what Bob says. If you want it to be a single character, you need to surround the Unicode character with single quotes instead of double quotes:
<br />
wchar_t uniChar = L'\xFEFF';<br />
It doesn't make sense to use TCHAR for a single character, as in a non-Unicode build it would equate to a char, which can't handle a value as large as 0xfeff.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Thx, I also noticed another problem now that my program compiles. When I open unicode files and process them, the output ends up being weird. Then when I opened the file in hex editor and compared to original I noticed that it reads the first three bytes of the unicode file (FEFF tag and the first character, except that it processes them as FF 00 FE 00 3C as opposed to FF FE 3C ) and then instead of all the other text I just see end of line characters: 00 0D 0A repeated over and over again. Any idea where my strings are disappearing to?
|
|
|
|
|
I figured out what was causing this, I needed to use CFile::typeBinary tag when opening files
|
|
|
|