Bad DLL Calling Convention
Author |
Message |
James Stevenso #1 / 7
|
 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 |
|
 |
Doug Marquard #2 / 7
|
 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 |
|
 |
Jonathan Woo #3 / 7
|
 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 |
|
 |
James Stevenso #4 / 7
|
 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 |
|
 |
Doug Marquard #5 / 7
|
 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 |
|
 |
Chris Kaczo #6 / 7
|
 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 |
|
 |
Jonathan Woo #7 / 7
|
 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 |
|
|
|