Debug VB based COM object from ASP?

G

Grant Schenck

Hello,

I'm trying to figure out how to debug a very simple COM object I developed
in VB.

I'm very new to VB and ASP so I have a lot to learn.

That said, I found what I thought was perfect article which covers this:

http://support.microsoft.com/default.aspx?scid=kb;en-us;299633#2

However, I'm running on Windows 2003 and at step 4c) I don't have an
"Internet Service Manager" but rather "Internet Information Services (IIS)
Manager". OK, fine, I assume the name changed.

However, I'm not sure what to do in step 5).

Specifically, that says:

In Internet Services Manager, right-click the virtual directory that
contains the ASP page that calls your component, and then click Properties.
Under Anonymous Access, click Edit, and set the Directory Security of this
virtual directory to anything other than Anonymous.

I placed a simple ASP page in a directory I created, i.e.,
c:\inetpub\wwwroot\MYASP.

From the IIS Manager, I right click my directory under "Web Sites", "Default
Web Site" and selected properties. I then get confused as I don't have an
"Anonymous Access' tab. I tried going to "Directory Security" and clicking
the Edit in the Authentication and Access control" but I couldn't figure out
what to do. I tried clearing the check box "Enable Anoymous Access" but
that didn't seem to work. I couldn't even get pages to load then.

So, bottom line, how do I step into a method of my VB COM object if that com
object is used from an ASP page???

Thanks!

Grant Schenck
 
M

Mark Schupp

I've never gotten debugging to work the way it is "supposed" to but here is
what I do. It requires visual C++ but you can probably do the same thing
with windows debugger.

1. restart IIS with IISRESET
2. compile the dll for debugging (no optimization, create symbols).
3. launch task and not the PIDs running DLLHOST.EXE
4. launch your web application and run it enough to load the DLL.
5. in task manager find the new instance of DLLHOST, right-click on it and
select debug. This will open the debugger.
6. load the VB6 source file for your component (.cls file) and find the
entry point you want to step into. Set a breakpoint.

There are some peculiarities with using the C++ debugger on a VB DLL. Mostly
you will find that you cannot view the contents of complex objects such as
classes and arrays. You may need to insert some code to set data into simple
variables so that you can see it.

I'm sure that someone else can direct you to a cleaner way to do this but it
works for me.
 
G

Grant Schenck

If anyone else know how to do this without MSVC, please chime in! ;-)

That said, I have a pretty stupid follow up question:

My ASP page simply creates the object and invokes a method.

In your step 4 you say to run my web app enough to load the DLL.

How would I do that? Is there some idea that the ASP could show a button
which could be clicked to invoke the method I want to debug? Some simple
code to show how to do that would be very much appreciated.

Thanks,

Grant Schenck
 
G

Grant Schenck

Make sense...

BTW, I think I got a pure VB solution to work.

This article covers it pretty well:

http://support.microsoft.com/default.aspx?scid=kb;en-us;299633#2

The trick was two fold. I'm running IIS 6.0 so the methods are different.
Once I disable anoymous access I then have to provide my Windows login
information and then the first time there is a pause of around 30 second but
then, low and behold it pops up in the debugger. I think I got this
behviour earlier but got impatient and assume the browser was hung.

So, thanks for the help.

Grant Schencl
 
P

Phill. W

Grant Schenck said:
I'm trying to figure out how to debug a very simple COM object
I developed in VB.

If you're developing on the same machine as the web server:

Open the project in VB.
Add a few choice breakpoints.
Run the project using Start with Full Compile (Ctrl-F5).

Launch a browser and navigate to the web page that uses your
Component. All other things being equal, your component should
break into the VB IDE when you hit any of your breakpoints.

HTH,
Phill W.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top