CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2002
    Location
    Czech Republic
    Posts
    47

    SHLoadDIBitmap() doesn't work

    Hi,
    I'm getting desperate 'cause SHLoadDIBitmap() doesn't work in my code. When I try loading the image from file like this:

    Hbmp=SHLoadDIBitmap(_T("Kozana.bmp"));

    or

    Hbmp=SHLoadDIBitmap(L"Kozana.bmp");


    the function returns 0. The Kozana.bmp file is placed in the project directory and also into the subdirectory where the eVC creates the executable file.

    When I tried including the bitmap into resources and loading it with LoadBitmap everything worked perfectly. Unfortunately I can't use the LR_LOADFROMFILE option with LoadBitmap on PPC2002 as I do in Win2000.

    I've found many code snippets with SHLoadDIBitmap() on the net and it seems there shouldn't be any problem with this function. Does anybody know where the problem might be?

    thankx

    Koxin

  2. #2
    Join Date
    Nov 2002
    Location
    Israel
    Posts
    182
    But where you test your application? If it is an emulator so you need to put your pictures in its folder. If you have a PDA, so copy the application and the picture into \\Windows\StartMenu, for example.
    I use CDibSectionLite for bmp-files. So I don't remember even parameters for SHLoadDIBitmap.
    Good luck

  3. #3
    Join Date
    Sep 2002
    Location
    Czech Republic
    Posts
    47
    I've solved the problem already, but thanks for your answer anyway. The catch was really in my putting the image files in a wrong directory.

    Koxin

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