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

Jeff Archer

@Jeff Archer
About
Posts
17
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Compare/Convert Float to Text
    J Jeff Archer

    Here is a very good article on comparing floats. This method is much better than converting to text for the comparison. http://www.cygnus-software.com/papers/comparingfloats/Comparing%20floating%20point%20numbers.htm[^]

    C / C++ / MFC tutorial

  • Using COM Object Invalid Pointer Error
    J Jeff Archer

    If the return from this is 0x80040152 it is not being found in the registry.   I suggest try the class id just as the next step of investigation.   This HRESULT is either the client not registered correctly or using the incorrect ProdID.

    C / C++ / MFC com help

  • Question about double #INF and #NAN
    J Jeff Archer

    Sorry, I guess I didn't present that very well. NAN is an exponent of 0x7FF with a non-zero mantissa. INF is an exponent of 0x7FF with a zero mantissa. Here are the actual fuctions I am using... bool IsInf (double d) {       const INT64 iInf = 0x7FF0000000000000;       if ((*(INT64*)&d & 0x7FFFFFFFFFFFFFFF) == iInf)             return true;       return false; } bool IsNan (double d) {       INT64 exp = *(INT64*)&d & 0x7FF0000000000000;       INT64 mantissa = *(INT64*)&d & 0x000FFFFFFFFFFFFF;       if (exp == 0x7FF0000000000000 && mantissa != 0)             return true;       return false; }

    modified on Friday, November 27, 2009 3:04 PM

    C / C++ / MFC question

  • Question about double #INF and #NAN
    J Jeff Archer

    Thanks. I was hoping to find such a table for double.   Really, just a supporting documentation.   I believe the values in my original question were correct.

    C / C++ / MFC question

  • Question about double #INF and #NAN
    J Jeff Archer

    The values in my original question are correct. (I believe) Just looking for supporting documentation. Thanks again for the time and thought you have put into this.

    C / C++ / MFC question

  • Question about double #INF and #NAN
    J Jeff Archer

    Yes, and thanks.   But I'm still kind of looking for a nice table like they have for the 32 floats.   Don't want to make the table myself because I'm not the expert.   Just want to be able to refer to the expert.

    C / C++ / MFC question

  • Using COM Object Invalid Pointer Error
    J Jeff Archer

    The HRESULT you have indicated is 0x80040152 - Could not find the key in the registry Sounds like the COM object you are trying to use is not correctly installed or you are not using the correct ProgID. Try using a CLASSID for your CreateInstance.

    C / C++ / MFC com help

  • Question about double #INF and #NAN
    J Jeff Archer

    Does anyone understand the bit-wise representations of #INF and #NAN for the type double?   Or could you point me to some real information on the internet? Also, what is the difference between Quiet NAN and Signaling NAN? I have been trying to find it with google all morning and I have found a lot of claiming to know but no actual knowledge. I know that for type float the bits are: 0x7FFFFFFF; // #NAN 0x7F800000; // #INF I believe that for type double the bits would: 0x7FFFFFFFFFFFFFFF; // #NAN 0x7FF0000000000000; // #INF However, this is just changing the exponent from 8 to 10 bits and assuming that if would be the same.   I would feel much better if I could find some supporting documentation.

    C / C++ / MFC question

  • TIming
    J Jeff Archer

    It's really not that complicated once you have done it a couple of times. The do while loop that you are using is extremely wasteful in terms of CPU utilization. The proper way to block a thread is with WaitForMultipleObjects. Also, you should never block the main thread of your application. The best solution would really be to use a background thread to draw on a BITMAP and use use BitBlt to transfer the image to the screen every 333 ms. As a side note the values returned by GetTickCount are really only accurate to 15.2 ms so using it to time 33 ms isn't going to work well on a loaded machine. The advantage of the multimedia timer is that you can truely have 1 ms accuracy. And by using a background thread and proper thread synchronization your code will scale properly on faster and multi core machines and still work correcly on a slower or heavly loaded machine.

    C / C++ / MFC c++ question

  • TIming
    J Jeff Archer

    Use the MultiMedia timer with a callback function. It is the most accurate timing you can have in Windows. Lookup the following in the VC++ help: TIMECAPS timeGetDevCaps timeBeginPeriod timeSetEvent

    C / C++ / MFC c++ question

  • MFC Menu Expansion [modified]
    J Jeff Archer

    Personalized Menu Behavior

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

  • MFC Menu Expansion [modified]
    J Jeff Archer

    Thanks. Really though I know this is a stupid question or maybe its just me but I haven't been able to find it in the help because I can't think what the feature is called to be able to search for it in the MFC docs or code. When I google "Menu Expansion" I get 7500 hits that all seem to have to do with web development, java, of C#.

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

  • How to extract variables from between html tags?
    J Jeff Archer

    In this message board the correct assumption is native C/C++. There are seperate message boards for .net, C#, and managed C++. So the best answer is MSXML and there are plenty of examples available by googling MSXML Examples.

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

  • How to extract variables from between html tags?
    J Jeff Archer

    Have you checked out MSXML? It will parse the xml and let you deal with through an object model.

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

  • MFC Menu Expansion [modified]
    J Jeff Archer

    What controls the hovering expansion of MFC menus? Or what controls which choices are shown before hovering on the little arrow to expand the rest of the menu? A. The feature is called Personalized Menu Behavior. The wizard code for it is in CMainFrame::OnCreate()

    modified on Friday, October 9, 2009 6:48 PM

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

  • WaitForSingleObject(m_SomeThread->m_hThread, INFINITE);
    J Jeff Archer

    When the user clicks in the dialog too soon and you do WaitForSingleObject you are blocking the GUI thread of the dialog. i.e. it hangs. Never block your GUI thread. Instead use a message box to inform user that he has clicked too soon and then simply return from the OnClick handler. Also, use an hour glass cursor while the background thread is running to inform user that clicking isn't going to work. You could disable some or all of the controls on the dialog just before kicking off the background thread to prevent the user from doing anything while the thread runs. Then enable them once the thread is complete and it is safe to click again. Also consider that you can't allow the dialog to close while the background thread is running.

    C / C++ / MFC question c++

  • How to put MFC View full screen on second monitor?
    J Jeff Archer

    Could someone give me a hint on how I could show one view full screen on a second monitor while the app with all the navigation pane, toolbars, menus, etc. stays on the main monitor? Ideally, this would just be a second view opened for the current document that can escape the apps frame and go over to the other monitor and make itself full screen. I've considered just using a second app with sockets for communications between the two apps. I've considered using a secondary GUI thread with a CWnd derived object that is sort of operating outside of MFC's doc/view architecture.

    C / C++ / MFC c++ architecture tutorial 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