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
J

Justin Tay

@Justin Tay
About
Posts
291
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Creating a Bitmap from a Framegrabber Image
    J Justin Tay

    Hi,

    RGBQUAD *pColors = pbmi->bmiColors;
    for(int i = 0; i < 256; i++)
    {
    pColors->rgbBlue = i;
    pColors->rgbGreen = i;
    pColors->rgbRed = i;
    pColors->rgbReserved = 0;
    pColors++;
    }

    The code snippet above is setting the color table. In your previous question, you wanted it grayscale so the color table so I set it up as such. If you want it to be color you need to setup the appropriate color table that your 8-bit data maps to. Regards, Justin Tay

    C / C++ / MFC help graphics data-structures tutorial

  • Printing Bitmaps from a Frame Grabber (Re-post of earlier question)
    J Justin Tay

    Did you use CreateDIBitmap[^] to get a HBITMAP? How exactly are you passing your bitmap to the printer?

    C / C++ / MFC c++ csharp visual-studio graphics help

  • copy data from two buffer into one
    J Justin Tay

    venadder wrote:

    //return the input pointer to original value buff -= sizeof( int );

    You're not returning anything. A pointer is not a reference. A pointer could be used as a reference, in which case you'd need a double pointer to modify buff so the calling function can see a change. Anyway what you are attempting to do is pointless as you are trying to preseve the original value, but the original value passed in by the calling function can't be changed in your function, you are only operating on a stack copy of the pointer value.

    memcpy(buffer, &someint, sizeof(int));
    memcpy(((LPBYTE) buffer) + sizeof(int), myData, myDataSize);

    C / C++ / MFC help question

  • Met problems with my first win32 program
    J Justin Tay

    Go to your project's properties. Configuration Properties > Linker > System > SubSystem Change from Console to Windows.

    C / C++ / MFC debugging help tutorial question

  • GDI+ Bitmap Class new operator.
    J Justin Tay

    That's because GdiPlus has it's own overloaded new operator but doesn't have one for the DEBUG_NEW macro. http://support.microsoft.com/kb/317799/EN-US/[^]

    C / C++ / MFC graphics c++ winforms help question

  • owner draw CReBarCtrl [modified]
    J Justin Tay

    You meant custom drawn rebar correct? Your rebar message map should look like this BEGIN_MSG_MAP(CMyReBarCtrl)   CHAIN_MSG_MAP_ALT(CCustomDraw<CMyReBarCtrl>, 1)   DEFAULT_REFLECTION_HANDLER() END_MSG_MAP() Make sure you have REFLECT_NOTIFICATIONS() in your CMainFrame message map.

    ATL / WTL / STL help question c++

  • unicode strings
    J Justin Tay

    L"" is not a macro, it's simply a means of indicating a unicode string literal. ie. whatever is within it has to be a valid unicode string. If you're specifying a MBCS string literal then it's within your unicode build that you have to do the conversion from MBCS (specifying the codepage the string is in) to unicode. You should also consider what happens if for the MBCS build, the user is not running with the codepage that the MBCS string is in. (MBCS strings are all codepage specific). So what happens then? Converting your MBCS string to unicode and then back to the user's current codepage would probably fail (being unable to do the mappings), and using that MBCS string ignoring the user's current codepage is very wrong and might represent invalid file path characters on that user's codepage. If you are using VC7 and up, you should use the new ATL conversion classes[^]instead though there are some differences.

    C / C++ / MFC help question

  • SHFileOperation is pissing me off - won't copy just 1 file
    J Justin Tay

    Then I guess that your only alternative is to set pTo to d:\jpg\pic1.jpg

    C / C++ / MFC help tutorial question

  • Enter Key killing my dialog [modified]
    J Justin Tay

    Do you manually set focus using SetFocus() instead of WM_NEXTDLGCTL? Is the button a standard button that is returning DLGC_BUTTON in response to WM_GETDLGCODE?

    C / C++ / MFC c++ com question

  • Problem with ClearType text in custom control
    J Justin Tay

    Is the bitmap that is selected in the memory dc a bitmap that is compatible with the screen? Or did you just select the bitmap that you created/loaded into the memory dc and try to draw the text that way? Some sample code would help since I don't have any problem drawing cleartype enabled text on my doublebuffered controls.

    C / C++ / MFC question graphics help json performance

  • SHFileOperation is pissing me off - won't copy just 1 file
    J Justin Tay

    Have you tried sticking a '\' at the back of pTo? eg. pTo = d:\jpg\.

    C / C++ / MFC help tutorial question

  • the : operator
    J Justin Tay

    In this case, probably just convenience. But lets say you have a member that is a class object that doesn't have a default constructor.

    C / C++ / MFC help

  • Default edit/richeditctrl text selection allows easy delete after tab key to control.
    J Justin Tay

    lctrncs wrote:

    I got compiler errors unless I included the LRESULT*pResult argument for the first one.

    That can't be right. What are the compile errors? Having a return value when there isn't supposed to be one would put your stack out of whack. I don't have VC6 (I use VS2003) so the classwizard is fine. I created a simple MFC dialog app, added a Edit and RichEdit control and have focus handlers for both and I can't duplicate this behaviour.

    C / C++ / MFC c++ debugging help question announcement

  • Default edit/richeditctrl text selection allows easy delete after tab key to control.
    J Justin Tay

    The handler should look like void OnSetfocusRichedit1(); instead of void OnSetfocusRichedit1(NMHDR* pNMHDR, LRESULT* pResult); Is the first handler what you have?

    C / C++ / MFC c++ debugging help question announcement

  • NT Security
    J Justin Tay

    Raymond blogged about this just last week. http://blogs.msdn.com/oldnewthing/archive/2006/08/18/705957.aspx[^]

    C / C++ / MFC security

  • Default edit/richeditctrl text selection allows easy delete after tab key to control.
    J Justin Tay

    lctrncs wrote:

    when the user tabs to either edit control, existing text in the control is selected

    This is the default behaviour of the dialog manager. If this is undesirable you should tell the dialog manager, by subclassing the edit control and handling WM_GETDLGCODE[^] to not return the DLGC_HASSETSEL flag (call the base class procedure and mask it out ie. & ~DLGC_HASSETSEL).

    lctrncs wrote:

    using EN_SETFOCUS (after changing the on_notify to on_en_setfocus in the message map),

    How did you go about doing this? Using the IDE or manual edits to the message map? EN_SETFOCUS is sent through a WM_COMMAND message, and not a WM_NOTIFY message. The member function signature for both are different. Not sure if this is the problem though as I think the compiler should complain if you made a mistake. Edit: Link regarding WM_GETDLGCODE http://blogs.msdn.com/oldnewthing/archive/2003/11/14/55678.aspx[^] -- modified at 15:19 Thursday 24th August, 2006

    C / C++ / MFC c++ debugging help question announcement

  • Bitmap transparency at picture_control [modified]
    J Justin Tay

    Actually, the easiest possible way of doing this is probably by just using an ImageList to draw your bitmap, specifying a mask color.

    C / C++ / MFC visual-studio csharp graphics question

  • Promblem with Dynamic Control Event Handling.
    J Justin Tay

    uday kiran janaswamy wrote:

    The Events handled for the Edit Box are. EN_CHANGE,EN_ERRORSPACE,EN_HSCROLL,EN_KILLFOCUS,EN_MAXTEXT,EN_SETFOCUS,EN_UPDATE.

    These aren't events handled by the edit control. These are notifications posted by the edit control to it's parent. In that case you can use WM_PARENTNOTIFY[^]. Or if your only interested in a right-click there is NM_RCLICK[^] notifications.

    C / C++ / MFC json help

  • Problem with list controll [modified]
    J Justin Tay

    Another solution would be to use customdraw.

    C / C++ / MFC css help

  • How can I capture frames with directshow ?
    J Justin Tay

    Use the SampleGrabber filter. I prefer the one that comes with the SDK since the source code is provided.

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