Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automation Error

Status
Not open for further replies.

aaahhhrrggghhhh

Programmer
Apr 5, 2002
61
IE
Hi.

I am just learning to use DirectX and have tried the following code (VB). I am using VB6 on WinXP. I have checked the boxes for :

DirectX7 for Visual Basic Type Library ... and
DirectX8 for Visual Basic Type Library.

I get the error :

Runtime error '-2005532460 (887600d4)'
Automation Error

on the CreateSurfaceFromFile Line. I have tried CreateSurface, but still receive the same error.

What to do?
Mr Unhappy.

The code is :

Private Sub Form_Load()

Dim oDX As DirectX7
Dim oDD As DirectDraw7
Dim oDDS As DirectDrawSurface7
Dim oDDSD As DDSURFACEDESC2

Set oDX = New DirectX7
Set oDD = oDX.DirectDrawCreate("")

With oDDSD

.lFlags = DDSD_CAPS Or DDSD_WIDTH Or DDSD_HEIGHT
.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN
.lWidth = Me.OLEUnbound1.Width
.lHeight = Me.OLEUnbound1.Height

End With

Set oDDS = oDD.CreateSurfaceFromFile("c:\winnt\backgrounds\nicksian.bmp", oDDSD)

End Sub
Dont be small. be BIG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top