Click to See Complete Forum and Search --> : Debugging with Visual Studio


Eric Nielsen
June 21st, 2001, 01:40 PM
Can anyone help?

I've got a VB6 DLL that I am trying to debug in MS Visual Studio without any success. I have created a development project which includes my DLL project as a project group. I declare an instance of my DLL object in my test form.

When I attempt to debug, the debugger steps right over the DLL method I want to debug. How do I step INTO my DLL method?

Thanks!

Eric

cksiow
June 21st, 2001, 07:21 PM
what is need to do is to have a project group. Okay, just start up your DLL project in VB, then add a new project (from file men), which is your test program, then when you open up your project reference menu, make a reference to you current DLL, not the one already compiled. then you can step into the DLL code.


HTH

cksiow
http://vblib.virtualave.net - share our codes

Eric Nielsen
June 22nd, 2001, 11:22 AM
> what is need to do is to have a project group. Okay, just start up your DLL
> project in VB, then add a new project (from file men), which is your test
> program, then when you open up your project reference menu, make a reference
> to you current DLL, not the one already compiled. then you can step into the
> DLL code.

I have tried that: In VS you have to designate one of the projects in the group as the startup project. If I make the DLL project the startup project, when I RUN, nothing happens because it's trying to run the DLL as an EXE. If I make my test project the startup, then I have the same issue as earlier stated: the debugger steps right through the DLL code without breaking.

Question: You said to add a reference to the DLL project. How do I do that? I have gone into the Project/References... menu, but the only option I find there is to add a reference to my compiled DLL. I suspect this is the key to my problem, but I don't know how to add the required reference to my test project group. Can you explain how to do this? Thanks!!

Eric

Clearcode
June 22nd, 2001, 11:56 AM
make sure that your calling project is selected in the IDE and select the menu "Project|References"

On the list that appears, uncheck the reference to your DLL and press OK.

Then select the menu "Project|References" again. Immediately below all the checked references will be a reference to the other loaded project - check this and press OK again.

Now run your project - it will step into the dll project code when it gets there.

HTH,
Duncan

-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com

Eric Nielsen
June 22nd, 2001, 12:33 PM
Well, I have done as described with still no luck. Is there any chance that a property setting at the project or IDE is incorrect?

Here's a little more detail and my sample code:

I am trying to develop a customized network browser. The app I am working on allows the user to store projects both on the local HD and on a server. The app remembers both paths. A problem arises if the server path is not availabled for some reason and the user tries to access or change it.

I have tried to emulated the MS Common Dialog to create a Directory Browser. I created a DirDialog class object which opens a VB form with DirList/FileList components and a button to bring up a network browser. Fairly simple, really. The class has a couple properties to set the form title and initial directory. It also has a ShowOpen method that returns the user's selected path.

My test project declares an instance of my class object and exercises it thusly:


private Sub cmdTestDir_Click()
on error GoTo cmdTestDir_Click_Error
Dim strPath as string
Dim dlg as new DirDialog

dlg.Title = "Directory Selection Test"
dlg.InitDir = me.InitPath
strPath = dlg.ShowOpen

If strPath <> "" then MsgBox "Selected path: " & strPath


Exit Sub

cmdTestDir_Click_Error:
If Err.Number = 52 then
me.InitPath = "c:\program files"
resume 0
else
MsgBox Err.Number & vbCrLf & Err.Description
End If
End Sub





I don't know if this has any bearing on the problem but my test form does not actually contain any control from the DLL. It simply declares an instance of the DLL class, which then in turn opens a VB form.

As always, any help is greatly appreciated.

Eric

As a PS: I could simply use the MS Common Dialog if you could use it as a path selector instead of a file selector. The ShowOpen method of the MSCD requires that you make a file selection...if you just use it to browse to a desired path and select Open it returns an empty string in the FileName property. So if anyone knows how to use the Common Dialog to select a path only, that would be useful info too. Thanks again!