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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
D

David Viggiano

@David Viggiano
About
Posts
29
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SetForegroundWindow....
    D David Viggiano

    Are you running under W2K or XP? MS changed the behavior of SetForegroundWindow(). What you need to do is attach to the thread that has the foreground and switch from there. Check out http://www.mooremvp.freeserve.co.uk/Win32/framed\_tip033.htm for a workaround. D

    C / C++ / MFC help

  • WinSock
    D David Viggiano

    try http://tangentsoft.net/wskfaq/

    C / C++ / MFC tutorial question

  • Disabled Undo - argh!
    D David Viggiano

    Yea, I've seen it a few times as well. Overall I get the feeling that VS.NET was not quite past beta. Even with SP2 I still have a number of frustrations with the product - like unpinned windows getting stuck closed. It took me almost a week to get the Memory windows back. But, this is MS. Deliver, deliver, deliver and let the buyer beware.

    Visual Studio visual-studio csharp help question

  • Unpinning Properties Window - Gets Stuck
    D David Viggiano

    I'm runnint a 1.8Ghz PIV with 512M. I don't think it is hardware. The prop sheet works fine for a while and then it becomes unaccessable. I really want to like v7 but there are several frustrating little things...

    Visual Studio visual-studio help question

  • deleting event handlers...
    D David Viggiano

    The only problem is that if you re-add the message handler, the commented out code is still there. This is brain-dead compared to the old ClassWizard.

    Visual Studio csharp visual-studio com question

  • Double Click in Resource Editor
    D David Viggiano

    Hi Hugo, thanks for the reply. I can live with that. My real problem is I double-click on a dialog item and I get the defaul message handler inserted. And (see subject below) it is not possible to delete the message handler using the IDE, you have to manually clean up everything. While not a big deal, I've "trained" myself to double-click on an item to edit the props. So what I really want is a way to change the default double-click behavior to something less obtrusive.

    Visual Studio tutorial question learning

  • Double Click in Resource Editor
    D David Viggiano

    In earler versions, you could configure DevStudio to open the Properties dialog when you doubled clicked on a dialog item. Now it seems to add the "default" message handler. Anyone figure out how to get the Open Properties behavior?

    Visual Studio tutorial question learning

  • deleting event handlers...
    D David Viggiano

    What I see is that it comments everything out, but it does not delete it. And, when you add the same event handler back, it adds a new one - leaving the commented one there! I'm really, REALLY hoping someone at MS decides to put the ClassWizard back in.

    Visual Studio csharp visual-studio com question

  • Unpinning Properties Window - Gets Stuck
    D David Viggiano

    One of the features I really like about the new IDE is the ability to unpin all of the ancillary windows and have a large edit area. But the Properties window seems to misbehave. Once unpinned, I find it difficult to get it to open. I've tried it in different edges without luck. Anyone seen this and have any ideas?

    Visual Studio visual-studio help question

  • Text Size in a CStatic Control
    D David Viggiano

    Simple, thanks yet again.

    C / C++ / MFC help question

  • Text Size in a CStatic Control
    D David Viggiano

    Tomasz, Great! Thanks for the help, that did the trick. One more question, how do I figure out what font the CStatic is going to use? I ended creating a different font first (looks better anyway). Thanks again, David

    C / C++ / MFC help question

  • Text Size in a CStatic Control
    D David Viggiano

    Does anyone know of a way to get the dialog units for the text in a CStatic control? I'm trying to dynamically resize some controls and what MSDN says to do seems to always return 25-50% too big. Here is what I am trying: CDC *pDC; CSize cStringSize; pDC = m_MyStaticControl.GetWindowDC(); cStringSize = pDC->GetTextExtent ("Some string I want the size of..."); I've also tried DrawText(...) but that returns the same size. Thanks for the help, David

    C / C++ / MFC help question

  • Access to a driver
    D David Viggiano

    I assume you checked the return code for the failed CreateFile() and it was #5 (access denied). If so then the most likely problem is the device driver was installed requiring admin privs to connect to it. Check the install.

    C / C++ / MFC help question

  • Windows and Programs
    D David Viggiano

    I'm not sure I understand your first sentence. Be careful with MSDN, there are usually two definitions when you search for something. One is for CE and one is for standard Win32. The ToolHelp API functions work under CE and 98 so you might have been looking at the CE example. The PPERF_* structures are defined in WinPerf.h. The "PP" mean pointer to structure so if you take the first "P" off, you can see them in MSDN (look for PERF_DATA_BLOCK instead of PPERF_DATA_BLOCK).

    C / C++ / MFC question

  • Windows and Programs
    D David Viggiano

    Ah the joys of enumerating process under the different versions of Windows. For 95/98 the best method is to use the ToolHelp API. See the example on MSDN under Process32First(). What we have done here is wrap all of the messy platform specific details into a class. D

    C / C++ / MFC question

  • Windows and Programs
    D David Viggiano

    Yea it is. Getting the PID is not the problem, as you can see. Getting the process name from the PID is difficult. But there is an easier solution if PSAPI.DLL is installed. By default it is there on W2K and XP, redistributable for NT is available. No support for 95/98/Me. Here is how I use it: In my constructor I have something like HINSTANCE hInst; m_pfGetModuleBaseName = NULL; m_pfEnumProcessModules = NULL; hInst = LoadLibrary (_T("psapi.dll")); if (hInst != NULL) { m_pfGetModuleBaseName = (GETMODULEBASENAME) GetProcAddress (hInst, _T("GetModuleBaseNameA")); m_pfEnumProcessModules = (ENUMPROCESSMODULES)GetProcAddress (hInst, _T("EnumProcessModules")); FreeLibrary (hInst); } } Then I use it as follows HANDLE hProc; HMODULE ahMod[10]; DWORD dwNeeded; BOOL bStatus = FALSE; char szProcessName[80]; rStrProcessName = ""; if (m_pfEnumProcessModules == NULL || m_pfGetModuleBaseName == NULL) return (FALSE); // Need to get a handle to the process so we can query the modules hProc = OpenProcess (PROCESS_QUERY_INFORMATION|PROCESS_VM_READ, FALSE, dwPID); if (hProc) { // Get the first few modules. The .exe is always the first one. if (m_pfEnumProcessModules (hProc, ahMod, sizeof(ahMod), &dwNeeded)) { // Get the exe name. It is always the first module. if (m_pfGetModuleBaseName (hProc, ahMod[0], szProcessName, sizeof(szProcessName))) { rStrProcessName = szProcessName; bStatus = TRUE; } } CloseHandle (hProc); } return (bStatus); }

    C / C++ / MFC question

  • Windows and Programs
    D David Viggiano

    Check out http://www.mooremvp.freeserve.co.uk/Win32/framed\_tip038.htm

    C / C++ / MFC question

  • Can this be done? Beginner MDI question
    D David Viggiano

    Sure can. Overload OnInitialUpdate().

    C / C++ / MFC question c++ learning

  • str to double?
    D David Viggiano

    If you need some formatting options try sscanf().

    C / C++ / MFC question

  • MessageBox problem - only flashes
    D David Viggiano

    I'm having a problem with MessageBox(). I am creating a thread to interact with a device driver and if the driver is not loaded/started, I'm trying to display a message to the user. All that happens is that the message box pops up for a second. The return is 1 (IDOK) and GetLastError is 0 (I called SetLastError(0) before MessageBox). I'm calling: ::MessageBox (NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION); Thanks for the help, David

    C / C++ / MFC help
  • Login

  • Don't have an account? Register

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