CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    Apr 2005
    Posts
    37

    Lightbulb Debug a VC Component in VB

    How can i debug a VC COmponent(exe) in a VB Application?
    I'm calling the interface method of the component in VB Application. The values are not passed properly. SO i would like to debug. Can anyone suggest me how?
    Thanx in advance!

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Debug a VC Component in VB

    Quote Originally Posted by s01
    How can i debug a VC COmponent(exe) in a VB Application?
    I'm calling the interface method of the component in VB Application. The values are not passed properly. SO i would like to debug. Can anyone suggest me how?
    Thanx in advance!
    I don't think you debug a component like that. If you don't have the source code then there are no chances of getting past the function call.

  3. #3
    Join Date
    Apr 2005
    Posts
    37

    Re: Debug a VC Component in VB

    Quote Originally Posted by Shuja Ali
    If you don't have the source code then there are no chances of getting past the function call.
    I have the code.

  4. #4
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Debug a VC Component in VB

    Just to add to the solid advice of Shuja (as always).
    I have a couple of questions..

    Isn't there perhaps some documentation included with your VC component¿

    Are you sure you are using it properly in your VB project ¿

    When you say, you would like to debug, does it ask you to debug¿

    Do you get error messages of some sorts¿

  5. #5
    Join Date
    Apr 2005
    Posts
    37

    Re: Debug a VC Component in VB

    It does not give any error message. But the return value is empty. So i would like to debug and see whether the passed value is taken properly.

  6. #6
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Debug a VC Component in VB

    Quote Originally Posted by s01
    It does not give any error message. But the return value is empty. So i would like to debug and see whether the passed value is taken properly.
    Do you have the source code of VS Component?

    And as Hannes has suggested, go through the documentation provided by the Component vendor.

  7. #7
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: Debug a VC Component in VB

    Quote Originally Posted by Shuja Ali
    Do you have the source code of VS Component?

    And as Hannes has suggested, go through the documentation provided by the Component vendor.
    when this is a component written by yourself then you can do remote debugging in VC and using a VB demoproject where you use the component. then you can go step by step ( if you need ) through the component watching all values you need and the results. E.g. once I did a special activeX for a sort of combobox in VC and then debugging it with a VB form where only this and some textboxes and a button was there. With that I could debug all I wanted.
    For every thing, I wanted to check, I changed the VB code to my needs and then checked what the active X was doing . so I tested Adding Values to list, changing colors, Getting, losing cursor checking if events of the active X message handlers are firing to right time ... Dont check it in the original pgm where you need it it will have to much problems. Test it with quick written VB apps and when finished and all works fine then it should do its job also in the real app where you need the code.
    Add hint: when you have troubles with the interface have a look onto .idl or .odl files of your C++ application. Such files can be debugged generally only in a C enviroment using Vb as a test- surface.
    ( Dont know how to express this better in English ) If the code is not written by you and you dont have much experience in VC++ COM and /or DCOM techniques, I wouls say forget it.
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

  8. #8
    Join Date
    Apr 2005
    Posts
    37

    Re: Debug a VC Component in VB

    Quote Originally Posted by JonnyPoet
    when this is a component written by yourself then you can do remote debugging in VC and using a VB demoproject where you use the component.
    Yes, its a component written by me. I would like to know how to debug remotely. Are there any steps for doing that?

  9. #9
    Join Date
    Oct 2005
    Location
    India
    Posts
    24

    Re: Debug a VC Component in VB

    I think you cannot debug your cmponent if it is in the binary format.If you are having the source then you can.But with binary you cannot.

  10. #10
    Join Date
    Apr 2005
    Posts
    37

    Re: Debug a VC Component in VB

    Quote Originally Posted by trends
    If you are having the source then you can.
    I do havethe source for the component. Can i put breakpoints in VB as well as in VC Code and debug?

  11. #11
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Debug a VC Component in VB

    Quote Originally Posted by s01
    I do havethe source for the component. Can i put breakpoints in VB as well as in VC Code and debug?
    No. You can't do that. There is no Interoperability between VC and VB at the code level.
    Last edited by Shuja Ali; January 2nd, 2006 at 07:04 AM.

  12. #12
    Join Date
    Apr 2005
    Posts
    37

    Re: Debug a VC Component in VB

    Can i change the debug file to the VB exe in the VC Component and debug?

  13. #13
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Debug a VC Component in VB

    Quote Originally Posted by s01
    Can i change the debug file to the VB exe in the VC Component and debug?
    Well I have never tried it myself.
    Why don't you create a dummy project in VC itself and add the source file of your component to that project and then debug it. That would be better.

  14. #14
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: Debug a VC Component in VB

    Quote Originally Posted by s01
    I do havethe source for the component. Can i put breakpoints in VB as well as in VC Code and debug?
    Yes you can. Do you have two PC's ? You will need them.
    If you have VS 7.0 e.g VS2003.net as I have then write it and I'll give you a full explanation.
    Then I can give you the exact steps. Because often done. If you have VC 6.0 then you'll find a good reference in Codeproject Here is the link
    http://www.codeproject.com/debug/remotedebug.asp
    Its a bit of work for the first time but then its easy to do for each project.

    Jonny Poet
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

  15. #15
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: Debug a VC Component in VB

    Quote Originally Posted by Shuja Ali
    Well I have never tried it myself.
    Why don't you create a dummy project in VC itself and add the source file of your component to that project and then debug it. That would be better.
    I have tested ActiveX components written for VB in the VC enviroment and they worked , then I tested in the testconsole which is a total other enviroment for the activeX and got other problems handled by that. Most startup troubles of my ActiveX I'm testing there. If you need them in VB you need VB at least as a container for the ActiveX because all functionallity which is using functionallity regarding Ambient Properties like enviroment colors, transparency ... needed to be checked that way.
    Any you can be sure, at least if you will use it in a website ( no discussion please if this is useful or secure ) then this container will give you a totally other behaviour , e.g. choosing Fonts which maybe worked best in VC++ enviroment , VC-testing container and VB, suddenly doesn't work if you do your activeX on a webpage and dont have the correct interface implemeted for that. Uuuups. I have had all that things during learning creating activeX in VC++. But this can be done and for a C++ programmer it should not be to difficult to do the setup.
    If needed as told in another post I'll help if you have VC++ 7.0 which is shipped with VS 2003 .net

    Jonny Poet
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

Page 1 of 2 12 LastLast

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

Featured