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
L

Laffis

@Laffis
About
Posts
42
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • brain teaser...
    L Laffis

    Hmmmm, pretty good! mate...Beer beer...

    C / C++ / MFC question

  • brain teaser...
    L Laffis

    :-D I am sure this will catch someone out there, me included. The end result will be machine specific, ie. undefined. I guess it is because different machine will prioritise ++ and << in different manner.

    C / C++ / MFC question

  • brain teaser...
    L Laffis

    The following code: int i = 0; cout << i++ << i; why does it output 00?

    C / C++ / MFC question

  • Unix/Linux vs. Windows??
    L Laffis

    Hmmm, I personally enjoy doing development work on Windows as it is user friendly. But possibly in the very near future I will have to choose to work on either Unix/Linux or on Windows. To keep sharp in the competition, it's best to keep one set of skills polished at all time, that's my opinion personally. Some people may not agree. I just dont think it is that easy to switch back to Windows/Unix after quite a few years working on the other, at least the employer who does the hiring thinks this way. Do you agree? :^) So,,,windows,,,unix,,,:doh:I dont want to spent next 5~6 years on Unix then find out I am trapped in an isolated ever-shrinking island where across the sea is the vast landscape of windows' world,,, I am just nagging myself here. This has nothing to do with C++/VC theme,,,

    C / C++ / MFC visual-studio linux question

  • Unix/Linux vs. Windows??
    L Laffis

    Is Unix/Linux losing battle ground to Windows???

    C / C++ / MFC visual-studio linux question

  • Help hooking Windows API functions
    L Laffis

    Not familiar with the terminology you use: what do you mean by hook? R u talking about linking (either dynamically or statically) dll?

    C / C++ / MFC help c++ json question

  • How to initialize _TCHAR array
    L Laffis

    "" tells the compilter it is a non-unicode string. You should be using _T("Sunday"), or L"Sunday" if you are sure the application will be using unicode for certain.

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

  • how to minimize window on app startup
    L Laffis

    Hi, does anyone know how to make your c++ application minized on startup?

    C / C++ / MFC c++ tutorial question

  • Need a simple way to change Back Color of CEdit &amp; CStatic controls
    L Laffis

    Use that message and handle it, amin, it is very easy. Do a search on the web you will get an example in msdn. I just spent 5 min doing that and get a test case working. As to the number thing, you should be able to config the edit ctrl to accept number only. In the code, you may be able to use something like this: DDV_MinMaxLong(...) <-- check reference how to use it. It's been a while since I last use them. What u will get is if user inputs an invalid entry, a messagebox will come up telling him so. You do not even need to change the CEdit color to let him know.

    C / C++ / MFC com help question

  • Need a simple way to change Back Color of CEdit &amp; CStatic controls
    L Laffis

    Cool! Learn something new everyday! I suppose this is faster (performance wise) than use a derived class from CEdit etc and doing DrawItem ect. And much simpler.

    C / C++ / MFC com help question

  • ::LoadBitmap
    L Laffis

    I tried to ::AfxGetInstanceHandle() and passed it replace 0 with the instance handle. Bitmap still gets no-shown. cedric moonen wrote: What did you change EXACTLY at this line of code (post what was shown on the MSDN website). I played about the static ctrl the bitmap is supposed to attach to. I may have modified style, and later create a derived class off CStatic, that's about it. The CStaticX class does nothing special inside apart from the code generated by Wizzard.

    C / C++ / MFC graphics help question

  • ::LoadBitmap
    L Laffis

    The code is from Msdn website. I just mangaged to get it work: BOOL CMFCPlayingPenDlg::OnInitDialog() { CDialog::OnInitDialog(); ..... DWORD dwStyle = WS_CHILD|WS_VISIBLE|SS_BITMAP|SS_CENTERIMAGE; m_staticX.ModifyStyleEx(0, dwStyle); HBITMAP hBmp = ::LoadBitmap(0, MAKEINTRESOURCE (IDB_BITMAP1)); m_staticX.SetBitmap(hBmp); } The strange thing is that I did not change much but this time bitmap was loaded. However, the bitmap does not appear on my static ctrl...:doh:

    C / C++ / MFC graphics help question

  • ::LoadBitmap
    L Laffis

    Do you people ever come across problem that this does not work? HBITMAP hBmp = ::LoadBitmap(NULL, MAKEINTRESOURCE(IDB_BITMAP2)); I got 0 returned by the above func. Why? I am always in a bit of struggle with bitmap as I have not done much with it. Anyone can shed some light? My bitmap is created in dev studio.

    C / C++ / MFC graphics help question

  • initialize stl map in static scope
    L Laffis

    I agree with moonen. Everyone looks daft in a new area in experts eyes. The solution to the problem is to init the map in a constructor: class CMy { public: CMy(); private: static std::map mymap; static CMy *p; }; CMy* CMy::p = 0; CMy::CMy() { mymap[1] = 1; }

    C / C++ / MFC c++ help question

  • Multithreading Oddness
    L Laffis

    Main process and the worker thread are both threads. You call Sleep in the w-thread, it will be suspended there sleepting, and not able to receive and new message. I assume your w-thread does task when told, i.e. when getting a message to trigger execution of certain functions. If your w-thread cannot receive message, no wonder your func does not get called, let alone hit your critical section.

    C / C++ / MFC question

  • Multithreading Oddness
    L Laffis

    what do u mean by sleep. You called Sleep()? That freezes the thread! You should never use that func if you want the thread to be able to process something else at the same time!

    C / C++ / MFC question

  • Tray Icon Menu Command handling in MFC
    L Laffis

    Try AfxPostQuitMessage(0) before you call DestroyWindow. You may even not need to call the latter. And I recommend you to call CDialog::onClose/OnOK instead of DestroyWindow (if u debug into it, you see the framework does more work just destrywindow). If you use SDI/MDI, try to use the mainframe to intercept the exit message, and after u tidy up things, call the baseclass onclose().

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

  • Tray Icon Menu Command handling in MFC
    L Laffis

    Try AfxPostQuitMessage(0) before you call DestroyWindow. You may even not need to call the latter.

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

  • Edit Box, not able to read
    L Laffis

    Did you check the edit box 'read-only' setting? Did you check the DDX_Control has its entry? Did you call UpdateData(FALSE) at the wrong time?

    C / C++ / MFC tutorial

  • conflict in windows focus - float menu involved
    L Laffis

    I guess you mean SetCapture. Does it work for you? It does not for me...

    C / C++ / MFC help question announcement
  • Login

  • Don't have an account? Register

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