Link to home
Start Free TrialLog in
Avatar of talker2004
talker2004Flag for United States of America

asked on

Debugging a Com Interop dll which was executed from a vb6 applicaiton

Is there a way to debug a com interop dll which methods are being executed form a vb6 application?
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

open the .NET IDE, with the project for the COM-Interop DLL loaded.  Start either the executable program (YOurName.EXE) or open the VB6 IDE with you VB6 Application loaded.  Start the Appl;ication, and then, in the .NET IDE, choose Tools>Attach to Process.

If you started with your Application program, then you can attach to the Program's process from the list box.  If you started with the VB6 IDE, then you can attach to the VB6 Process.  Either way, you can now set breakpoints in the .NET code, which will be hit when the code gets to that line.

AW

Avatar of talker2004

ASKER

ok, i am pretty sure that i tried this exactly the way you are describing and still had some type of problem. I have worked with windows / web service applications so i am farmilair with attaching processes. I gave up on it since i had other means of debugging the code. I was  getting some type of error when i attached to the process which caused the vs.net ide to crash. I tried attaching to both the executable and the vb6 ide process. When i get a chance tomorrow i am going to fire up the vb6 / .net ide's and give it a try. If i get an error message i will post the details of it here.

The vb6 program i am attaching it to is a beast, do you think that could be the problem?

Thanks

with a web service, you need to start a separate web server, so that you can step into the web service, independent of the .NET app, or the VB6 app.

You really have 3 separate pieces :  the VB 6 part, the .NET part, and the Web Service part.

I am working with a team of about 50 developers on the largest VB6/.NET application in the world - 800,000 lines of VB6 source code, and about 2.5 million lines of .NET (mixture of VB.NET and C#), which makes up the majority of the Business tier and the Data Tier back-end.

The data tier talks to ORACLE (and in one mode of operation, to SQL Server).  Most of the User Interface is currently in VB6, though that is being migrated to .NET, as time and $$ allow.  This is the US Military Health Care system, known as AHLTA, and is a world-wide distributed Smart client application, which handles about 800,000 patient-provider interactions every week.  The system utilizes Web Services to talk to the database, which is located in Montgomery, Alabama.

We easily step through the VB6 code, into the .NET code, every day.  So I doubt that the size of your application is a source of problems.  

AW
Wow, that sounds like a pretty heafty program. It must be nice to have a large development team like that. I do point of sales software. We have myself and one vb6 developer. The source does have more than a half million lines of code in the VB6 app. They have been in business since the cobol days.

As for my problem with the crashing ide I was more concerned about some of the custom controls dll's ocx's which seem to be unstable at times. The project relies heavily on them. Maybe this is what is causing my.net ide to crash during the process attachment. Our vb6 ide crashes regularly and is reproducable by following certian series of steps or breaking on specific lines of code and stopping the project.

I am pretty much a one man show when it comes to the .net development force. I have developed windows services, web services, pocket pc,credit card,sockets,Callerid, web based ASP.Net websites. I also have experience with creating custom controls which i usually prefer to do in C#. I have had com interop dlls in our project for over two years now. I have always had to debug them before i integrated them into the vb6 project.

 I would really help me out becuase i am porting our vb6 integrated Caller ID application into .Net. The manufacturer upgrader their hardware and seems logical for me to port into .Net  since it's pretty much a rewrite. I am at least glad that you have confirmed the steps for me and i will award you the points for providing the correct solution.

If i get the error again following your steps than i will try from a fresh vb6 project. If that don't work i will try from another machine.

Thanks

ASKER CERTIFIED SOLUTION
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Some of the controls we are using were designed for vb4. Oletools, data widgets, threed, bucubed, cresent, xceed. The list keeps on going. I would say there are at minimun 50 individual custom contorols being used in the proeject and many more than that are being referenced but not being used. Some of the controls are combined inside of the same ocx's. There is nothing i can really do about that becaue the person who wrote the code pretty much calls the shots now. It seems with each new release of windows the controls become more and more unstable. They would never acknoledge this to be an acutal issue even though i could reproduce many associated problems that would not occur otherwise. These are mostley issues with the vb6 ide we have not run into too many issues with the executable.

As for me I have always had to come up with my own custom controls in my .Net framework projects.

You are absolutely correct. I was able to get this to work in a solution outside of our main project. I do consider our customer controls to be the source of instability in the program.

BTW, thanks again for your solution on my other post about building a software development team.

Glad to be of assistance.

AW