Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

I have a vb.net program written in window forms. And I have approximately 10+ screens. I need to switch between windows very frequently. Here's the strategy I used to go from form1 to form2:

Dim f2 as New Form2

f2.show()

hide()

 

Now the problem is that sometimes the program run perfectly fine from beginning to the end, once a while, however, it would throw the exception saying "reference obj is not set to an instance of object". Does anyone have any clue of past experience for this situation. I can't find any bugs at all, and strangly, it sometimes works fine.

 

p.s. when I run the program, I go through the same steps. So it's not because of a strange input or anything like that.

 

Any help would be greatly appreciated.

 

Lily

 

:o

Posted
On which line does this error apears ?

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Posted

thanks

 

On which line does this error apears ?

 

 

The green highlighter points to the beginning of the first form, e.g. Public class Form1. However, that's not that form I try to open when the exception happens.

And what's the reason that it just happens once a while?

 

Joanne

Posted

Few questions

 

Probably a problem with the memory or a bad coding on your side.

 

Here are my questions...

 

  1. You seem often to make window. Do you destroy them once in a while ?
  2. Can it be that you create a window more than once ?
  3. How does the memory usage and CPU usage are ? (TaskManager)

This should lead you a little bit.

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Posted

Thanks for reply again. Yes, I think that might be my problem. One time, I did get a message saying out of memory of something like that, then the computer gets very slow because cpu usage jump up to 100%. But sometimes the cpu usages is still just 1% when the program crashes.

I did receive an advice to load my forms instead of just form.show() and form.hide(), but I dont' know how to load or unlaod forms. Any advice?

 

Lily

Posted

Hi,

thank you very very much for the offer, but the size of the code is just too large to post it here. But I actually have my program uploaded to my webpage. If you have time to help, can you give me your email and I'll email you the link to my webpage. If you are busy, then don't worry about it, cuz it takes time to debug.

Arch4ngel, maybe I'll try your suggestion: Try hard... fail... try hard... fail... try hard... throw your computer by the window, maybe that can actually solve my problem.

 

Thanks, guys

Lily

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...