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!
[245 byte] By [s01] at [2007-11-19 17:02:22]
# 1 Re: 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!
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.
Shuja Ali at 2007-11-9 20:20:57 >
# 2 Re: Debug a VC Component in VB
If you don't have the source code then there are no chances of getting past the function call.
I have the code.
s01 at 2007-11-9 20:22:02 >
# 3 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
HanneSThEGreaT at 2007-11-9 20:23:01 >
# 4 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.
s01 at 2007-11-9 20:24:00 >
# 5 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.
Do you have the source code of VS Component?

And as Hannes has suggested, go through the documentation provided by the Component vendor.
Shuja Ali at 2007-11-9 20:25:04 >
# 6 Re: Debug a VC Component in VB
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 :cry: forget it.
JonnyPoet at 2007-11-9 20:26:03 >
# 7 Re: Debug a VC Component in VB
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?
s01 at 2007-11-9 20:27:01 >
# 8 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.
trends at 2007-11-9 20:28:04 >
# 9 Re: Debug a VC Component in VB
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?
s01 at 2007-11-9 20:29:02 >
# 10 Re: Debug a VC Component in VB
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.
Shuja Ali at 2007-11-9 20:30:12 >
# 11 Re: Debug a VC Component in VB
Can i change the debug file to the VB exe in the VC Component and debug?
s01 at 2007-11-9 20:31:11 >
# 12 Re: Debug a VC Component in VB
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.
Shuja Ali at 2007-11-9 20:32:09 >
# 13 Re: Debug a VC Component in VB
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
JonnyPoet at 2007-11-9 20:33:15 >
# 14 Re: Debug a VC Component in VB
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. :sick: 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
JonnyPoet at 2007-11-9 20:34:15 >
# 15 Re: Debug a VC Component in VB
No. You can't do that. There is no Interoperability between VC and VB at the code level.I dont know for VC 6.0, but with VC 7.0 I'm totally sure you can do it. I have done different times. Even without real 'remote control' but on the same machine using VB as a container. You even can edit your VB program during test phase and setting breakpoints. Best way doing that ( for easy setup is having two screens on one graphic card , because of graphic reasons place needed for VB compiler should not interfere Space for VC compiler or you canot debug drawing functions. Debugging keyboard depending functionallity or focus depending functionallity you NEED to have a separate PC and remote debug with two different keyboards. And in that case I think its easier to have the VB testcontainer as a compiled testprogram. because of setup needs to register the ocx (which needs to be tested) on both PC's. So you can call it from both machines.
JonnyPoet at 2007-11-9 20:35:13 >
# 16 Re: Debug a VC Component in VB
No more questions about this ??
JonnyPoet at 2007-11-9 20:36:17 >