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
  • 0 Votes
    2 Posts
    1 Views
    K
    The WM_CTLCOLORLISTBOX message is sent to the parent window of a list box before the system draws the list box. WM_CTCOLOREDIT too. By responding to this message, the parent window can set the text and background colors of the list box by using the given display device context handle. WM_CTLCOLORLISTBOX hdcLB = (HDC) wParam;// handle to list box display context hwndLB = (HWND) lParam; // handle to list box This is for 32 bit only for 16 you have just WM_CTLCOLOR and then need to switch on the WPARAM
  • Controls

    tutorial
    2
    0 Votes
    2 Posts
    0 Views
    M
    Check out this article of mine: http://www.codeproject.com/listctrl/lvcustomdraw.asp
  • LPCOLESTR?

    question tutorial
    3
    0 Votes
    3 Posts
    0 Views
    D
    Hi, Use AnsiToUnicode( ) & UnicodeToAnsi() here are two examples OPENFILENAME ofn; LPOLESTR pszFileNameW; LPMONIKER pmk; .. ...... // Get file name from OpenFile Common Dialog. The ANSI file name will // be placed in ofn.lpstrFile GetOpenFileName(&ofn); .. ...... AnsiToUnicode(ofn.lpstrFile, &pszFileNameW); CreateFileMoniker(pszFileNameW, &pmk); CoTaskMemFree(pszFileNameW); .. ...... COleInPlaceFrame::SetStatusText(LPCOLESTR pszStatusTextW) { LPSTR pszStatusTextA; UnicodeToAnsi(pszStatusTextW, &pszStatusTextA); SetWindowText(m_hwndStatus, pszStatusTextA); CoTaskMemFree(pszStatusTextA); } See Also OLE2CT() Hope That will help Ghazi
  • 0 Votes
    2 Posts
    0 Views
    U
    Well it depends on what you want to put in the variant... but first you would do something like this... VARIANT v1,v2; VariantInit(&v1); VariantInit(&v2); then depending on what you are putting in there you have to fill in the vt... v1.vt = VT_BSTR; // for a bstr v1.vt = VT_I2; // for an int v1.vt = VT_I4; // for a long etc... then you would call your method yourobj->yourmethod(&v1,&v2);
  • Removing caption bar in toolbar

    2
    0 Votes
    2 Posts
    0 Views
    C
    When the toolbar is floating there are in fact 3 (three!) windows on top of each other. The first one is a CMiniDockFrameWnd, the second one is a CDockBar, and finaly there is the CToolBar. So you cannot change the style of the miniframe by calling ModifyStyle for the toolbar. In fact, it is also very complicated to remove the miniframe's caption. If you really need this, in my article "CSizingControlBar..." in the Docking Windows section here, you will find how to do it, but be warned: this is a side feature in that library, and I didn't documented it.
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • Is there any way of printing a pdf file?

    c++ adobe question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Selecting contents of Edit Box

    question
    2
    0 Votes
    2 Posts
    1 Views
    A
    Why? By default contents of edit boxes are selected (highlighted) when first focused (try tab through the edit boxes and you will see). The problem is the mouse click actually unselects it and set the cursor to where the mouse pointer is. So if you want, you may handle the WM_LBUTTONDOWN message and skip the first occurence of this message after the editbox is initially focused. But in general you should have a better solution to simplify the user interaction, rather than just a "one click select" versus "double click focus". Think smarter from a user perspective, not from a programmer perspective!
  • Test Only -Pls Ignore

    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Band Registration from WEB

    javascript
    2
    0 Votes
    2 Posts
    0 Views
    E
    You can use the VB installer or Install shield to make a package for the web. the cab will build in the registration INF which will download and install the file. -Erik
  • Audio CD Problem on Windows 2000.

    com help question
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • MCI & Audio CD

    question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Application like Microsoft money

    tools help tutorial question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Turn off code commenting in MS-VS 6?

    visual-studio question
    4
    0 Votes
    4 Posts
    0 Views
    C
    Aren't the code comments an option when starting a project? If so, there must be a setting in one of the project files that you could fix...
  • DirectSound & Certain WAV Files

    question learning c++ graphics game-dev
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • how to make C$ "visible"

    sysadmin help tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Bitmap

    graphics
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Adding MFC to ATL

    c++ com debugging help question
    4
    0 Votes
    4 Posts
    1 Views
    M
    I bet you're doing your CTreeCtrl stuff in an exported function or COM method, right? You need to add this line at the very beginning of the function/method: AFX_MANAGE_STATE(AfxGetStaticModuleState()); This sets up some internal data structures so all the MFC code knows where to find resources and other stuff.
  • "Realtime" Displaying of HTML in CWebBrowser2

    html help question
    3
    0 Votes
    3 Posts
    0 Views
    J
    Thanks I'll try just that....
  • Band

    5
    0 Votes
    5 Posts
    0 Views
    B
    I don't know either of them ! But maybe they are BHO's (Browser Helper Objects)