none
"The specified resource type cannot be found in the image file" version 2

    Question

  • I'm getting this error message when I get to the the following function call:

    hr = gplay.toolbar.SetImageList(
    			Toolbar::Normal,			// Image list for normal state
    			IDB_TOOLBAR_IMAGES_ENABLED,	// Bitmap resource
    			Size(48, 48),				// Size of each button
    			5,							// Number of buttons
    			RGB(0xFF, 0x00, 0xFF)		// Color mask
    			);

    When I compile the code as a .exe, everything works.  But when I compile it as a .dll it can't seem to find the IDB_TOOLBAR_IMAGES_ENABLED image.  I found a post talking about this issue but it didn't solve my issue.  (Located here ) I have tried copying the image files around and made sure they're in the same directory as the .dll and the .exe that is calling the .dll function. I opened the .dll in VS2010 and looked in the tree view and I see the corresponding codes for the image files and I'm even able to open the images.

    Can anyone shed some light on what this issue could be?

    I'm trying to make a Toolbar from the Windows SDK v7.0.  I'm using VS2010. Please let me know what other information I could give to help.

    Friday, February 10, 2012 2:14 AM

Answers

  • Hi Dave,
     
    Welcome to the MSDN Forum.
     
    I suppose you were programming in a MFC application. When using the resource ID in codes, we should make sure that there is surely a resource of this ID. I suggest you add the bitmap resource in regular way in the DLL project, not by copying and pasting.
     
    In general, we should add resource in MFC application like this: right click project name in Solution Explorer->Add->resource…, choose Bitmap. You can get a bitmap resource by creating a new one or by importing an existing one. Then in Resource View, you will see a folder named Bitmap under the project. The ID for bitmap resource is commonly like IDB_BITMAP1. Of course, you can change the ID from Properties.
     
    I hope this reply is helpful to you. If you still have questions about this issue, please provide us more information about the error. It would be appreciated if you could locate the position of this error and post the corresponding code snippets.
     
    Best regards,
    Helen Zhao


    Helen Zhao [MSFT]
    MSDN Community Support | Feedback to us


    • Edited by Helen Zhao Monday, February 13, 2012 9:13 AM
    • Proposed as answer by Helen Zhao Thursday, February 23, 2012 9:18 AM
    • Marked as answer by Dave Kelley Tuesday, March 13, 2012 8:39 PM
    Monday, February 13, 2012 6:10 AM

All replies

  • Hi Dave,
     
    Welcome to the MSDN Forum.
     
    I suppose you were programming in a MFC application. When using the resource ID in codes, we should make sure that there is surely a resource of this ID. I suggest you add the bitmap resource in regular way in the DLL project, not by copying and pasting.
     
    In general, we should add resource in MFC application like this: right click project name in Solution Explorer->Add->resource…, choose Bitmap. You can get a bitmap resource by creating a new one or by importing an existing one. Then in Resource View, you will see a folder named Bitmap under the project. The ID for bitmap resource is commonly like IDB_BITMAP1. Of course, you can change the ID from Properties.
     
    I hope this reply is helpful to you. If you still have questions about this issue, please provide us more information about the error. It would be appreciated if you could locate the position of this error and post the corresponding code snippets.
     
    Best regards,
    Helen Zhao


    Helen Zhao [MSFT]
    MSDN Community Support | Feedback to us


    • Edited by Helen Zhao Monday, February 13, 2012 9:13 AM
    • Proposed as answer by Helen Zhao Thursday, February 23, 2012 9:18 AM
    • Marked as answer by Dave Kelley Tuesday, March 13, 2012 8:39 PM
    Monday, February 13, 2012 6:10 AM
  • Hi Dave,

    Would you mind letting me the result of my suggestion? How about adding new resource in the recommended way?

    If the reply is helpful, please mark it as answer. If not so, it would very appreciated if you could share your own solution & experience with us. If you need further help, please feel free to let us know. We'll continue working with you on this issue.

    Thanks for your active participation in the MSDN Forum.
    Have a nice day!


    Helen Zhao [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, February 16, 2012 8:39 AM