Search:

Type: Posts; User: Malek

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    7
    Views
    6,426

    Modular Division problem

    I was working with floating point numbers and integers, and I came across a case where I needed just the part of the floating point number that comes after the decimal. So for example, if I had

    ...
  2. Re: Problem when including Dialog Class File in more then one file in MFC

    You may need to #include your resource file before you #include your mydialog.h file, because thats probably where IDD_CLOUDS_DIALOG is defined.
  3. Replies
    14
    Views
    1,826

    Thanks :)

    Alright, thanks everyone, that clears things up. I'll just use one of the workarounds to make it work that way I want it to. Thanks for the help.
  4. Replies
    14
    Views
    1,826

    I was type casting the 80 as a char since 80 is...

    I was type casting the 80 as a char since 80 is an integer, although I don't recall if the compiler complained about it or not, so it may not have been necessary.

    As for R.Stiltskin (and possibly...
  5. Replies
    14
    Views
    1,826

    The (char)200 works fine. If I do (char)86, it...

    The (char)200 works fine. If I do (char)86, it displays the correct letter for that ascii character. The number 200 was just an example, if I printed that out it might be a junk character, or a beep,...
  6. Replies
    14
    Views
    1,826

    Casting char as int problem

    I was messing around with casting a single character as an integer, and I've been getting bizzare results. If I do this:



    char myChar = (char)200;
    unsigned int result;

    result = (unsigned...
  7. Replies
    4
    Views
    4,243

    Came up with something...

    I can't seem get get a hold of a CListCtrl, the help files say that belongs to a CListView, and I'm using a CListBox, so I dont think I can use that. When searching the web more trying to find some...
  8. Replies
    4
    Views
    4,243

    Hmm...

    SetExtendedStyle does not appear to be a function for CListBox. I tried using ModifyStyleEx, which supposedly lets me modify extended styles, but that doesn't appear to work either.

    I've tried...
  9. Replies
    4
    Views
    4,243

    CWnd::ModifyStyle Problem

    Is there a way to modify a window's style (CWnd base type) after it has been created? Here's what I've been doing, and it doesn't seem to do anything. I'm using MFC to create my windows.



    //...
  10. Thread: Drawing in MFC

    by Malek
    Replies
    6
    Views
    31,407

    Thanks :)

    Alright, got it working. Thanks for the help. :)
  11. Thread: Drawing in MFC

    by Malek
    Replies
    6
    Views
    31,407

    Another question

    I'm having trouble figuring out how to do your second suggestion. I'm trying to create my own custom class on the dialog, but the program keeps giving me the error "Failed to create empty document"....
  12. Thread: Drawing in MFC

    by Malek
    Replies
    6
    Views
    31,407

    Drawing

    Hmm, I did what you suggested and it creates the white box just like I want. Then I do something like this:



    CDC *myDC = GetDlgItem(IDC_DRAWBOX)->GetDC();
    myDC->Rectangle(10, 10, 20, 20);

    ...
  13. Thread: Drawing in MFC

    by Malek
    Replies
    6
    Views
    31,407

    Drawing in MFC

    Hello, I had a question as to how to have a drawing window and the other text windows and stuff in MFC. Basically I want to use the Resource editor to create my display. I want to have lists, text...
  14. Replies
    1
    Views
    5,011

    Horizontal Scroll Bars with CListBox

    Hello, I'm using Microsoft Visual C++ 5.0, and am trying to make the horizontal scroll bars work the want I want them to for a CListBox. Here's a sample of what my code currently does:


    ...
  15. Replies
    4
    Views
    2,040

    Selective #include's

    Anyone know if there is a way to include only part of a header file, and part of the c++ file? Say for example I want 1 class structure and definitions from a header file/c++ file, but I don't want...
  16. Replies
    3
    Views
    1,393

    Class inheritance/delete

    Alright, thanks. Making the destructor virtual seems to work. <whew> Don't have to try and change all those delete statements.
  17. Replies
    3
    Views
    1,393

    Class Inheritance and deleting

    Anyone know how to call the appropriate deconstructor in this example? Assume Weapon inherits some stuff from Item, but weapon has a few variables of its own as well.



    int main(void)
    {
    ...
  18. Thread: Memory leaks

    by Malek
    Replies
    2
    Views
    981

    Memory leaks

    Are there any programs I can use when I run my code to see if I have any memory leaks in it? Like if I forgot to delete a dynamically created variable in a function that gets called 15 times. Any...
  19. Replies
    9
    Views
    1,163

    Dependencies

    Alright, thanks. The

    class Things;

    class Stuff;

    in the files worked. Thanks for the help.
  20. Replies
    9
    Views
    1,163

    Dependencies

    Here's some sample code I just made up, I think it points out my problem. Any way to make this compile? Thanks.

    Header: stuff.h



    #ifndef HEADER_STUFF
    #define HEADER_STUFF

    #include...
  21. Replies
    9
    Views
    1,163

    Dependencies problem

    I have a header problem, when trying to #include 2 different files. Here's my problem:

    Header A:



    #ifndef HEADER_A
    #define HEADER_A

    #include "headerB.h"
  22. Thread: new/delete

    by Malek
    Replies
    14
    Views
    1,357

    new/delete

    Hello, I had a question about what the difference is between delete and delete[]. Lets say for example I have this code:



    char *tmp;
    tmp = new char[100];
    // ....
    delete char;
  23. Replies
    3
    Views
    972

    Stumbled across a solution

    I stumbled across a solution when I was trying to find a way to translate WM_CHAR messages. When I was translating messages in my main function, I used to be doing:

    while (GetMessage(&msg, NULL,...
  24. Replies
    3
    Views
    972

    Edit boxes and tabs

    Is there a way to make an edit box accept tab characters? When I hit tab in an edit box it jumps to the next button, but I want it to treat that as a tab character (or turn it into a few 'space'...
  25. Thread: Button Styles

    by Malek
    Replies
    2
    Views
    1,148

    EnableWindow

    Alright, thanks. EnableWindow works perfectly.
Results 1 to 25 of 28
Page 1 of 2 1 2