473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Error in showdialog of form.

Hi all
I am new to vb.net application.
I am using showdialog property of form to display form.
First time it is working properly.
But next time it is giving me error that ' object reference not set to
an instance of an object'.

When i went through stacktrace, i found that it is giving error in
showwindow.
I am not getting why it is happening.
Can some one tell me reason behing this.
Please help me.
Thanks in advance.

Nov 21 '05 #1
4 5207
Trial,

Mostly are this kind of question easy to answer if there is some code.
How do you want us to do it now, you could have done almost everything.

However in this case have you probably set your form globally.

The most simple way is just there where you want to use it to do.

\\\
dim frm1 as new Form2
frm1.showdialog(me)
frm1.dispose
///

This saves you than as well some memory and is as efficient as any other
way.

I hope this helps,

Cor
Nov 21 '05 #2
<tr**************@yahoo.com> schrieb:
I am using showdialog property of form to display form.
First time it is working properly.
But next time it is giving me error that ' object reference not set to
an instance of an object'.

When i went through stacktrace, i found that it is giving error in
showwindow.
I am not getting why it is happening.


Please post the complete error message + callstack, if available.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3
Hi.
I am posting stacktrace as below:-
Please check this and tell me solution if u know.

Stack trace.
Object reference not set to an instance of an object. at
System.Windows.Forms.SafeNativeMethods.ShowWindow( HandleRef hWnd, Int32
nCmdShow)

at System.Windows.Forms.Control.SetVisibleCore(Boolea n value)

at System.Windows.Forms.Form.SetVisibleCore(Boolean value)

at System.Windows.Forms.Control.set_Visible(Boolean value)

at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)

at System.Windows.Forms.Form.ShowDialog()

at System.Windows.Forms.ThreadContext.OnThreadExcepti on(Exception t)

at System.Windows.Forms.Control.WndProcException(Exce ption e)

at
System.Windows.Forms.ControlNativeWindow.OnThreadE xception(Exception e)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)

at System.Windows.Forms.SafeNativeMethods.ShowWindow( HandleRef hWnd,
Int32 nCmdShow)

at System.Windows.Forms.Control.SetVisibleCore(Boolea n value)

at System.Windows.Forms.Form.SetVisibleCore(Boolean value)

at System.Windows.Forms.Control.set_Visible(Boolean value)

at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)

at form1.cDownLoader.DownLoadFile(String sRemotePath, Int64
lFileSize, String
sDate)System.NullReferenceExceptionSystem.NullRefe renceException:
Object reference not set to an instance of an object.

at System.Windows.Forms.SafeNativeMethods.ShowWindow( HandleRef hWnd,
Int32 nCmdShow)

at System.Windows.Forms.Control.SetVisibleCore(Boolea n value)

at System.Windows.Forms.Form.SetVisibleCore(Boolean value)

at System.Windows.Forms.Control.set_Visible(Boolean value)

at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)

at System.Windows.Forms.Form.ShowDialog()

at System.Windows.Forms.ThreadContext.OnThreadExcepti on(Exception t)

at System.Windows.Forms.Control.WndProcException(Exce ption e)

at
System.Windows.Forms.ControlNativeWindow.OnThreadE xception(Exception e)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)

at System.Windows.Forms.SafeNativeMethods.ShowWindow( HandleRef hWnd,
Int32 nCmdShow)

at System.Windows.Forms.Control.SetVisibleCore(Boolea n value)

at System.Windows.Forms.Form.SetVisibleCore(Boolean value)

at System.Windows.Forms.Control.set_Visible(Boolean value)

at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)

at form1.cDownLoader.DownLoadFile(String sRemotePath, Int64
lFileSize, String sDate)

Nov 21 '05 #4
<tr**************@yahoo.com> schrieb:
I am posting stacktrace as below:-
[Stacktrace]


I am curious what 'cDownLoader.DownLoadFile' does. Are you using
multithreading?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Richard L Rosenheim | last post by:
I would like to detect when a form is invoked as the result of a ShowDialog call. Anyone have any ideas or suggestions on how to do that? TIA, Richard Rosenheim
20
by: ed | last post by:
Hi I can't seem to make the Me.Show() work My code is dim dlgresult as dialogresul dlgresult=me.show( The message is : "expression does not produce a value
5
by: Josh Golden | last post by:
3 forms. form 1, when button clicked instantiates form 2 which opens but is not shown. form 2 instantiates form 3 as showdialog. form 3 finishes, raises an event that form 2 catches. during the...
0
by: Sven Franz | last post by:
I develop an MDI-Application in vb.net (2002). But I got som errors, I can`t handle. When I have opened some MDI-Children and also closed them, my application crashed when I switch to an other...
1
by: Joel Whitehouse | last post by:
Hello All, I'm haveing a problem instantiating a form. When I try to instantiate my form and call it's ShowDialog() method, I get the following error message: An unhandled exception of type...
3
by: Jorge | last post by:
Hello. I use the following instructions to create and to show the "forms": Form_Exportar Ficha = new Form_Exportar(); // Project has form_exportar Ficha.ShowDialog(); Ficha.Dispose(); ...
5
by: Miro | last post by:
I will try my best to ask this question correctly. I think in the end the code will make more sence of what I am trying to accomplish. I am just not sure of what to search for on the net. I...
4
by: active | last post by:
At the statement: FormEdit.ShowDialog() I get the following: Form that is not a top-level form cannot be displayed as a modal dialog box. Remove the form from any parent form before...
0
by: pni8ac | last post by:
Hi, I'm having a weird problem. I use a thread to generate a lot of data in c#, and at the end of the thread I sould have a messagebox that show. If I execute the code two time, everything work...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.