I have a C++ DLL including bitmap resources created by Visual Studio.
Though I can load the DLL in VB6 using LoadLibrary, I cannot load the image resources either by using LoadImage or by using LoadBitmap. When I try to get the error using GetLastError(), it doesnot return any errors.
I have tried using LoadImage and LoadBitmap in another C++ program with the same DLL and they work without any problems.
Is there any other way of accessing the resource bitmaps in C++ DLLs using VB6?
Since you are using the numeric ID of the bitmap as a string, you have to add a ‘#’ in front of it:
In C++ you could also use the MAKEINTRESOURCE macro, which is simply a cast to LPCTSTR: