Skip to content

C / C++ / MFC

C, Visual C++ and MFC discussions

This category can be followed from the open social web via the handle c-c-mfc@forum.codeproject.com

111.5k Topics 465.7k Posts
  • Mulriple views

    question
    2
    0 Votes
    2 Posts
    0 Views
    L
    yes. There is a sample in MSDN fot single-doc-multi-view. Sorry I forgot the name. You have to handle the switch/flag by yourself. HTH, Wenfei Wu
  • Copy Constructor and member pointers - Beginner Q.

    tutorial lounge learning
    3
    0 Votes
    3 Posts
    0 Views
    M
    thx.
  • executing some other exe

    c++ tutorial question
    3
    0 Votes
    3 Posts
    1 Views
    M
    Hi, you can do so by launching a process (with ::CreateProcess) and waiting until it's finished (with ::WaitForSingleObject). Here is how it could look like. This code is raw, add checks on return values and errorhandling. STARTUPINFO startupi; PROCESS_INFORMATION processi; ::CreateProcess(NULL, _T("C:\myexe.exe"), NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &startupi, &processi); ::WaitForSingleObject(processi.hProcess, INFINITE); Check for the retval of the CreateProcess() function! Hope that helps!
  • PAL format

    question
    2
    0 Votes
    2 Posts
    0 Views
    S
    I do not know anything about this but I found on WEB The Dr. Halo Palette (PAL) file header has the following content (40 bytes): struct Hpal { BYTE ID[2]; Should be AH int version, size; char filetype, subtype; WORD brdid, grmode; int maxindex, maxred, maxgreen, maxblue; Colors = maxindex + 1 char signature[8], filler[12]; "Dr. Halo", 12 0's } ; The palette data is integer triples (R, G, B) for each color in the palette. The palette file data (including the header) is in 512 byte blocks. If there is not a full integer triple at the end of a block, the data should be ignored and the next block started.
  • CDocument & CDialog

    question help
    2
    0 Votes
    2 Posts
    0 Views
    B
    1. In MyDlg.h add #include "MyDoc.h" 2. Add a member variable to you dialog class CMyDoc* m_pDoc; 3. In the function that creates the dialog - after the dialog is create but before DoModal() - add dlg.m_pDoc = (CMyDoc*)GetDocument();
  • Scroll Bars

    graphics help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Viewing AVI File As Splash Screen

    json question
    2
    0 Votes
    2 Posts
    0 Views
    U
    Check out my animation control at http://www.codeguru.com/multimedia/AviCtrl.shtml (I really should post this here some day...) HTH, Jens
  • 0 Votes
    3 Posts
    0 Views
    R
    Paul, Thanks for your response. However, I had initially tried that approach and the problem is that the OnFileNew method gets called when the application is initially created. I only want the dialog to appear when the user selects the File New item from the app's Menu. My theory (I've set this issue aside temporarily) is that I need to change the ID for the menu item. Then when the user selects the menu item, I call the base class FileNew member to allow the MFC architecture to create the document, aftewords I present the user with some dialogs that intialize the newly created document.
  • High speed animation and tearing

    question performance help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • DIBSection Use

    graphics question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Add on in IE 4 & 5.x

    2
    0 Votes
    2 Posts
    0 Views
    E
    This is very simple. You have to create a Deskband but register it under the toolbar section. I am working on an article and a ATL object wizard to do just this. I have samples but nothing that is in a releasable state. There is information on MSDN for creating Deskbands, search for IDeskBand, it has a hello world type sample, really lame. I am hoping by end of week I will have my information posted. If you have specific questions let me know. I have posted a ATL Object wizard to create deskbands. It's a starting point without having to understand alot of the documentation of IDeskBand. http://www.codeproject.com/useritems/RBDeskBand.asp -Erik
  • ListCtrl with multiline entries

    question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • How to change background color of the "Group Box"?

    question tutorial
    5
    0 Votes
    5 Posts
    0 Views
    U
    Sorry about that... it was just hanging... so I hit submit again...
  • Toolbar in a DialogBar

    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • SYSTEM TRAY

    linux
    2
    0 Votes
    2 Posts
    0 Views
    C
    Check out my class at www.codeproject.com/shell/systemtray.asp.
  • make highlight cover entire length of all columns in CListCtrl

    4
    0 Votes
    4 Posts
    1 Views
    E
    You need to call SetExtendedStyle with the LVS_EX_FULLROWSELECT after the window has been created. A good place to do this may be when you add the columns to the list control object. It requires Version 4.70 of common controls dll which is available with IE3+. Hope it helps.
  • how do yo uhandle files being dropped on controls

    2
    0 Votes
    2 Posts
    0 Views
    S
    Did you notice "Search" on the home page? :) You need to subclass the control and handle WM_DROPFILES. See http://www.codeproject.com/listctrl/filedroplistctrl.asp for how...
  • Running a console program

    c++ question visual-studio mcp
    2
    0 Votes
    2 Posts
    0 Views
    P
    Hello, This is the trick. VC++ does not directly run your application. Instead it hands it over to another console application vcspawn.exe in the VC++ bin directory. This executes your program as a process and wait till it completes and then prints "Press any key to continue". It then immediately sets itself to receive an input from the user and any key pressed is enough to get it to the end of its main(). To simply emulate this, at the end of your main(), do something similar to int main() { .....// your main code ends here // End of main processing cout<<"Press any key to continue..."<
  • Bitmap in a MDI

    graphics question
    3
    0 Votes
    3 Posts
    0 Views
    P
    Hello, My codes at the following does this and more!!! http://www.codeproject.com/docview/mditab.asp Regards, Paul.
  • GIF files/images - where can I get some source code samples?

    help question
    2
    0 Votes
    2 Posts
    0 Views
    P
    Hmmmmm! Do you really know about the licensing issue involved in using GIF in an application? Please forget this and try animated icons, or take control and do a complete bitmap selection/rotation yourself, see MS debugger sample DEB for illustration. Regards, Paul.