Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Untraceable Error

Status
Not open for further replies.

01310564

Programmer
Oct 9, 2003
96
GB
Hi

I really hope that you can help this is driving me insane

When i run my app i get an error:


An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll

Additional information: Cast from string ""07/06/2004" to type 'Integer' is not valid.


I click on break expecting it to tell me where i made the mistake but it gives me anouther message box


There is no source code available for the current location.


I click on show disassembly and i get the following code


00000000 push ebp
00000001 mov ebp,esp
00000003 sub esp,20h
00000006 push edi
00000007 push esi
00000008 push ebx
00000009 mov dword ptr [ebp-8],0
00000010 mov dword ptr [ebp-14h],ecx
00000013 mov dword ptr [ebp-18h],edx
00000016 mov dword ptr [ebp-1Ch],0
0000001d mov dword ptr [ebp-20h],0
00000024 call FFFFDCD0
00000029 mov esi,eax
0000002b mov dword ptr [ebp-1Ch],esi
0000002e mov edx,dword ptr [ebp-14h]
00000031 mov ecx,dword ptr [ebp-1Ch]
00000034 call 0010F193
00000039 mov esi,eax
0000003b mov edx,dword ptr [ebp-18h]
0000003e mov ecx,esi
00000040 mov eax,dword ptr [ecx]
00000042 call dword ptr [eax+00000118h]
00000048 nop
00000049 jmp 00000056
0000004b mov dword ptr [ebp-20h],eax
0000004e mov ecx,dword ptr [ebp-20h]
00000051 call 755A59C0
00000056 nop
00000057 pop ebx
00000058 pop esi
00000059 pop edi
0000005a mov esp,ebp
0000005c pop ebp
0000005d ret


I haven't got a clue what this means can someone please help.

Cheers,
 
Put a Try..Catch block at the entry point to your program (sub main??). The exception object will have the stacktrace, which you can use to find out where the problem lies in your code.
Code:
Try

   ' Do main part of app here

Catch (System.Exception ex)
  ' Display stacktrace
  Console.WriteLine(ex.StackTrace)
End Try
Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top