Solved

Testing a dll in an ASP page

Posted on 2002-05-30
7
205 Views
Last Modified: 2010-05-02
I have created a com object that I have been testing in vb and all is going great.
I haven't registered the dll yet and don't want to until it is complete.

I am now wanting to test the dll in an ASP page - and was hoping to not have to register it! (as i am developing it as i go)

How can i make the dll available to my ASP page without registering it?

Thanks




0
Comment
Question by:little2do
  • 3
  • 3
7 Comments
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
I recommend testing the ASP page locally by installing IIS or PWS on your development machine.  If that is the case already, then you are set.
0
 
LVL 3

Expert Comment

by:MCummings111400
Comment Utility
You can test the Com component in a local ASP page if you put the component into run mode within the VB IDE. Set your COM Project as Startup and then run it. It will wait for components to be created.

VB will create temp registrations for the objects so you can now use

Set obj = Server.CreateObject("MyServer.MyObject")

In your ASP page.

This will only work if you are doing everything locally.
0
 

Author Comment

by:little2do
Comment Utility
Thank you for your comments.

I have VB installed locally on the testing server which is running IIS.

I created an activeX.dll project called TrainingCOM and have a class called Training.

So I Run the VB Project (There is only one, so it is set as the start up project)

In my asp code i have:
Set Train = Server.CreateObject("TrainingCOM.Training")

And my page returns:
Error Type:
Microsoft VBScript runtime (0x800A01AD)
ActiveX component can't create object
/costcentres.asp, line 125

If the VB project isn't running i get this error:
Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid ProgID. For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp.
/costcentres.asp, line 125

Any thoughts?
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
You have to compile the component (that will automatically register the component on the test server).

In your VB project, go to Project -> Project Properties and select the Debugging Tab.  Ensure the option "Wait for components to be created" is selected.  Then press F5 to put the DLL in run mode, then open your ASP page in your browser pointing to it locally (e.g., http://localhost/mypage.asp).  You should then be able to step through your code, set breakpoints, etc., in your DLL as needed.

Things to note, when you need to recompile, you have to release the hold IIS has on the component in memory.  This can be done by shutting down IIS and restarting, or setting some properties via Internet Services Manager (so long as you run IIS 5.0).  If you are interested in the latter, let me know and I can offer details.
0
 

Author Comment

by:little2do
Comment Utility
AzraSound,

Yes I am interested in being able to re-compile the dll at will so would like those IIS settings please.
I tried restarting the default web site but was unable to recompile.
Looks like i have to reboot each time to re-compile the Dll?

Thanks



0
 
LVL 28

Accepted Solution

by:
AzraSound earned 150 total points
Comment Utility
Another thing to check is if you are developing using Interdev, and you have recenly utilized an ASP page that references your DLL, sometimes Interdev will hold a reference to your component in memory and it, too, must be shut down to recompile.  The settings to allow for recompile w/o restarting IIS:


1) Open up Internet Services Manager
2) Go to Properties for your web application
3) Click on Home Directory tab
4) Set "Execution Permissions" to "Scripts and Executables"
5) Set "Application Protection" to "High (Isolated)"
6) Debug your component as needed
7) When you need to recompile, return to that Home Directory tab and click the "Unload" button to free the component from memory
0
 

Author Comment

by:little2do
Comment Utility
AzraSound,

Well done, I have just made 3 changes to my dll, and recomiled each time. (But could do so only after I 'Unloaded' the Dll in IIS)

Thanks
Rgds
Paul
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now