Bad DLL Calling Convention 
Author Message
 Bad DLL Calling Convention

Could somebody help me with this
i just cannot see what i am doing wrong
i have checked everthing many times!!!

Public Function Tile(F As Object, i As Object)
 f is a form
i is the picture box

Dim Wide As Long
Dim High As Long

Wide = i.Width
High = i.Height

Dim y As long
Dim x As Long
For y = 0 To F.ScaleHeight Step High

              For x = 0 To F.ScaleWidth Step Wide
    Call BitBlt(F.hdc, x, y, Wide, High, i.hdc, 0, 0, SRCCOPY)
    Next x
Next y

End Function
--
Mail Me:

Check OUT:
http://www.*-*-*.com/



Fri, 29 Oct 1999 03:00:00 GMT  
 Bad DLL Calling Convention

Hi James:

    Call BitBlt(F.hdc, x, y, Wide, High, i.hdc, 0, 0, SRCCOPY)
<<

Unless you have a DefLng statement in your module, then I suspect
VB is trying to pass the zeros as the default data type (Variant).
Try typecasting them to long and see if the helps, i.e.

    Call BitBlt(F.hdc, x, y, Wide, High, i.hdc, 0&, 0&, SRCCOPY)

Doug.



Fri, 29 Oct 1999 03:00:00 GMT  
 Bad DLL Calling Convention

James

Quote:
> Could somebody help me with this
> i just cannot see what i am doing wrong
> i have checked everthing many times!!!

The trouble is with your BitBlt declaration. If you want to post it, I can
take a look.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com



Fri, 29 Oct 1999 03:00:00 GMT  
 Bad DLL Calling Convention

Still did not work :(
--
Mail Me:

Check OUT:
HTTP://www.toptown.com/hp/james/

Quote:
>Hi James:

>    Call BitBlt(F.hdc, x, y, Wide, High, i.hdc, 0, 0, SRCCOPY)
><<

>Unless you have a DefLng statement in your module, then I suspect
>VB is trying to pass the zeros as the default data type (Variant).
>Try typecasting them to long and see if the helps, i.e.

>    Call BitBlt(F.hdc, x, y, Wide, High, i.hdc, 0&, 0&, SRCCOPY)

>Doug.



Sat, 30 Oct 1999 03:00:00 GMT  
 Bad DLL Calling Convention

Hi James:

I should have spotted this in the first place <g> -- BitBlt is a function,
not a sub.
Therefore you can not "Call" it, but rather must either disregard the
return value,
or assign it to a variable, i.e.

  BitBlt F.hdc, x, y, Wide, High, i.hdc, 0&, 0&, SRCCOPY
Or..
  rtn = BitBlt (F.hdc, x, y, Wide, High, i.hdc, 0&, 0&, SRCCOPY)

Also, I notice in your api declaration that you did not declare  the
function
return type -- add " As Long" to the end of your declaration.

Hope this helps,

Doug.



Sat, 30 Oct 1999 03:00:00 GMT  
 Bad DLL Calling Convention

One thing I see wrong is the missing return value for the function.  I have
seen this cause this message before.

Add the "As Long" to the end of the call so that it expect a long return
value instead of a variant and see what happens.



Quote:
> the declare
> Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As
> Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal
> hSrcDC As Long, ByVal XSrc As Long, ByVal YSrc As Long, ByVal dwRop As
> Long)
> and SRCCOPY
> Const SRCCOPY = &HCC0020
> i am sure they are right i took them out of the database from the win32
api
> book.
> --
> Mail Me:

> Check OUT:
> HTTP://www.toptown.com/hp/james/

> >James

> >> Could somebody help me with this
> >> i just cannot see what i am doing wrong
> >> i have checked everthing many times!!!

> >The trouble is with your BitBlt declaration. If you want to post it, I
> can
> >take a look.

> >--
> >Jonathan Wood
> >SoftCircuits Programming
> >http://www.softcircuits.com



Sat, 30 Oct 1999 03:00:00 GMT  
 Bad DLL Calling Convention

James,

Quote:
> i am sure they are right i took them out of the database from the win32
api
> book.

Well, there's probably a lesson here for you because the declaration is not
right as I suspected.

Declare the function itself As Long.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com



Sat, 30 Oct 1999 03:00:00 GMT  
 
 [ 7 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