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
A

Andrew Hain

@Andrew Hain
About
Posts
11
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Crash in NetStatisticsGet while unloading DLLs
    A Andrew Hain

    One of our programs crashes right at the end when it runs under Windows 7. We have traced it to this bit of code.

    CT2W szwService(SERVICE\_WORKSTATION);
    

    #if (_MSC_VER == 1500)
    // XXXX The following weirdness is because Microsoft forgot that
    // The signature for NetStatisticsGet should *always* be unicode!
    LPTSTR szService = (LPTSTR)(LPWSTR)szwService;
    #else
    LPWSTR szService(szwService);
    #endif
    STAT_WORKSTATION_0 *pStatistics;
    if (::NetStatisticsGet(NULL, szService, 0, 0, (LPBYTE*)&pStatistics) != NERR_Success)
    ...

    The call to NetStatisticsGet returns NERR_Success on Windows XP (both 32 and 64 bits) but on Windows 7 (64-bit) it returns 0xC000000D (STATUS_INVALID_PARAMETER). Has anyone got an idea what to do next?

    Windows API question

  • Crashes in ATL conversion macros
    A Andrew Hain

    We have been encountering crashes in ATL conversion macros where the ATL library function pointer g_pfnGetThreadACP points not to an actual function but into thin air. The call through g_pfnGetThreadACP can be eliminated by compiling with _CONVERSION_DONT_USE_THREAD_LOCALE defined, but this loses the thread-specific code page in our multithreaded programs. There is no compiler option to simply use CP_THREAD_ACP, although the restriction to Windows 2000 and later would be more than enough for our needs. The programs that have been crashing are compiled with Visual Studio 2005 in release build; debugging builds and similar programs compiled with Visual Studio 2003 do not crash. All programs that have crashed use an in-house port of Objective Grid 9.02 to VS8 which we have used for over a year but programs only just started crashing so there must have been something else that has changed. All crashes have either been when the program has been initializing (MFC InitInstance()) or closing down. Has anyone got any ideas?

    ATL / WTL / STL c++ csharp css visual-studio adobe

  • switch quantity not an integer!
    A Andrew Hain

    If you need a pointer to hello, you can get one by writing &hello.

    C / C++ / MFC help

  • How to make Win32 dll depend on mfc dll?
    A Andrew Hain

    That should be mfc71.lib and mfc71d.lib, or mfc71u.lib and mfc71ud.lib in a wide character application.

    C / C++ / MFC help c++ tutorial question

  • How to make Win32 dll depend on mfc dll?
    A Andrew Hain

    Have you tried adding mfc71.dll (in your release build) or mfc71d.dll (in your debug build) to the Ignore Specific Library (/NODEFAULTLIB) property?

    C / C++ / MFC help c++ tutorial question

  • Prevent Treeview from blinking when updating
    A Andrew Hain

    At one time I was creating and deleting tree items in a tree and it flickered. Are you doing anything similar? Maybe you are changing node names or similarly visible attributes.

    C / C++ / MFC help question announcement

  • Prevent Treeview from blinking when updating
    A Andrew Hain

    You can also try making sure not to remove items and then add them back, or to add and then remove items.

    C / C++ / MFC help question announcement

  • Rich edit view speed
    A Andrew Hain

    I have an application with several rich edit views, and one of them is used as a running log. When two or more additional rich edit views are opened, the log slows right down; the slowdown happens in the view rather than in the code generating the log. All of the rich edit views in the application use SetSelectionCharFormat() to set character formatting; if I comment out the calls in the log, which are to colour text and underline links, it runs at full speed. Should I:

    1. Optimise the calls to SetSelectionCharFormat() to remove calls that repeat the existing format or where no text is output using them?
    2. Use RTF streaming instead of SetSelectionCharFormat?
    3. Buffer the log instead of displaying it continuously?
    4. Abandon rich edit views for another technique altogether?
    C / C++ / MFC performance question

  • How do I stop rich text views scrolling?
    A Andrew Hain

    I have a program that outputs reports into rich edit views using the MFC StreamIn() routine. The reports may be many times the size of the window and the text scrolls frantically as it is streamed in. Is there any way to stop this behaviour and just display a window at the top?

    C / C++ / MFC question c++

  • Records appear out of order
    A Andrew Hain

    Thank you. I am still mystified at how we got away without that for years.

    Database database c++ json

  • Records appear out of order
    A Andrew Hain

    Our application reads information from a Jet database distributed as part of the program. We have recently added a new block of records to the database. They appear in Access in the order that we expect, but our application returns an assorted few of the records first, followed by the rest in order. We are still using the MFC interface to DAO, now through MFC 7.1. We read the database using the MFC/DAO MoveFirst and MoveNext calls. The SQL query is "( [SECT_TYPE_NUM] = 70 )", checking a single field.

    Database database c++ json
  • Login

  • Don't have an account? Register

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