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
K

Kwanalouie

@Kwanalouie
About
Posts
58
Topics
34
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • newbie C question
    K Kwanalouie

    You can get into trouble checking the equality of floating point numbers. As a decimal example, if you did an operation such as adding 1 + 1. x = 1.0 + 1.0; the internal respresentation might end up being x = 1.999999999999999999999999999999999 instead of 2.0000000000000000000000000000 if you then checked if (x == 2.0) that would be false instead of true.

    C / C++ / MFC question

  • Help update window display
    K Kwanalouie

    Using Visual C++ 6.0 MFC in SDI application I have a window that displays a drawing and also displays a modeless dialog window. When a user clicks on a button in the modeless dialog, I want to display a different drawing along with the modeless dialog window again. But I don't understand how to update the drawing immediately. I have a routine that gets called when the user clicks on the button, but if I simply use Invalidate(0), or UpdateWindow(), the new drawing isn't displayed until I do something on the drawing. So I'm assuming that the Invalidate(0) or UpdateWindow() are updating the modeless dialog window and not my drawing window. But I don't understand how to tell it to update my drawing window. Thanks!

    C / C++ / MFC c++ graphics help tutorial announcement

  • Random number generator
    K Kwanalouie

    I would like to understand how random number generators used in various compilers/websites vary. I would like to do some random number tests on my home PC using Visual C++ 6.0 to simulate results that other web based random number generators might produce or that other compilers might produce. For example, suppose I go to a poker website which generates "random" card sequences. I would like to use that same random number generator scheme to run simulations on my PC - how would I go about matching random number generators to do this. I'm guessing there can't be that many different random number generators in use Thanks!

    Algorithms c++ tutorial lounge

  • Modeless Dialog Window placement problem
    K Kwanalouie

    Using Visual C++ 6.0 MFC in SDI application I have a modeless dialog box that I display on the left side of the screen, and my program does some drawing to the right of that dialog box. A friend ran my program on his PC setup. His setup has a dual monitor setup, where he can scroll horizontally from one monitor to the other. When he runs my code, the main window shows up on one monitor screen and the modeless dialog appears on the other monitor screen. He has to drag the modeless dialog box to the screen where we do the drawing. We would like them to appear on the same screen without having to drag the modeless dialog box to the other screen. I don't know if there is something I am doing wrong in the code or whether his dual monitor setup has a problem. The code I use to place the modeless dialog box is: BOOL CTestDialogBox::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here SetWindowPos(NULL,10,100,0,0,SWP_NOSIZE | SWP_NOZORDER); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } Thanks for any help!

    C / C++ / MFC c++ help graphics workspace

  • Reading the display fron other programs
    K Kwanalouie

    on my pc there is no file called MSHTML.h Where does not get this? I'm using Visual C++ 6.0. What do I need to upgrade to? Thanks

    Rahul Vaishnav wrote:

    You can use interfaces in MSHTML.h Find the window handle of your browser. and then by using below interfaces you can get whole HTML of the web page which is open. IHTMLDocument2 IHTMLWindow2 IHTMLElementCollection IID_IHTMLDocument2 IHTMLElement etc..

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

  • Reading the display fron other programs
    K Kwanalouie

    Using Visual C++ MFC in SDI application I would like to read what other programs have displayed on my monitor screen. For example, if I have a webpage displayed by a browser, is there some way I can read from my C++ program what is shown on that browser's window? Thanks ahead of time

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

  • bizarre problem with files
    K Kwanalouie

    One problem your code has is in the method you are opening the files with fopen. There are two modes for reading and writing to files - binary mode and text mode. Some character conversions change in those two modes. When you open file1 and file2 you do not specify what mode to use, so the default mode is used. When you open m_sFileName you tell it to open it to read in binary mode instead of text mode. Try changing the "w" to "wt" in this statement of yours FILE *file1 = fopen("file1.txt","w"); And more importantly change the "rb" to "rt" since you are trying to read characters in the following statement in your code fp=fopen(m_sFileName,"rb"); //Open file for reading The ftell and fseek functions may not give the correct lengths if the file is opened in text mode, however. So you should simplify things and use the fgets() function to get the string you want. Since you are working with text files they should be opened with the text attribute.

    modified on Tuesday, June 24, 2008 6:30 AM

    C / C++ / MFC c++ help

  • bizarre problem with files
    K Kwanalouie

    I'm not real familiar with code on the heap, but the statement char* sText = new char[nFileLong+1]; //reserve string space is created with "new". Doesn't that require a "delete" or equivalent (I don't know the syntax) to de-allocate that space? If you don't then that space can't get re-allocated since the pointer is lost when you exit the procedure. Don't know what kinds of problems could occur as a result.

    C / C++ / MFC c++ help

  • Help erasing text in window
    K Kwanalouie

    Using Visual C++ 6.0 MFC in SDI application When my window gets redrawn, I want to display a message using pDC->TextOut(...) but I want a different message (of different length) displayed depending on the circumstances when the window gets redrawn. I do not understand how to erase the old message unless I keep a copy of the old text and rewrite it with the background color. If I just try to write a long text string with all blanks such as tstr = " " to erase the old message before I display the new message I have to make the text string extremely long as the character size for a space seems to be different then the character size for letters. Should I just display a rectangle of an appropriate size in the background color to erase my old text, or is there a better method of erasing this old text each time the window gets redrawn? Thanks

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

  • Dialog window help
    K Kwanalouie

    That's a great link!

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

  • How do I place & character in dialog
    K Kwanalouie

    Using Visual C++ 6.0 MFC in SDI application I would like to put the & symbol in a dialog window to save some space instead of using the word "and", but the compiler recognizes the & symbol as a special character to associate the next letter as a command key. How do I just get the symbol with no special operation associated with it into the dialog window? Thanks

    C / C++ / MFC c++ question

  • Dialog window help
    K Kwanalouie

    Using Visual C++ 6.0 MFC in SDI application I have a view that includes a dialog window from which the user can select different options. I do not want the user to be able to close that window. When the view changes, that dialog window will close automatically. However, I noticed that when the window is displayed, if the user hits the "escape key" esc, the window disappears. How do I prevent that from happening? Thanks

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

  • How do I get users screen size and resolution
    K Kwanalouie

    Using Visual C++ 6.0 MFC in SDI application I want to change the scale of my drawings depending on the user's screen size and resolution. It isn't clear to me how to get that information from the user's PC for drawing in given window. Thanks!

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

  • Help with modeless dialog error
    K Kwanalouie

    thanks!

    C / C++ / MFC c++ help

  • Help with modeless dialog error
    K Kwanalouie

    Using Visual C++ 6.0 MFC in SDI application I created a dialog box class called CTestDialog and assocatied files TestDialog.cpp and TestDialog.h. The dialog box ID is IDD_TESTDIALOGBOX. I want to have it run as a modeless dialog, and I have a routine in MainFrm.cpp where I want to control the display of this dialog box. When I put the header file for test dialog into MainFrm.cpp I get a compilation error. #include "TestDialog.h" error C2065: 'IDD_TESTDIALOGBOX' : undeclared identifier I don't get this error when the header file is placed in any other .cpp file. I don't understand what the problem is. Thanks

    C / C++ / MFC c++ help

  • Clearing client window
    K Kwanalouie

    The problem was that I would set a flag for my OnDraw routine to do as you suggested, but in the function that set that flag I simply did flag = NOTDRAW; Invalidate(0); When I did this, with the OnDraw routine simply returning when it saw that flag, the old info in the client window would not be erased. When I changed things to Invalidate(0); flag = NOTDRAW; Invalidate(0); in the function that set the flag, then the old info in the client window would get erased. So I'm confused as to what is happening with the Invalidate(0) function.

    C / C++ / MFC c++ question

  • Clearing client window
    K Kwanalouie

    Using Visual C++ 6.0 MFC in SDI application Under certain conditions I want my OnDraw routine to display a blank window, instead of what was previously drawn there. When I use the InvalidateRect(0) function, the OnDraw gets called, but I am looking for some window function that will clear everything. How do I do that? Thanks

    C / C++ / MFC c++ question

  • Clearing client window when New menu item is selected
    K Kwanalouie

    Using Visual C++ 6.0 MFC in SDI application I don't understand how to clear the client window that I had been drawing in when the user selects the menu item "New" from the main File menu. What code should be used to clear the old window and where should that code go? Thanks!

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

  • floating point
    K Kwanalouie

    floating point numbers are limited in resolution. They can get very close to the result, but not necessarily exact. You can minimize the problem by using "double" instead of "float", but that doesn't eliminate things. One quick fix is to simply use a small delta value in your computations. For example: float delta = 0.000000001; where delta is some number much smaller than you care about in your program. Then for greater than comparisons include it if (c >= (5.1 + delta)) printf("OK");

    C / C++ / MFC help question

  • [Message Deleted]
    K Kwanalouie

    Thanks a lot. That did the trick!

    C / C++ / MFC
  • Login

  • Don't have an account? Register

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