Claes
I appreciate your time and effort.
I performed the tasks you suggested. And sure enough it trapped an error
occurring when trying to display form in DesignMode. I recieved the
following error:
A first chance exception of type 'System.NullReferenceException' occured
in
microsoft.visualstudio.dll.
Additional Information: Object reference not set to an instance of an
object
Below is the disassembly of the offending code:
00000000 push eax
00000001 push edi
00000002 push esi
00000003 push ebx
00000004 push ebp
00000005 mov dword ptr [esp+10h],edx
00000009 mov edi,ecx
0000000b mov ecx,edi
0000000d call dword ptr ds:[7A59466Ch]
00000013 xor ebx,ebx
00000015 mov ebp,dword ptr [edi+0Ch]
00000018 xor esi,esi
0000001a cmp dword ptr [ebp+4],0
0000001e jle 00000044
00000020 cmp esi,dword ptr [ebp+4]
00000023 jae 0000004C
00000025 mov eax,dword ptr [ebp+esi*4+0Ch]
00000029 mov edx,dword ptr [eax+4]
0000002c push dword ptr [esp+10h]
00000030 mov ecx,edi
00000032 call dword ptr ds:[7A594348h]
00000038 cmp eax,ebx
0000003a jle 0000003E
0000003c mov ebx,eax
0000003e inc esi
0000003f cmp esi,dword ptr [ebp+4]
00000042 jl 00000020
00000044 mov eax,ebx
00000046 pop ebp
00000047 pop ebx
00000048 pop esi
00000049 pop edi
0000004a pop ecx
0000004b ret
0000004c xor ecx,ecx
0000004e call dword ptr ds:[7A5A79E4h]
00000054 int 3
The line where the error occured is
0000001a cmp dword ptr [ebp+4],0
Now only if I knew what the heck that means (lol).
Any ideas on what is causing the error? What is throwing the
'System.NullReferenceExceptio'? How to correct the problem?
Once again, I really to appreciate all your time and effort.
Tom
(e-mail address removed)
Claes Bergefall said:
That sounds really strange. Try debugging the design time
environment:
1. Start a new instance of Dev Studio
2. Select "Debug Processes..." on the Tools menu
3. Select the previously running instance of devenv.exe
(the one where your project is open) and press Attach
4. Check the "Common Language Runtime" checkbox
and press OK
5. Press Close
Using this new instance of Dev Studio you can now set
breakpoints in your code and examine its data etc.
I would start by having it break into the debugger when
an exception is thrown. You can set this up through
the "Exceptions..." on the Debug menu. Highlite "Common
Language Runtime Exceptions" in the list, select "Break
into the debugger" in the top group box ("When the exception...")
and then press OK. Now go back to the instance where your
project is and open the form in the designer. This should cause
the new instance to break into the debugger. It will probably
show an assembler window so you might need open the source
file manually though.
/claes
Claes
I did not post the code within the procedure cause I currently have it all
commented out. I get the error message just the following in my code:
Private Sub m_C_EvaluationStatus_EvaluationRequest(ByVal EvaluationID
As
Long) Handles m_C_EvaluationStatus.EvaluationRequest
End Sub
Which is the cause of my confusion. I select the object from the dropdown
on the left and then the event from the dropdown on the right. The above
code appears as it should, but then I can no longer view the design of my
MDI
form until I place a comment before "Handles".
It is really really strange.
Hope this sheds a little more light on the problem I am experiencing.
Tom
(e-mail address removed)
:
You're probably doing something in your event handler that
doesn't work in design mode. Since you didn't post the code
I can't help you very much. Try using the DesignMode
property to wrap the code
/claes
Hello
I am writing an application with VS 2003 VB.Net. I am getting the
error
message "Object reference not set to an instance of an object" in the
design
environment when trying to view a form in design mode.
I have traced when this happens but I can not figure out why it
happens.
I have an MDI form which declares a variable as follows:
Private WithEvents m_C_EvaluationStatus As EvaluationStatus
Where EvaluationStatus is a class. Within my MDI form i have a
procedure
to
capture an event fired within the class as follows:
Private Sub m_C_EvaluationStatus_EvaluationRequest(ByVal
EvaluationID As
Long) Handles m_C_EvaluationStatus.EvaluationRequest
.. Code to process event
End Sub
I get the error message when ever I have this procedure within the MDI
form
and can no longer view the MDI form in design mode. If I comment out
the
"Handles m_C_EvaluationStatus.EvaluationRequest", then everything is
back
to
normal in design environment, but no longer processing event at run
time.
Can anyone tell me why I am getting the error message "Object
reference
not
set to an instance of an object"?
Thanks in advance.
Tom
(e-mail address removed)