Thread: PLZZZ attention!!!!

  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    4

    PLZZZ attention!!!!

    ON_COMMAND_RANGE(IDC_But1,IDC_But16,MoveButton)

    Can any 1 tell me whats wrong in this ABOVE code?? it give me error on MoveButton

    type cast' : cannot convert from 'int (__cdecl *)(int)' to 'void (__thiscall CCmdTarget::*)(unsigned int)'

    this error MoveButton is func with parametter int btn and is of type BOOL.
    while IDC_But1 and IDC_But16 return void.

    MoveButton is a handler bt its nt working. why??? whats the problum?? i couldnt caught it.

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Please look at the forum hints and tips as they pertain to choosing a title for threads. CAPS and exclamation points will do nothing to quicken responses and will cause most people to bypass your thread. Besides the fact that your title has nothing to do with the content of your thread and does nothing to express the core problem.

    2. Use descriptive subject lines. Do not put URGENT!, or NEED HELP NOW, etc. in your title; it will not make people look at it any faster. Doing this makes many old time helpers on this board not look at the post at all
    And now to the problem:

    This looks like MFC which is telling me it belongs on another forum. But the core problem is that MoveButton() has not been declared correctly so the macro ON_COMMAND_RANGE cannot recognize MoveButton() as a valid function to call. You must declare MoveButton() exactly as the macro expects. Look at the error message closely and it will tell you everything you need to know.

  3. #3
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    Quote Originally Posted by Bubba View Post
    Please look at the forum hints and tips as they pertain to choosing a title for threads. CAPS and exclamation points will do nothing to quicken responses and will cause most people to bypass your thread. Besides the fact that your title has nothing to do with the content of your thread and does nothing to express the core problem.
    I have been seeing so many Windows-specific problems in the general areas and since no one does anything about it (prior to this) I just assumed that it was allowed under the theory that "all the world runs Windows" thus the mistake was accepted as business as usual. I do agree on the caps and such; it feels like the poster is demanding work to be done for them in which case I just tend to move on, regardless of platform.
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Quote Originally Posted by Bubba View Post
    Please look at the forum hints and tips as they pertain to choosing a title for threads. CAPS and exclamation points will do nothing to quicken responses and will cause most people to bypass your thread. Besides the fact that your title has nothing to do with the content of your thread and does nothing to express the core problem.
    2 post and both got the same response, 'wrong way to ask the question and wrong forum'.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  5. #5
    Registered User
    Join Date
    Dec 2009
    Posts
    4
    Quote Originally Posted by Bubba View Post
    Please look at the forum hints and tips as they pertain to choosing a title for threads. CAPS and exclamation points will do nothing to quicken responses and will cause most people to bypass your thread. Besides the fact that your title has nothing to do with the content of your thread and does nothing to express the core problem.



    And now to the problem:

    This looks like MFC which is telling me it belongs on another forum. But the core problem is that MoveButton() has not been declared correctly so the macro ON_COMMAND_RANGE cannot recognize MoveButton() as a valid function to call. You must declare MoveButton() exactly as the macro expects. Look at the error message closely and it will tell you everything you need to know.
    Thanks 4 helping me n guiding me. but my problem is still there its nt working i have declared it
    bt it is again giving error. plz tell me the method of declaring it and where to declare it??

  6. #6
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Look at MSDN - ON_COMMAND_RANGE (MFC)

    In the code example, you will see that the function that ON_COMMAND_RANGE expects is a member function that returns void and expects a UINT (unsigned int).

    The function you are trying to pass is a global function returning an int, so the compiler is not happy.

  7. #7
    Registered User
    Join Date
    Nov 2009
    Posts
    82
    You should just delete this thread and force him to make one properly, most people won't learn unless you force them to which make the forum rules effectively useless. Think about it, he acts like an idiot and still gets the help, what function did the rules actually, objectively, serve?

    Rewarding deliberate attempts to ignore the rules doesn't make sense.

    ... the way he types is annoying the crap out of me, spend a friggin second to proof-read. Are you posting on this forum from a cell phone? If so it's called 'iTAP English', use it.
    Last edited by since; 12-29-2009 at 03:43 PM.

  8. #8
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Quote Originally Posted by since View Post
    You should just delete this thread and force him to make one properly, most people won't learn unless you force them to which make the forum rules effectively useless. Think about it, he acts like an idiot and still gets the help, what function did the rules actually, objectively, serve?

    Rewarding deliberate attempts to ignore the rules doesn't make sense.

    ... the way he types is annoying the crap out of me, spend a friggin second to proof-read. Are you posting on this forum from a cell phone? If so it's called 'iTAP English', use it.
    I know. Annoying as hell. But surely it's better for him to understand why people dont like his approach and to learn a little nettiquete than to just delete his stuff?

    Maybe I'm too soft, but surely even l33t speaking kids deserve a second chance furing Xmas dont they?

    If he keeps it up I will start to prune his stuff though...

  9. #9
    Registered User
    Join Date
    Nov 2009
    Posts
    82
    Fordy,

    I usually ignore it, but every now and then I cringe when mods complain about rules but do little to enforce lol.

    I would be an evil mod, I would 'trade' answers for reformatting titles and crap. Now that's more like a system that enforces its rules, negotiating rewards.

    I don't really care as much as I sound like I do, still, the principle/logic of the whole thing always nags me in the back of my mind.

    My mind controls itself, I just act as a proxy.

    I like how in that one dog show, the dog whisperer?, it's really not about training the dogs... it's about training the people, then the dogs behave because people respect the dogs nature and actually understand, which changes the whole dynamic achieving cooperation. That doesn't really apply, I just thought it did from some weird perspective before I started writing this and now I forgot. Damn.

    >:]
    Last edited by since; 12-29-2009 at 06:05 PM.

  10. #10
    Registered User
    Join Date
    Dec 2009
    Posts
    4
    Quote Originally Posted by since View Post
    Fordy,

    I usually ignore it, but every now and then I cringe when mods complain about rules but do little to enforce lol.

    I would be an evil mod, I would 'trade' answers for reformatting titles and crap. Now that's more like a system that enforces its rules, negotiating rewards.

    I don't really care as much as I sound like I do, still, the principle/logic of the whole thing always nags me in the back of my mind.

    My mind controls itself, I just act as a proxy.

    I like how in that one dog show, the dog whisperer?, it's really not about training the dogs... it's about training the people, then the dogs behave because people respect the dogs nature and actually understand, which changes the whole dynamic achieving cooperation. That doesn't really apply, I just thought it did from some weird perspective before I started writing this and now I forgot. Damn.

    >:]
    Since
    This site is whther 4 hlpng the people and giving suggstions and condeming dem.I think you are least bothered about solving the problem instead insulting others.I have received only two replies out of eight tried to solve my problem and rest of them were only advises and insults rather than solving my problem.I am not here to improve my english.The actual problem is still there and i don't knw how to correct and i think so just as you people had moved my thread then same wise u cn correct it out!The way u peoople r sending quotations on dogs!iz it right way of talking to people?????????

  11. #11
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Quote Originally Posted by fanta View Post
    Since
    This site is whther 4 hlpng the people and giving suggstions and condeming dem.I think you are least bothered about solving the problem instead insulting others.I have received only two replies out of eight tried to solve my problem and rest of them were only advises and insults rather than solving my problem.I am not here to improve my english.The actual problem is still there and i don't knw how to correct and i think so just as you people had moved my thread then same wise u cn correct it out!The way u peoople r sending quotations on dogs!iz it right way of talking to people?????????
    Get the hint. The two answers provided show more effort on the poster's part than you have shown on your posts.

    I gave you the answer. If you cant work it out even when its spoon fed to you then I suggest taking up a different endevour.

  12. #12
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Quote Originally Posted by fanta View Post
    Since
    This site is whther 4 hlpng the people and giving suggstions and condeming dem.I think you are least bothered about solving the problem instead insulting others.I have received only two replies out of eight tried to solve my problem and rest of them were only advises and insults rather than solving my problem.I am not here to improve my english.The actual problem is still there and i don't knw how to correct and i think so just as you people had moved my thread then same wise u cn correct it out!The way u peoople r sending quotations on dogs!iz it right way of talking to people?????????
    Keep in mind, though, that the advice here is given free of charge, and as such the courteous thing to do is to make an earnest effort to make a good presentation. Use a title that actually describes the problem, in condensed form. Describe your problem as thoroughly and clearly as possible. Follow up on responses. Et cetera.

    With respect to your problem, the issue is a mismatch in function signatures, as Fordy already pointed out.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Attention Expected!!!! Super Moderators (Clue: Censorship on Thread/Post)
    By zahid in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 01-29-2003, 08:19 AM
  2. Attention All Programmers/Artisins!
    By minime6696 in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 09-05-2001, 11:57 AM
  3. Attention Span
    By kermi3 in forum A Brief History of Cprogramming.com
    Replies: 28
    Last Post: 08-20-2001, 07:00 PM