SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

teh ubern00b???

Last post 08-26-2006 3:21 PM by UncleBob. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 08-21-2006 8:48 PM

    teh ubern00b???

    hmmm, it´s a while ago since I did some VB-code, and somehow it doesn´t seem to work anymore quite the way it did...

     

    Problem: I create a class, I define a public instance and then access one of the classes functions... no problems while building, but it won´t run the bloody thing. it stops at the remote.dll, with following message:

    Exception System.NullReferenceException was thrown in debuggee:
    Object reference not set to an instance of an object.

    MainFormLoad() - C:\Dokumente und Einstellungen\Jedidia\Eigene Dateien\SharpDevelop Projects\trythisshit\MainForm.vb:30,3
    OnLoad()
    OnCreateControl()
    CreateControl()
    CreateControl()
    WmShowWindow()
    WndProc()
    WndProc()
    WndProc()
    WmShowWindow()
    WndProc()
    OnMessage()
    WndProc()
    DebuggableCallback()
    SetVisibleCore()
    SetVisibleCore()
    set_Visible()
    RunMessageLoopInner()
    RunMessageLoop()
    Run()
    OnRun()
    DoApplicationModel()
    Run()
    Main() - 17d14f5c-a337-4978-8281-53493378c1071.vb:81,13

    what the hell´s wrong?? 

    Filed under:
  • 08-21-2006 10:34 PM In reply to

    Re: teh ubern00b???

    As far as I know, VB.net ain't exactly the same as VB.

     

    Only coded in C# myself so far, and although there are a lot of similarities with C++, there are quite some differences too. 

  • 08-22-2006 8:07 AM In reply to

    • GoMa
    • Top 25 Contributor
    • Joined on 04-12-2006
    • Posts 80

    Re: teh ubern00b???

    It will help if you include the code in your OnLoad method. If all you're doing in that method is calling a class's methods, it seems that maybe you did not create an instance of the class using the New keyword. The NullReferenceException means you have tried to call a method on a variable that doesn't actually contain a reference instantiated class.

  • 08-24-2006 11:59 AM In reply to

    Re: teh ubern00b???

    the NEW-keyword, ey? well, that´s new indeed! but it wors, thanks for the hint!

     

    But I´ve allreadygot the next Problem. In good old VB you could very easily define custom datatypes, like example 

     

    Public type MyType

    MTname as string

    MTsumm as integer

    end type

     

    thius would give you a Type with the Properties MTname and MTsumm. This doesn´t seem to be woring anymore in VB.net. how do I have todo it?? 

  • 08-25-2006 8:00 PM In reply to

    • GoMa
    • Top 25 Contributor
    • Joined on 04-12-2006
    • Posts 80

    Re: teh ubern00b???

    Use "Struct" or "Class" instead of "type". Read more about it in MSDN.
  • 08-26-2006 3:21 PM In reply to

    Re: teh ubern00b???

    thanks!
Page 1 of 1 (6 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.