Results 1 to 8 of 8

Thread: Errorr!!!!!

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2003
    Location
    Holland
    Posts
    36

    Errorr!!!!!

    I'm making a little game in DirectX.

    I have made a UDT:

    Type Surface
    Surface As DirectDrawSurface7
    DDSD As DDSURFACEDESC2
    DestRect As RECT
    ScrRect As RECT
    Transparend As Boolean
    Collision As Boolean
    Height As Integer
    Width As Integer
    X As Integer
    Y As Integer
    CKey As DDCOLORKEY
    End Type

    I'v declared it

    Dim Background As Surface

    Now, if I try to make it as Surface

    Set Background.Surface = dd.CreateSurfaceFromFile("C:\MainMenu.bmp", Background.DDSD)

    I get an error!!!!!!!!!!!!


    Like so:

    Object variable or With block variable not set.

    I don't know what's it.

    how can help me??????
    Last edited by StevenVeer; Mar 18th, 2003 at 07:34 AM.

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    The 2nd value has to be a ddssurfacedesc, I believe.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2003
    Location
    Holland
    Posts
    36
    It is an DirectDrawSurfaceDesc ,this is shorter

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    But you have to make one! The DDSD property only returns a reference to the ddsurfacedesc used to create it! In this, you are trying to get the surfacedesc from the same DirectDrawSurface you are trying to create, and it fails because it has not yet been created.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5

    Thread Starter
    Member
    Join Date
    Mar 2003
    Location
    Holland
    Posts
    36
    I did create a DDSURFACEDESC in my UDT:
    VB Code:
    1. Type Surface
    2. Surface As DirectDrawSurface7
    3. DDSD As DDSURFACEDESC2

    Dim Background as Surface

    now i have:
    VB Code:
    1. Background.Surface.SetColorKey
    2. Background.DDSD.ddsCaps.lCaps
    3. Background.DestRect.Bottom
    4. Etc.

    (i have made a little change in the first Post)

    Set Background.Surface = dd.CreateSurfaceFromFile("C:\MainMenu.bmp", Background.DDSD)

  6. #6

    Thread Starter
    Member
    Join Date
    Mar 2003
    Location
    Holland
    Posts
    36
    Here's my project then you wil see everything of it:

  7. #7

    Thread Starter
    Member
    Join Date
    Mar 2003
    Location
    Holland
    Posts
    36
    Here's my project then you wil see everything of it.
    It's an self-extractor.

    I hope yoou can help me

  8. #8

    Thread Starter
    Member
    Join Date
    Mar 2003
    Location
    Holland
    Posts
    36
    Here's my project then you wil see everything of it.
    It's an self-extractor.

    I hope you can help me
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width