OutOfMemory creating a form object

G

Guest

Hi,

My name is Roby Eisenbraun Martins, I am a C++, VB and NET developer.
I am working with a NET 2002 project right now and I am receiving this
uncommon "OutOfMemory" error message when I try to load a form object ( new
frmMain() ).
In debug mode, the "Load" form method is executed but it crashes when it
tries to set a DataTable from a DataSet in a local variable. Actually the
object value in debug mode is equal to nothing.

dvEmailList = New DataView()
dvEmailList.Table = dsCandidate.S_CandidateEmails \\( dataset object )

Sometimes I got an item in the development task list window saying that
the dataset should have set to a higher priority. Is this the solution for my
problem? How can I change this priority flag?

Thank you,
Roby Eisenbraun Martins

//
// Error Trace
//

Operating System: Win32NT
Operating System Version: 5.1.2600.0; Version1.0.2118.20288 Error Message:
Error creating window handle.
Inner Error Message: Object reference not set to an instance of an object.
Extra Info:
Error Type: System.OutOfMemoryException
Error Link:
Error Source: System.Windows.Forms
Inner Error Source: Ecruit
at Ecruit.frmCandidates.frmCandidates_Load(Object sender, EventArgs e) in
C:\ecruittest\frmCandidates.vb:line 8374
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(Int32
dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x,
Int32 y, Int32 width, Int32 height, IntPtr hWndParent, IntPtr hMenu, IntPtr
hInst, Object pvParam)
at System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(Int32
dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x,
Int32 y, Int32 width, Int32 height, IntPtr hWndParent, IntPtr hMenu, IntPtr
hInst, Object pvParam)
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)Stack
Trace: at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Form.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Control.Show()
at Ecruit.clsMDIChildren.add(FormType typeID, Int32 j, Int32 loadID) in
C:\ecruittest\clsMDIChildren.vb:line 236
 
C

Cor Ligthert [MVP]

Roby,

I don't know if this is the reason of your crash however this is in my
opinon a very unconventional method to set the get an extra defaultview for
a datatable.
dvEmailList = New DataView()
dvEmailList.Table = dsCandidate.S_CandidateEmails \\( dataset
object )
More common is in VBNet
dim dvEmailList as New DataView(dvEmailList.Table)
or C#
DataView dvEmailList = new DataView(dvEmailList.Table);

Maybe you can try one of those.

Cor
 
G

Guest

Hi Cor,

Thank you for your help.
Actually the problem is the "dsCandidate.S_CandidateEmails" object. It is
= nothing and trying to use it in any sutiation will cause the crash.
And what about the priority thing? Maybe I have to force it to load ?

Thank you again,
Roby Eisenbraun Martins
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top