Unable to extract resources from DLL's using API functions 
Author Message
 Unable to extract resources from DLL's using API functions

I have compiled a DLL full of bitmaps for my application and yet the API
functions I am using in VB do not return their respective handles. Has
anybody experienced this before and knows what the problem is ?

Could you let me know ??

Michael.



Thu, 02 Jul 1998 03:00:00 GMT  
 Unable to extract resources from DLL's using API functions

Unless there are problems with the API you're using then I'd say the
problem is in what API you're using and if you're using them
correctly.  Of course, we won't know that until we see what kind of
API you're using and how you're using them.  I know, I know.  Why
couldn't I just ask if you could post some code.

George


Quote:
>I have compiled a DLL full of bitmaps for my application and yet the API
>functions I am using in VB do not return their respective handles. Has
>anybody experienced this before and knows what the problem is ?
>Could you let me know ??
>Michael.

===============================================================================
 George R. Torralba              xxxxxxxxxxxx                  Batang Cebu!!!
 Seattle, Washington             206.241.2801              MIME mail accepted
===============================================================================


Fri, 03 Jul 1998 03:00:00 GMT  
 Unable to extract resources from DLL's using API functions

Quote:
>>I have compiled a DLL full of bitmaps for my application and yet the API
>>functions I am using in VB do not return their respective handles. Has
>>anybody experienced this before and knows what the problem is ?

>>Could you let me know ??

From this full, robust and complete description, I'd say I cannot tell.

- Mike



Sun, 05 Jul 1998 03:00:00 GMT  
 Unable to extract resources from DLL's using API functions

Fair enough about the code. I used two functions only, I took their
declarations directly from the API help file. I used them like this:

        hInstance = LoadLibrary("MyLibrary.dll")
        hBmp = LoadBitmap(hInstance, "MYBITMAP")

It seemed fairly straight forward to me...hBmp always returned 0.

Quote:

>Unless there are problems with the API you're using then I'd say the
>problem is in what API you're using and if you're using them
>correctly.  Of course, we won't know that until we see what kind of
>API you're using and how you're using them.  I know, I know.  Why
>couldn't I just ask if you could post some code.

>George


>>I have compiled a DLL full of bitmaps for my application and yet the API
>>functions I am using in VB do not return their respective handles. Has
>>anybody experienced this before and knows what the problem is ?

>>Could you let me know ??

>>Michael.



Sun, 05 Jul 1998 03:00:00 GMT  
 Unable to extract resources from DLL's using API functions
1. I checked this - hInstance is returned OK
2. I'll have to check
3. Definitely a "name"
4. I'll have to check
5. Definitely a bitmap
6. Pretty good chance of that
7. If this is true you're pretty good at faking it
8. Hmmmm.....


Quote:

>Things thay may/may not be:

>1. hInstance == 0 (not valid)
>2. Bitmap name not passed ByVal (which with strings in VB means by
>reference)
>3. Bitmap's ID is really an integer not a "name"
>4. hInstance in LoadBitmap passed by reference instead of ByVal
>5. There is no such bitmap
>6. You don't know what the hell you're doing
>7. I don't know what the hell I'm saying
>8. Oh, maybe hBmp is not really zero but you just think it is :-)

>George



>>Fair enough about the code. I used two functions only, I took their
>>declarations directly from the API help file. I used them like this:

>>       hInstance = LoadLibrary("MyLibrary.dll")
>>       hBmp = LoadBitmap(hInstance, "MYBITMAP")

>>It seemed fairly straight forward to me...hBmp always returned 0.

>===============================================================================
> George R. Torralba              xxxxxxxxxxxx                  Batang Cebu!!!
> Seattle, Washington             206.241.2801              MIME mail accepted
>===============================================================================



Mon, 06 Jul 1998 03:00:00 GMT  
 Unable to extract resources from DLL's using API functions
1. I checked this - hInstance is returned OK
2. I'll have to check
3. Definitely a "name"
4. I'll have to check
5. Definitely a bitmap
6. Pretty good chance of that
7. If this is true you're pretty good at faking it
8. Hmmmm.....


Quote:

>Things thay may/may not be:

>1. hInstance == 0 (not valid)
>2. Bitmap name not passed ByVal (which with strings in VB means by
>reference)
>3. Bitmap's ID is really an integer not a "name"
>4. hInstance in LoadBitmap passed by reference instead of ByVal
>5. There is no such bitmap
>6. You don't know what the hell you're doing
>7. I don't know what the hell I'm saying
>8. Oh, maybe hBmp is not really zero but you just think it is :-)

>George



>>Fair enough about the code. I used two functions only, I took their
>>declarations directly from the API help file. I used them like this:

>>       hInstance = LoadLibrary("MyLibrary.dll")
>>       hBmp = LoadBitmap(hInstance, "MYBITMAP")

>>It seemed fairly straight forward to me...hBmp always returned 0.

>===============================================================================
> George R. Torralba              xxxxxxxxxxxx                  Batang Cebu!!!
> Seattle, Washington             206.241.2801              MIME mail accepted
>===============================================================================



Mon, 06 Jul 1998 03:00:00 GMT  
 Unable to extract resources from DLL's using API functions

Things thay may/may not be:

1. hInstance == 0 (not valid)
2. Bitmap name not passed ByVal (which with strings in VB means by
reference)
3. Bitmap's ID is really an integer not a "name"
4. hInstance in LoadBitmap passed by reference instead of ByVal
5. There is no such bitmap
6. You don't know what the hell you're doing
7. I don't know what the hell I'm saying
8. Oh, maybe hBmp is not really zero but you just think it is :-)

George


Quote:

>Fair enough about the code. I used two functions only, I took their
>declarations directly from the API help file. I used them like this:
>    hInstance = LoadLibrary("MyLibrary.dll")
>    hBmp = LoadBitmap(hInstance, "MYBITMAP")
>It seemed fairly straight forward to me...hBmp always returned 0.

===============================================================================
 George R. Torralba              xxxxxxxxxxxx                  Batang Cebu!!!
 Seattle, Washington             206.241.2801              MIME mail accepted
===============================================================================


Mon, 06 Jul 1998 03:00:00 GMT  
 Unable to extract resources from DLL's using API functions

Quote:

>I have compiled a DLL full of bitmaps for my application and yet the API
>functions I am using in VB do not return their respective handles. Has
>anybody experienced this before and knows what the problem is ?
>Could you let me know ??
>Michael.

Mike
I have been messing with this for sometime and have finally solved the
problem about six months ago.  Go to my web page and download my
sample program and check out the code.  It is the first sample
program,there are only two there so far.  In the sample I extract BMP,
WAV and ICO files from the DLL and display them in a VB app.  It is
pretty blah stuff but the code should be of some value, I hope.  Since
I posted that program I have also figured out how to extract
StringTable info from a DLL, which is helping me for my next program.

Any questions or problems let me know.

Good luck

Michael Park
___________________________________________________________________

?These views are my own and do not represent my company in anyway?



Mon, 06 Jul 1998 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Extracting Functions and parameters from DLL's

2. Using resource DLL's to store BMP's: Palette problems

3. Extracting Icons from Exe's Dll's Ico's into a ListImage Control

4. API - Cabinet - how to pack and extract using api in VB

5. Problem extracting word document from resource dll

6. Extracting resources from DLLs

7. Extracting Bitmaps from resource dll

8. Using ScaleMode with API's LineTo function

9. Calling a DLL function using API

10. Calling a DLL function using API

11. Using DLL's and Declare Function statements

12. using friend functions within com dll's for MTS

 

 
Powered by phpBB® Forum Software