Bad DLL Calling Convention during CreateBitmap() 
Author Message
 Bad DLL Calling Convention during CreateBitmap()

I am looking for help with a "Bad DLL calling convention" message that is
being
displayed with a VB3 application.  The problem is that this message is not
being
displayed on all of the computers that I run this on so it makes it
difficult to debug.

The message happen during the following VB3 call:

hCompBitMap = CreateBitmap( 1, 1, 1, 16, 0 )

which I believe creates a 1 x 1 bitmap of 1 plane and 16 bits / pixel

I have swapped the gdi.exe DLL on the different computers but this
has not corrected the problem.

I would appreciate any suggestions on this problem.


Thanks,

Gerry



Sat, 02 Oct 1999 03:00:00 GMT  
 Bad DLL Calling Convention during CreateBitmap()

Quote:

> I am looking for help with a "Bad DLL calling convention" message
> that is being displayed with a VB3 application.  The problem is that
> this message is not being displayed on all of the computers that I run
> this on so it makes it difficult to debug.
>The message happen during the following VB3 call:

        hCompBitMap = CreateBitmap( 1, 1, 1, 16, 0 )

Quote:
>which I believe creates a 1 x 1 bitmap of 1 plane and 16 bits / pixel

CreateBitmap creates a device dependent bitmap, this means: "screen
compatible". As far as I understand the Windows philosophy, GDI actually
asks the video driver to do it.

If this is correct, I expect your code to fail on graphic cards
(drivers) that do not support 16-bit colors.

A workaround would be a to use a 24-bit 1x1 DIB. This should work on all
systems. The penalty on such a small bitmap should be neglegible.

However, make sure to test your code in 256-color systems as well! The
colors might change drastically if you don't get this right. You'll
probably have to use palette API calls.

Also, your last parameter looks very suspicious. This should be a
pointer. Are you really passing zero as a pointer, or did you change the
declaration?

If the declaration is still "Byval lpbits as any", it is safe to
initialize a string and use that:

        Dim c$: c$=chr$(0) & chr$(0)
        hCompBitMap = CreateBitmap( 1, 1, 1, 16, c$ )

HTH,

Gent (Ghent, Gand),
Belgium,
Europe,
3rd planet from the sun.



Sun, 03 Oct 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. 2 PRBS: Calling 16 bit DLL from VB5 and Bad DLL Calling Convention

2. 16bit->32bit C dll : bad dll calling convention

3. Bad DLL calling convention VB-to-C DLL

4. C DLL (VC5) and Bad DLL Calling Convention

5. Bad DLL Calling Convention with CPUINF32.DLL

6. Possible answer to Err 49: Bad DLL calling convention

7. Run-time error '49': Bad DLL calling convention

8. Possible answer to Err 49: Bad DLL calling convention

9. Bad Dll Calling Convention???

10. VB Error: "Bad DLL Calling Convention"

11. Bad DLL calling convention (error 49)

12. "Bad DLL Calling Convention"

 

 
Powered by phpBB® Forum Software