CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Aug 2011
    Posts
    28

    Question Cimage can not a valid hbitmap

    Cimage img;
    img.Attach(hbitmap);


    debuggin shows that hbitmap is valid but program fails at Attach line. Thank you if you could help me.

  2. #2
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: Cimage can not a valid hbitmap

    Quote Originally Posted by Befefe View Post
    debuggin shows that hbitmap is valid...
    How does it show that?
    Quote Originally Posted by Befefe View Post
    program fails at Attach line.
    How does it fail? Any error message?
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

  3. #3
    Join Date
    Aug 2011
    Posts
    28

    Re: Cimage can not a valid hbitmap

    If I have a HBITMAP, then I would like to use it in

    Image or CImage or CBitmap or Bitmap, what I can I do, say, to save it in my drive ?

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Cimage can not a valid hbitmap

    Quote Originally Posted by Befefe View Post
    If I have a HBITMAP, then I would like to use it in

    Image or CImage or CBitmap or Bitmap, what I can I do, say, to save it in my drive ?
    When someone responds to your post and asks you questions, please answer the questions first (even if you don't think the questions are relevant).

  5. #5
    Join Date
    Jun 2010
    Posts
    115

    Re: Cimage can not a valid hbitmap

    Quote Originally Posted by Arjay View Post
    When someone responds to your post and asks you questions, please answer the questions first (even if you don't think the questions are relevant).
    Why do you care about that ? Users come and go, I and a hundred friends of mine used to share the same account and we chatted with one person and it was just fine. I can talk to you now but later I give this account to a HIV patient, and he pretends to be me, then who are you talkng to ?
    Who knows if VladimirF is you too ?

  6. #6
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Cimage can not a valid hbitmap

    Quote Originally Posted by Maejie View Post
    Why do you care about that ? Users come and go, I and a hundred friends of mine used to share the same account and we chatted with one person and it was just fine. I can talk to you now but later I give this account to a HIV patient, and he pretends to be me, then who are you talkng to ?
    Who knows if VladimirF is you too ?
    http://www.codeguru.com/forum/showpo...52&postcount=2

    Seriously. There's been quite the influx of nonsensical posters lately.

  7. #7
    Join Date
    Jun 2010
    Posts
    115

    Re: Cimage can not a valid hbitmap

    Quote Originally Posted by GCDEF View Post
    http://www.codeguru.com/forum/showpo...52&postcount=2

    Seriously. There's been quite the influx of nonsensical posters lately.
    I use incorrect English .

    I think it is a good way to ******** things and to create trust. My above example is just a hint, even when the server guys do so, no one from the outside can easily check. Therefore, a person famous like Herb Sutter if using a username ABCDEFG to play mouse and cat games, no one would know it is Herb Sutter

  8. #8
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Cimage can not a valid hbitmap

    Quote Originally Posted by Maejie View Post
    Why do you care about that ? Users come and go, I and a hundred friends of mine used to share the same account and we chatted with one person and it was just fine. I can talk to you now but later I give this account to a HIV patient, and he pretends to be me, then who are you talkng to ?
    Who knows if VladimirF is you too ?
    Actually Maejie, I'm a moderator here, so I get to give folks advice in terms of how to respond to posts.

    In fact, I'm going to ask you to respond in the future with professional replies only.

    That being said, posters that respond with answers here are volunteers, and usually don't have much time to go round and round with folks that are trying to get help, but aren't following advice or answering questions.

  9. #9
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Cimage can not a valid hbitmap

    Quote Originally Posted by Maejie View Post
    Why do you care about that ?
    I tell you why. Believe it or not, but every case of helping here at forum is very personal. To find most effective way to find the root cause, and especially to explain one to OP, you need to know your addressee personal skills and see his attitude, and way of thinking, and wording. Then you can find appropriate words and samples. This regularly appears true, at least for me. Of course, it's true if your intention is to help or be helped, not just to chat.

    Users come and go, I and a hundred friends of mine used to share the same account and we chatted with one person and it was just fine. I can talk to you now but later I give this account to a HIV patient, and he pretends to be me, then who are you talkng to ?
    Good to know that about you.
    Best regards,
    Igor

  10. #10
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: Cimage can not a valid hbitmap

    Quote Originally Posted by Maejie View Post
    Why do you care about that ? Users come and go...
    See? You got it! "Users" do that.
    Community sticks around.
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

  11. #11
    Join Date
    Aug 2011
    Posts
    28

    Re: Cimage can not a valid hbitmap

    Quote Originally Posted by Arjay View Post
    When someone responds to your post and asks you questions, please answer the questions first (even if you don't think the questions are relevant).
    I am not a theft being inquired by police, am i ?

  12. #12
    Join Date
    Aug 2011
    Posts
    28

    Re: Cimage can not a valid hbitmap

    Quote Originally Posted by VladimirF View Post
    See? You got it! "Users" do that.
    Community sticks around.
    Where is the community ?

  13. #13
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Cimage can not a valid hbitmap

    Quote Originally Posted by Befefe View Post
    I am not a theft being inquired by police, am i ?
    Surely you are not. You're a patient questioned by your physician. You want to be cured, you answer questions. The better dialog is, the quicker cure comes.
    Where is the community ?
    Let's focus on your problem, shall we?
    Last edited by Igor Vartanov; August 20th, 2011 at 12:55 AM.
    Best regards,
    Igor

  14. #14
    Join Date
    May 2002
    Location
    Lindenhurst, NY
    Posts
    867

    Re: Cimage can not a valid hbitmap

    Quote Originally Posted by Befefe View Post
    Where is the community ?
    Why did you completely ignore post #2? That's kind of rude don't you think?

  15. #15
    Join Date
    Aug 2011
    Posts
    28

    Re: Cimage can not a valid hbitmap

    Quote Originally Posted by Martin O View Post
    Why did you completely ignore post #2? That's kind of rude don't you think?
    Quote Originally Posted by VladimirF
    How does it show that?
    How does it fail? Any error message?
    Okay, I will reply (weekends is nice for replies like this, I don't know )
    Final words, I was thinking #2 was a cheese game player.. That is why I didn't focus on his questioning replies.

    There is no problem now because I solve it.

    The error message was something I forgot. But it happened at the ASSERT to say that "m_hbitmap==0". The bitmap handle was valid and in debug it can pass the break point, only image data weren't completely filled, some were marked as ??? while others -1 and the rest was filled with correct data. (Seriously I was dumb, I wish I could reproduce the problem, I should also memorize the message as it helped for future too). I hit it many times before I rewrote the whole program to draw the image thumbnail to insert it into my listview, the error was gone without my notice because I concentrated on the results rather than the bugs as a user-if you develop MS library or a book writer, you likely pay attention to steps to solving this problem. I am at present working with image bitmap only. It'll probably come again. I will let everyone know if you think it's worth.
    Last edited by Befefe; August 20th, 2011 at 08:24 AM.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured