Hi (what you're doing sounds a bit elaborate) If you're only concerned with the flicker, you can set the dialog's style to include WS_CLIPCHILDREN - this way, the dialog and the control don't compete at drawing the same area. Try it and see if this solves your problem. You can set this property in the Resource Editor too. HTH Martin
Martin Koorts
Posts
-
double buffering on a mfc dialog with CTreeCtrl as content -
Create C++ COM DLL by using Visual Studio.Net 2003Oops! Sorry, I didn't read your message properly. I'll go away now... :-O
-
Create C++ COM DLL by using Visual Studio.Net 2003Hi Run the Wizard; 1. New Project -> Visual C++ Projects -> Win32 -> Win32 Project 2. Application Settings -> DLL -> Export Symbols Shows you how to export a class, variable and function. Martin
-
Accessing IE IWebbrowser2 object with toolbarHi Assuming p refers to the interface pointer in CComPtr, you need to initialise it first - CComPtr needs to hold a valid reference to an IWebBrowser2 interface. HTH Martin
-
Desktopbackround handle?I see. Apologies for having insulted your knowledge there. :-O
-
Logoff XP error caused by VC++ ProgramGoing on your hunch, I'd say you should look at OLEServer1's use of OLEServer2 - might be that it's not releasing a reference. If you suspect that it's a COM reference, you can change reference access to use smart pointers, if you're not already - also provided it's worth the change (I don't know how many such cases there are). If you're using ATL, you can turn on _ATL_DEBUG_REFCOUNT, _ATL_DEBUG_INTERFACES, but these trace to the debug output window, so if you're turning the machine off, output is lost (unless you find a way to stop powering down). Also play around with stopping the 2 apps by hand (and checking with the Task Manager to see if they're still running). Play around with the order in which the 2 apps are stopped. Martin
-
Desktopbackround handle?HWND GetDesktopWindow();
-
ATL service crashes when being stopped by the systemHi It's a bit weird since m_hServiceStatus is a member of the statically allocated CMyServiceModule class. Anyway, what I'll try to do is; see if the m_hServiceStatus is non-NULL when the PostMessageLoop function is entered. If so, RevokeClassObjects or CoUnitialize (or another thread) will be fiddling with the module object. If you can't find whatever code is setting the m_hServiceStatus to NULL, you may find it's address (say after the service is started) and set a breakpoint that monitors an address (ie. set a Condition to 'when (*(int*) 0x12345678) changes' and 0x12345678 is the address of the m_hServiceStatus data member). Are you sure it's not CoUnitialize causing the exception? - typically things will go bonkers if you still have outstanding COM references and call CoUninitialize. Could it be another app still has COM references to objects allocated by the ATL service? Martin
-
GDI and GDIplusHi I haven't used GDI+ but inspecting the GDI+ Graphics class, I see a constructor that takes a HDC, so you should be able to mix the 2. Martin
-
Printing OutputHi What happens if you run this code; ofstream printer("lpt1:"); printer << "test" << endl; If that prints something on your printer, you're in business and can simply change all instances of 'cout' to 'printer', with above lines added at beginning of the main function. HTH Martin
-
Statics in tab pages on WinXP?What happens if you create a Dialog-based MFC app using the wizard, with the same controls? Sorry if this messes you about, but that's just what I would try. Martin
-
Logoff XP error caused by VC++ ProgramHi It sounds like you've got more dangling references elsewhere that haven't been fixed. In this case, you can try to isolate the functionality in your code, by trying to exercising only certain parts of your application between a startup-shutdown cycle - this way you might discover which part(s) of your app is causing the problem(s). If you can, even try to disable parts of your application by commenting it out and re-building for test. Trace all threads in your app too, making sure they all close properly. Good luck ;-) Martin
-
How to get file-size of a file?Hi Using Win32, you can use FindFirstFile and inspect the WIN32_FIND_DATA structure returned from that (and call FindClose when you leave). In .NET, that information is available from the FileInfo class. HTH Martin
-
Statics in tab pages on WinXP?OK What are you using? VC6, VC7? Is this Tab control MFC, eg. with CPropertySheet/CPropertyPage. Is is dynamically created, or just the standard controls dragged from the toolbox onto the dialog in the resource editor? Does this happen with all tab/property pages on your machine, or just the one in your app? Martin
-
Statics in tab pages on WinXP?Hi Try setting the static controls' Transparent property to True in the Resource Editor. HTH Martin
-
What SW_HIDE is ShowWindow does?Hi Yes, the standard CWnd-derived behaviour (such as ShowWindow) will work - you'll have to ensure the focus isn't set to the invisible view if you want the keyboard active, and make sure the window isn't displayed by accident elsewhere, such as a custom OnSize handler, etc. And yes, I believe you can still process OnPaint, OnDraw messages even if the window is not visible - as you can with most messages. I would just not expect the OS to initiate these (WM_PAINT messages) as the window would not require painting in this state. That said, calling UpdateWindow forces a visit of the paint routine (SendMessage(WM_PAINT, ...) I believe). Anyway, let me leave you to your devices.... ;-) HTH Martin
-
Unique key generation on a networkNo, Sorry
-
modify the height of header of a list controlHi I've had a look at this, and can see no way - the CHeaderCtrl retrieved from the CListCtrl has facility for only adjusting the width of a column. You'll have to look at owner-draw. Martin
-
Unique key generation on a networkHi The 'pattern' here is choosing whether to have; a) unique ids generated by a central authority (and relative to itself) - eg. having an autoincrement id in a database table, or similar - or... b) generate unique ids that are absolute (using UuidCreate/UuidCreatSequential) - can be created anywhere and doesn't require contacting an authority Option a) in a distributed environment not only introduces a bottle-neck (consider many clients asking for ids, or even ranges thereof, at the same time), but also in terms of performance cannot compete with client local GUID generation (network time typically cannot compete with local CPU/HW time). Unless the GUID generation causes a technical barrier, or you require ids with predictable values, I suggest you use it. Also, you might want to design it such that you can afford to start using GUIDs now, and capitalise on this known, proven feature in your implementation, and at a later stage, if you still find the performance or size of the ids too large, change it to something bespoke without compromising the design. In other words, ids are opaque and of variable size. HTH Martin
-
How to use TRACE() in Win32 ApplicationsHi Including gives you; _RPT0, _RPT1 .. _RPT4, _ASSERT, et al These are the primitives of TRACE and ASSERT. I always use it like so, for example; _RPT1(_CRT_WARN, "## blah = '%ls'\n", sz); HTH Martin