Results 1 to 8 of 8

Thread: Error

  1. #1

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407

    Talking Error

    When I load my program i get an error that says, "Object variable or with block variable not set"..what exactly does that mean? just that i didnt set a variable and it doesnt know what to do?

  2. #2
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    You might probably doing sth liek this:


    VB Code:
    1. Dim obj as MyClass
    2.  
    3.  
    4. obj.ShowMsg "Hello"


    where you should do sth like this:

    VB Code:
    1. Dim obj as MyClass
    2.  
    3. [b]Set obj = new MyClass[/b]
    4.  
    5. obj.ShowMsg "Hello"
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  3. #3
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Basically means that you are trying to reference an objects properties or methods before it has been instanciated.

  4. #4
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Thanx for the english version, Lethal... I was lookin' for the better way to explain it, but you beat me
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  5. #5

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    well i tried doing stuff in directx like...

    VB Code:
    1. dim Dx as DirectX8
    2. dim D3D as Direct3d8
    3. dim D3DDevice as direct3ddevice8
    4.  
    5. Private Sub Form_load()
    6.      d3ddevice.createimagesurface 1000, 1000, D3DFMT_A8R8G8B8
    7. End Sub

    and there is more code but that line gives me that error..why does it do that?

  6. #6
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Not sure which all objects are creatable or dependent objects, but try this:

    Code:
    dim Dx as DirectX8
    dim D3D as Direct3d8
    dim D3DDevice as direct3ddevice8
    
    Private Sub Form_load()
        Set d3ddevice = New direct3ddevice8  '// Create an instance of the direct3ddevice object
        d3ddevice.createimagesurface 1000, 1000, D3DFMT_A8R8G8B8
    End Sub
    Creatable objects must be instantiated with the 'New' keyword, where as non-creatable objects are basically objects that are created within a parent object. For instance, the Folder object of the File System Objects Component.

  7. #7

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    it says invalid use of procedure

  8. #8

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    it says invalid use of new keyword

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