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
C

Christopher W Smith

@Christopher W Smith
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • My Sql Connectiom
    C Christopher W Smith

    I am not overly familiar with ODBC but I have had to write applications that need to communicate with a database. Check out the MySQL C API http://dev.mysql.com/doc/refman/5.0/en/c.html[^] the C++ wrapper for the MySQL C API http://tangentsoft.net/mysql++/[^] Also if you are communicating with a web server database consider writing a server side web script to handle database queries and communicate with it with. URLDownloadToCacheFile http://msdn.microsoft.com/en-us/library/ms775122(VS.85).aspx[^] This might or might not be reasonable depending on what you are trying to accomplish, but it is probably the quickest and easiest way to get the job done for basic web database queries.

    Chris Smith

    C / C++ / MFC c++ database mysql question

  • Question about some code that should crash but does not (release vs. debug & VS2003 vs. VS2008)
    C Christopher W Smith

    I think you are assuming that a struct in C++ works the same way as a struct in plain old C, but alas it doesn't... well not really anyway. When you introduce non-primitive data types into structs in C++ they cease to be simple "data structures" and become basically the same as classes only their members default to public instead of private. My guess is when you try to overwrite the object you are writing over the beginning of its virtual table which probably contains extra debug information in debug mode. In release mode you are then probably overwriting more important class data. Remember, the sizeof operator is not designed to get the size of an object or its virtual table. http://en.wikipedia.org/wiki/Virtual_method_table[^]

    Chris Smith

    C / C++ / MFC question visual-studio graphics debugging announcement

  • UnClickable window... Clicks thru
    C Christopher W Smith

    What do you mean by "the window under it"? Do you mean in the z-order, or perhaps the window that created the current window??? "the window under it" could be any window. Whichever window you mean, it's pretty easy to notify another window of an event in the current window. First add a WM_LBUTTONDOWN handler to both windows. (http://msdn.microsoft.com/en-us/library/ms645607(VS.85).aspx[^]) in the window class header files under DECLARE_MESSAGE_MAP()

    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);

    in the window class source file for the window being clicked:

    ...
    //pass the message on to another window...
    void CMyWnd::OnLButtonDown(UINT nFlags, CPoint point)
    {
    m_NotifyWnd.SendMessage(WM_LBUTTONDOWN);
    }
    ...
    //under BEGIN_MESSAGE_MAP
    ON_WM_LBUTTONDOWN()
    ...

    where m_NotifyWnd is whatever window you want to notify of the click. Also remember to add the message map for the window receiving the notification. I did not preserve wparam and lparam across the SendMessage call, you will probably want to read up on the message (link above) and finish the code with the wparam and lparam arguments. Insofar as finding the correct window to notify, I direct you to the following CWnd member functions to check out (since I'm not quite sure what you're looking for): CWnd::GetParent[^] CWnd::GetOwner[^] CWnd::GetParentOwner[^] Additionally you can create a member of your class to store a pointer or reference to some other window to notify. Hope that helps :)

    Chris Smith

    C / C++ / MFC question
  • Login

  • Don't have an account? Register

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