rifter1818 Posted February 17, 2004 Posted February 17, 2004 Object refrence not set to an instance..... So i click break (using vb.net) next popup says there is no source code available for the current location!? Quote
rifter1818 Posted February 17, 2004 Author Posted February 17, 2004 Finnally found it frmmain = new form creates the object not set to an instance error.... BUT THATS WHERE IM SETTING THE INSTANCE.. Ugg,.. any ideas folks? Quote
Administrators PlausiblyDamp Posted February 17, 2004 Administrators Posted February 17, 2004 Could you post the code in question? It makes it a lot easier for people to help.... Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
rifter1818 Posted February 17, 2004 Author Posted February 17, 2004 Imports WindowsApplication3.Dx9 Public Module ModMain Public D3d As New Direct3d Public frmMain As New Form Public WithEvents Tmr As Timer Public Sub Main() Dim Video As New Video("C:\1.asf") Dim Audio As New Audio("C:\song_1.mid", True) Tmr = New Timer Tmr.Interval = 6000 AddHandler Tmr.Tick, AddressOf EXITGAME frmMain.WindowState = FormWindowState.Maximized frmMain.Show() 'error Dim pp As New Microsoft.DirectX.Direct3D.PresentParameters pp.Windowed = False pp.BackBufferCount = 1 pp.BackBufferFormat = Microsoft.DirectX.Direct3D.Format.X8R8G8B8 pp.BackBufferHeight = 768 pp.BackBufferWidth = 1024 pp.SwapEffect = Microsoft.DirectX.Direct3D.SwapEffect.Copy If Not D3d.Initialize(frmMain, pp, 0, Microsoft.DirectX.Direct3D.DeviceType.Hardware, Microsoft.DirectX.Direct3D.CreateFlags.SoftwareVertexProcessing) Then Debug.WriteLine("Failed Once") End If Audio.Play() AddHandler Video.Ending, AddressOf EXITGAME D3d.PlayVideo(Video) Tmr.Enabled = True End Sub Public Sub EXITGAME(ByVal sender As Object, ByVal e As EventArgs) End End Sub End Module its now saying that the form doesnt have an instance and frmmain.show Quote
ThePentiumGuy Posted February 18, 2004 Posted February 18, 2004 im not sure if that'd work.. try Public FormMain as WindowsApplication3 '(im assuming this is the name of your form because it says it at the top :-)) and then FormMain.Show might work Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Administrators PlausiblyDamp Posted February 18, 2004 Administrators Posted February 18, 2004 Is there any code in the frmMains Load event? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
rifter1818 Posted February 18, 2004 Author Posted February 18, 2004 Theres no Form1_load event actually, its a module dispite the name, i loaded it as a form but deleted the code and created a module latter,.... Quote
rifter1818 Posted February 18, 2004 Author Posted February 18, 2004 (edited) NEW AND IMPROVED ERROR Fixed the old one try frmmain.show catch frmmain = new form frmmain.show end try Now an even better one,... Debug.writeline("1") returns the same error (object not set to an instance....) ive tried adding an imports system.diagnostics but that didnt help,.. HELP Note the Debug line comes in right after the end try..... Just trying to see how far it gets before it crashes.... Edited February 18, 2004 by rifter1818 Quote
AFterlife Posted February 19, 2004 Posted February 19, 2004 Are you trying to show an existing form? If so providing frmMain is your form..... dim myForm as new frmMain myform.show myform is instantiated and shown here. Although it is really frmMain. Quote
Administrators PlausiblyDamp Posted February 19, 2004 Administrators Posted February 19, 2004 If frmMain isn't a form but a module is there any code in it's Show method? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
rifter1818 Posted February 20, 2004 Author Posted February 20, 2004 I Allready fixed that error note my post above the new problem is the debug.writeline("1") is causing the same error?! Quote
*Experts* Nerseus Posted February 20, 2004 *Experts* Posted February 20, 2004 Maybe you should show your code again. I'm confused if you're saying frmMain is or is not a form. I think frmMain is a form and ModMain is your module. Maybe start commenting out code as well, such as Audio and Video, and see if that helps - try narrowing down the problem until you can see what's causing the error. -nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
rifter1818 Posted February 20, 2004 Author Posted February 20, 2004 Final Post I eventually gave up and created a new project which works (well that part does at least the videos still messed up but thats a different post and section (directx)), Anyways the wierd thing is that copy/paste the code into a new project fixed the error. Sorry to bother you all on a wild goose chase like this but thanks very much for your help with this and many other problems i run into. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.