×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Automation Error

Automation Error

Automation Error

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close