Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Martin Koorts

@Martin Koorts
About
Posts
52
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • double buffering on a mfc dialog with CTreeCtrl as content
    M Martin Koorts

    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

    C / C++ / MFC c++ performance

  • Create C++ COM DLL by using Visual Studio.Net 2003
    M Martin Koorts

    Oops! Sorry, I didn't read your message properly. I'll go away now... :-O

    COM csharp tutorial c++ visual-studio com

  • Create C++ COM DLL by using Visual Studio.Net 2003
    M Martin Koorts

    Hi 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

    COM csharp tutorial c++ visual-studio com

  • Accessing IE IWebbrowser2 object with toolbar
    M Martin Koorts

    Hi 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

    ATL / WTL / STL debugging help question

  • Desktopbackround handle?
    M Martin Koorts

    I see. Apologies for having insulted your knowledge there. :-O

    C / C++ / MFC help question

  • Logoff XP error caused by VC++ Program
    M Martin Koorts

    Going 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

    C / C++ / MFC c++ help com question announcement

  • Desktopbackround handle?
    M Martin Koorts

    HWND GetDesktopWindow();

    C / C++ / MFC help question

  • ATL service crashes when being stopped by the system
    M Martin Koorts

    Hi 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

    ATL / WTL / STL c++ debugging

  • GDI and GDIplus
    M Martin Koorts

    Hi 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

    C / C++ / MFC graphics question

  • Printing Output
    M Martin Koorts

    Hi 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

    C / C++ / MFC question c++

  • Statics in tab pages on WinXP?
    M Martin Koorts

    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

    C / C++ / MFC question

  • Logoff XP error caused by VC++ Program
    M Martin Koorts

    Hi 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

    C / C++ / MFC c++ help com question announcement

  • How to get file-size of a file?
    M Martin Koorts

    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

    C / C++ / MFC question help tutorial

  • Statics in tab pages on WinXP?
    M Martin Koorts

    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

    C / C++ / MFC question

  • Statics in tab pages on WinXP?
    M Martin Koorts

    Hi Try setting the static controls' Transparent property to True in the Resource Editor. HTH Martin

    C / C++ / MFC question

  • What SW_HIDE is ShowWindow does?
    M Martin Koorts

    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

    C / C++ / MFC question

  • Unique key generation on a network
    M Martin Koorts

    No, Sorry

    C / C++ / MFC sysadmin help

  • modify the height of header of a list control
    M Martin Koorts

    Hi 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

    C / C++ / MFC help

  • Unique key generation on a network
    M Martin Koorts

    Hi 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

    C / C++ / MFC sysadmin help

  • How to use TRACE() in Win32 Applications
    M Martin Koorts

    Hi 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

    C / C++ / MFC debugging question c++ tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups