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
U

Ulf Ohlen

@Ulf Ohlen
About
Posts
32
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • ATL alternative
    U Ulf Ohlen

    Interesting, I'll take a look at it. Thanks.

    COM c++ delphi com question

  • ATL alternative
    U Ulf Ohlen

    I'm looking for a free alternative to ATL. Some sort of COM wrapper library that can be used with a free compiler like MingW or Borland C++. Is there such a thing?

    COM c++ delphi com question

  • In the "Bad Product Names" category...
    U Ulf Ohlen

    Honda Fitta was never sold in Sweden. "Fitta" means... ahem... the rudest possible name for the female sexual organ.

    The Lounge com json

  • Cannot save file. The file may be in use by another application.
    U Ulf Ohlen

    Stephane Routelous wrote: Are you sure that no other VC is running ? Yes. It happens to me sometimes when VC crash, I need to kill it with the Task Manager. I've had that problem too, but I don't think they are related. I get the error even without a crash.

    C / C++ / MFC help question

  • Cannot save file. The file may be in use by another application.
    U Ulf Ohlen

    MSVC has started to report this error when I try to save source files. It occurs maybe one time out of three, even if I have only one instance of VC running. Very annoying. Has anyone else had this problem with VC6/Win2000? Is it a known bug in VC? I found nothing on MSDN. It might be a Win2000 problem, I've never seen it under Win98.

    C / C++ / MFC help question

  • Windings and WTC Attack - Very Scary
    U Ulf Ohlen

    You forgot to subtract 5 for the number of letters in "Gates". -------------- "Aagh!! I'm a victim of a Random Act of Management!"

    The Lounge agentic-ai

  • Keyboard and Game!
    U Ulf Ohlen

    One way (in MFC) is to override CWinApp::OnIdle() and use GetKeyState() to check if a key is pressed. -------------- "Aagh!! I'm a victim of a Random Act of Management!"

    C / C++ / MFC help game-dev question announcement

  • MDI application
    U Ulf Ohlen

    Don't know if this is an "easy" way, but it seems to work (I haven't tested it much). The idea is to replace the generated view window with a property page. 1. Generate a standard MDI project without Doc/View support. 2. Remove the generated CWnd derived view class from the project. 3. Add a FormView dialog resource and create a new CPropertyPage derived class attached to it. 4. In your CMDIChildWnd, replace the old view with an instance of your new CPropertyPage class. 5. In the child frame's WM_CREATE handler, remove the code to create the old view. Replace it with something like this:

    m_wndView.Create(IDD_MAINVIEW, this); // Create a CPropertyPage based view
    SetWindowLong(m_wndView.m_hWnd, GWL_STYLE, WS_CHILD | WS_VISIBLE); // Make it a child to the childframe
    m_wndView.SetDlgCtrlID(AFX_IDW_PANE_FIRST); // Set the view to be first pane.

    6. In CChildFrame::OnCmdMsg(), don't call the view's OnCmdMsg. -------------- "Aagh!! I'm a victim of a Random Act of Management!"

    C / C++ / MFC question c++ sysadmin

  • Please help...
    U Ulf Ohlen

    Try appending an extra space to the first SQL string.

    dbcmd (dbproc_get1, "select contract from type ");

    -------------- "Aagh!! I'm a victim of a Random Act of Management!"

    C / C++ / MFC database sql-server sysadmin help

  • Out of the way!
    U Ulf Ohlen

    This is the transcript of an actual radio conversation between a U.S. naval ship and Canadian authorities off the coast of Newfoundland in October, 1995. Radio conversation released by the Chief of Naval Operations 10-10-95 Americans: Please divert your course 15 degrees to the North to avoid a collision. Canadians: Recommend you divert YOUR course 15 degrees to the South to avoid a collision. Americans: This is the captain of a U.S. Navy ship. I say again, divert YOUR course. Canadians: No. I say again, you divert YOUR course. Americans: THIS IS THE AIRCRAFT CARRIER U.S.S. LINCOLN, THE SECOND LARGEST SHIP IN THE UNITED STATES' ATLANTIC FLEET. WE ARE ACCOMPANIED BY THREE DESTROYERS, THREE CRUISERS AND NUMEROUS SUPPORT VESSELS. I DEMAND THAT YOU CHANGE YOUR COURSE 15 DEGREES NORTH, THAT'S ONE FIVE DEGREES NORTH, OR COUNTER MEASURES WILL BE TAKEN TO ENSURE THE SAFETY OF THIS SHIP. Canadians: This is a lighthouse. Your call. -------------- "Aagh!! I'm a victim of a Random Act of Management!"

    The Lounge lounge learning

  • Not Much to 'C' in C#
    U Ulf Ohlen

    Java (and now C#) designers seem to think that programmers are generally stupid people, and that they should not be allowed to make mistakes Humans are known to make mistakes. Even C++ gurus spend way too much time tracking down bugs that would have been avoided in a less complex language. This extra time has to be paid with actual money. Cutting error-prone features from a language has nothing to do with programmer's level of "stupidity". It just means that misstakes in C++ are more expensive than in, for example, C#. Not that I don't appreciate the power of C++. But it comes at a price, and it would be a fatal mistake to think that only newbies have to pay it. -------------- "Aagh!! I'm a victim of a Random Act of Management!"

    The Lounge csharp com beta-testing question announcement

  • Non-resizable window.
    U Ulf Ohlen

    I agree that apps look better with the thick border style. Catching WM_NCHITTEST is not 100% foolproof, though. It prevents the user from resizing the window, but Windows can still resize it (if the user, for example, clicks "Tile windows" from the task bar). Also, if the window has a status bar, it can be resized with the status bar's gripper. These problems can be solved by catching WM_GETMINMAXINFO and setting the window's min and max tracking sizes. -------------- "Aagh!! I'm a victim of a Random Act of Management!"

    C / C++ / MFC question

  • Non-resizable window.
    U Ulf Ohlen

    You need to remove a couple of window style flags from the main frame: WS_THICKFRAME and WS_MAXIMIZEBOX. The easiest way to do this in MFC is to override CWnd::PreCreateWindow().

    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    {
    if( !CFrameWnd::PreCreateWindow(cs) )
    return FALSE;
    cs.style &= ~(WS_THICKFRAME | WS_MAXIMIZEBOX);
    return TRUE;
    }

    -------------- "Aagh!! I'm a victim of a Random Act of Management!"

    C / C++ / MFC question

  • Read from the console window
    U Ulf Ohlen

    This sounds like a great subject for a CP article...:) -------------- "Aagh!! I'm a victim of a Random Act of Management!"

    C / C++ / MFC question help tutorial

  • Skins With MFC
    U Ulf Ohlen

    There are several articles about skins on CodeProject. Here's a few: http://www.codeproject.com/dialog/ezskin.asp http://www.codeproject.com/dialog/skinsyse.asp http://www.codeproject.com/dialog/skinstyle.asp -------------- "Aagh!! I'm a victim of a Random Act of Management!"

    The Lounge c++ question

  • HELP !!! HELP!!! HELP !!! my dsw file destroyed ! I cant open my project !!!!!!!! PLEASE URGENT !!!!
    U Ulf Ohlen

    Do you get "Out Of Memory" when you open the project file? Maybe you are just running too many apps at the same time...? Try to shut down VC and delete all auto-generated files in the project dir(after backing them up, of course;) ): dsw, clw, aps, ncb, opt, plg etc. Also delete all temporary files in the Release & Debug directories. Then open the dsp and recompile. This usually helps when VC starts acting strange... -------------- "Aagh!! I'm a victim of a Random Act of Management!"

    C / C++ / MFC help question

  • HELP !!! HELP!!! HELP !!! my dsw file destroyed ! I cant open my project !!!!!!!! PLEASE URGENT !!!!
    U Ulf Ohlen

    You don't need the dsw file to open a project. If you still have the dsp file (the actual project file), open that instead and a new dsw will automatically be generated. -------------- "Aagh!! I'm a victim of a Random Act of Management!"

    C / C++ / MFC help question

  • VB/VBA and C++ classes
    U Ulf Ohlen

    Sorry, but I don't think this is possible (there might be some obscure trick...). You should probably write a COM wrapper after all. -------------- "Fabricati Diem, Pvnk"

    Visual Basic c++ com tutorial

  • Beta 2 is out
    U Ulf Ohlen

    Sorry, it's just the .NET SDK -------------- "Fabricati Diem, Pvnk"

    The Lounge csharp beta-testing learning

  • Custom AppWizard
    U Ulf Ohlen

    I'm writing a custom AppWizard and have some problems customizing the projects that it generates. How do I add lib files to the linker settings? I guess I should override CCustomAppWiz::CustomizeProject() and manipulate the IBuildProject* parameter, but I can't find a good explanation on how to do this. Any ideas? -------------- "Fabricati Diem, Pvnk"

    C / C++ / MFC question 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