Results 1 to 8 of 8

Thread: How To Debug .Net Component in VB6.0

  1. #1

    Thread Starter
    Hyperactive Member nazeem_khan's Avatar
    Join Date
    Nov 2002
    Location
    India
    Posts
    305

    How To Debug .Net Component in VB6.0

    Hi 2 All,

    I have a .Net Component written in VC++.Net and it is used in the VB6.0. One of the method in the Net Component is raising an exception. I want to see the code that raises the exception. So I decided to debug the component. But i couldnt do that, bcoz it is written in .Net and the environment that i am using is VB6.0. Any solutions for this.

    Nazim.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Yes you can buy .NET and debug it from that other than that you kind of screwed, sorry.

  3. #3

    Thread Starter
    Hyperactive Member nazeem_khan's Avatar
    Join Date
    Nov 2002
    Location
    India
    Posts
    305
    I have .Net Installed on my system. What i really want is that the component is used in vb6.0 and wanna to debug the component.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by nazeem_khan
    I have .Net Installed on my system. What i really want is that the component is used in vb6.0 and wanna to debug the component.
    Not sure exactly what this mean but did you write any error handlers for all the methods exist in the component ?( I think) C++.NET provides more informative error messages using tracers and stack which will be so helpful .

  5. #5

    Thread Starter
    Hyperactive Member nazeem_khan's Avatar
    Join Date
    Nov 2002
    Location
    India
    Posts
    305
    see...somebody had wrote the .Net component in VC++. I am using that component in the VB6.0 Application. When i am calling method x(), there is some place it throws the userdefined error. But the function seems to be working well. I want to know which code actually causes the exception. For that i need to debug the component source code (which i have it). Is there any way to find the bug in real time...

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by nazeem_khan
    see...somebody had wrote the .Net component in VC++. I am using that component in the VB6.0 Application. When i am calling method x(), there is some place it throws the userdefined error. But the function seems to be working well. I want to know which code actually causes the exception. For that i need to debug the component source code (which i have it). Is there any way to find the bug in real time...
    Not if you didn't handled that from the source of error .
    Did you try any debugging tool like call stack , watches in the IDE and I believe there are some API that do the same(get some info about error thorwn , I don't recommend this though) . But as I've said , surround the code you suspect it throws an error and bring an informative msg using different methods in the exception obj .

  7. #7

    Thread Starter
    Hyperactive Member nazeem_khan's Avatar
    Join Date
    Nov 2002
    Location
    India
    Posts
    305
    Thanx for the replies Pirate. But i think nobody got the problem. see, assume that u have got the .net component and its source code. Now ur using that .net component in vb 6.0 application. Suddenly there is one method throwing the application. that method has 15 lines of coding. There is a exception handlere for this method which throws the exception back to the caller to handle it. Now, my problem is i wanna to know in that methid which line is failing. for that i need to debug. but it is written in .net. whereas the application i am using is vb 6.0. how do i debug or trace that .net component method, where it is failing.

    Nazim.

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I didn't test this code , so I don't know if it's of any help but it's just to show you the idea .
    Try this in a VB.NET proj to test if it's throwing the same error at the same action in VB6 .

    VB Code:
    1. Dim mthod As Reflection.MethodBase
    2.  
    3.         Try
    4.         Catch ex As Exception
    5.             'Get description of this error
    6.             MessageBox.Show(ex.Message)
    7.  
    8.             mthod = ex.TargetSite
    9.             'Get the name of the method that throw the exception
    10.             MessageBox.Show(mthod.Name())
    11.  
    12.         End Try

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width