Bad DLL Calling Convention Error 
Author Message
 Bad DLL Calling Convention Error

I am getting this error when returning from the following procedure which
simply loads a bitmap into a DX surface.  The LoadSurfaceFromFile function
executes successfully and the d3dximage_info is populated with correct

This only happens when I include a variable of D3DXIMAGE_INFO type in the
last parameter.  If I specify Byval 0 everything is okay.

No errors are raised, the error happens on the Exit Function line.  Actually
if I just bypass the error my program still works okay.  I am able to use
CopyRects and view the bitmap.

The documentation on d3dximage_info indicates it contains 5 elements, but
the object browser only shows 4. There is no Format element.

I am using Windows 98 so I can't view any debug output.

Is there anything I am missing?

Public Function CreateSurface() As Boolean
    On Error GoTo ErrorHandler

    Dim udtInfo As D3DXIMAGE_INFO
    Dim udtDisplayMode As D3DDISPLAYMODE

    Call objDevice.GetDisplayMode(udtDisplayMode)

    Set objSurface = objDevice.CreateImageSurface(256, 256,

    If Not objSurface Is Nothing Then
        Call objDXUtils.LoadSurfaceFromFile(objSurface, ByVal 0, ByVal 0,
"C:\Projects\Textures\bark.bmp", ByVal 0, D3DX_FILTER_NONE, 0, udtInfo)
    End If

    CreateSurface = True


    Exit Function

    CreateSurface = False
    Debug.Print "CreateSurface Error "; Err.Number, Err.Description
    Resume ExitPoint
End Function

Sat, 08 May 2004 15:02:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Bad DLL calling convention (error 49)

2. Bad DLL calling convention error in VB4.0 IDE but works as .EXE

3. Bad DLL calling convention (Error 39)

4. Bad DLL calling convention error message in VB4.0

5. PtInRect - bad dll calling convention error

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

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

8. VB Error: "Bad DLL Calling Convention"

9. Error 49: Bad Dll Calling convention

10. Help Re: error 49 Bad DLL calling convention

11. Error 49 -- Bad DLL Calling Convention

12. error 49 - bad dll calling convention


Powered by phpBB® Forum Software