+ Reply to Thread
Results 1 to 2 of 2

Compile Error Argument Not optional

  1. #1

    Compile Error Argument Not optional

    Hey hears the code and the message i get with it is Compile Error
    Argument not opional

    Private Function LoadSurface(ByVal filename As String) As
    Direct3DSurface8
    On Local Error GoTo fatal_error
    Dim surf As Direct3DSurface8

    'return error by dfault
    Set LoadSurface = Nothing

    'creat the new surface
    Set surf = d3ddev.CreateImageSurface(SCREENWIDTH, SCREENHEIGHT,
    dispmode.Format)
    If surf Is Nothing Then
    MsgBox "Error creating surface!"
    Exit Function
    End If

    'load surface from file
    d3dx.LoadSurfaceFromFile _ (.LoadSurfaceFromFile_ Is where it is
    hilighted )
    surf , _
    ByVal 0, _
    ByVal 0, _
    filename, _
    D3DX_DEFAULT, _
    0, _
    ByVal 0

    If surf Is Nothing Then
    MsgBox "Error loading " & filename & "!"
    Exit Function
    End If

    'return the new surface
    Set LoadSurfacce = surf

    fatal_error:
    Exit Function
    End Function

    Anything ELSE WRONG with this code please tell.


  2. #2
    Bob Phillips
    Guest

    Re: Compile Error Argument Not optional

    Bit of a guess but

    d3dx.LoadSurfaceFromFile _
    surf , _
    0, _
    0, _
    filename, _
    D3DX_DEFAULT, _
    0, _
    0

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    <[email protected]> wrote in message
    news:[email protected]...
    > Hey hears the code and the message i get with it is Compile Error
    > Argument not opional
    >
    > Private Function LoadSurface(ByVal filename As String) As
    > Direct3DSurface8
    > On Local Error GoTo fatal_error
    > Dim surf As Direct3DSurface8
    >
    > 'return error by dfault
    > Set LoadSurface = Nothing
    >
    > 'creat the new surface
    > Set surf = d3ddev.CreateImageSurface(SCREENWIDTH, SCREENHEIGHT,
    > dispmode.Format)
    > If surf Is Nothing Then
    > MsgBox "Error creating surface!"
    > Exit Function
    > End If
    >
    > 'load surface from file
    > d3dx.LoadSurfaceFromFile _ (.LoadSurfaceFromFile_ Is where it is
    > hilighted )
    > surf , _
    > ByVal 0, _
    > ByVal 0, _
    > filename, _
    > D3DX_DEFAULT, _
    > 0, _
    > ByVal 0
    >
    > If surf Is Nothing Then
    > MsgBox "Error loading " & filename & "!"
    > Exit Function
    > End If
    >
    > 'return the new surface
    > Set LoadSurfacce = surf
    >
    > fatal_error:
    > Exit Function
    > End Function
    >
    > Anything ELSE WRONG with this code please tell.
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1