Thanks. Actually, I have already read up on that, and have no problem with WS_EX_COMPOSITED when not using MFC. However, I am not seeing the expected results when I use WS_EX_COMPOSITED with MFC. I am overriding the PreCreateWindow method for a View in a MDI Doc/View application:
but I still get flickering when I draw the window by overriding the OnDraw method. In OnDraw, I'm using a GDI+ Graphics object, and I use the Graphics::Clear method before doing my drawing. There is no flickering when NOT using MFC, even using Graphics::Clear, if the WS_EX_COMPOSITED window style is used.
I thought maybe MFC was using some conflicting window styles, but don't know. Just wondered if something more was required, such as changing some other window style(s) to be compatible with WS_EX_COMPOSITED, or something like that.
Sorry to take so long to get back on this. The problem does indeed seem to be related to scrolling. Mostly I have problems with Graphics::DrawImage with large bitmaps. Everything is fine (except for flickering when resizing by dragging the lower right corner of the window, and some other times), until I add cs.dwExStyle |= WS_EX_COMPOSITED in a PreCreateWindow override. Then, my image flickers and sometimes completely disappears when it is scrolled. It comes back if the window is resized, but is lost again when the window is scrolled.
I'm not having much luck overriding the base class PreCreateWindow with other styles, but I'll double check whether I'm doing that correctly.
Thanks for any help you can give.
-- modified at 12:23 Wednesday 19th September, 2007
Hello 2 everyone interested!
I am looking for a function to convert data from DWORD, float,double and SYSTEMTIME (if possible, this last one) into string.
In fact, I want to dump variables of those data types into a log file. I am using MFC, with CFile and <filename>.Write() function, which expects a string as a parameter.
If I try using filename.Write(LPWSTR(var))(LPCWSTR, or any other string types...) i get conversion errors (sometimes that it requires 'explicit cast').
Any ideas ?
I have, now. It doesn`t work, although I include stdio.h. It accepts the header (I mean, it finds it to include it), but when encountering sprintf_s() in sais "undeclared identifier".
I have also tried _itoa_s()
Link provided: http://msdn2.microsoft.com/en-us/library/0we9x30h(VS.80).aspx
When compiling, it seems ok, but when the application comes to using that part of the code, I get an application error code, and Windows asking me to send the info to microsoft.
I think that perhaps because I try to convert an unsigned int (DWORD - 64-bit unsigned integer.), using an int-converting function, might result in some buffer overflows. Can anyone suggest an alternative to _itoa_s (for using with unsigned int vars)? I can`t figure it out which is the one...
I think I should mention that I`m writing code for a Smart Device (pocket pc) using WM5.
update to this:
I have initialised Radiux with 5 (just... picked it) and it won`t get out with error.
But I get strange data, when logging i get squares instead of some characters, yet some numbers are displayed, too. Who can tell me what does Radiux do ? I don`t understand from the function's description, found here: http://msdn2.microsoft.com/en-us/library/0we9x30h(VS.80).aspx
Well, I now did write sizeof(buffer) instead of fix size, and I understand the benefits, thanks to you.
I wonder how you found out about me using strlen, was just a trial (it wasn`t that obvious for me that was wrong before trying it), and I've modified the post when I`ve discovered that it doesn`t work. Indeed,learned on the hard way, strlen on a buffer is a No-No.
Thank's for the tip about zeroing the buffer before calling _ui64toa_s(). It does ring a bell, now., though in my application this part of the code comes to execution only when data exists in all fields I convert, so it's not posibile to have to convert an old value. Anyway, for future practice...
Concerning double to string, I used var-(int)var (where var was of type: double) to get the integer part (which was... int) and used _itoa_s to convert it into a string, and the rest I started multiplying by 10 (I only needed 4 digits after .) .
SYSTEMTIME is a structure type, in which all components are of type WORD. So perhaps _itoa_s() - or someone in it`s family - will do the trick.
Thanks again for all your help!
When im binding my socket, i want to find out what local address that is connected to the internet, if there are any, and bind it to that address.
What is the best way to get this info? getaddrinfo() dosn't know if an address is connected to a lan that has no internet access, or if it is connected to a lan with an internet forwarding gateway, or if its directly connected to internet via PPPoE or something like that.
Maybe this info be found in the windows register?
(just using INADDR_ANY dosn't cut it in this case, i need a specific address to bind to)
To clearify what i want to use this for im writing an utility that moitors my internet traffic.
Thanks in advance for any input.
Last Visit: 31-Dec-99 18:00 Last Update: 22-Oct-21 1:01