Solved

Testing a dll in an ASP page

Posted on 2002-05-30
7
208 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
ID: 7044992
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
ID: 7045537
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
ID: 7046440
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 28

Expert Comment

by:AzraSound
ID: 7046743
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
ID: 7047424
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
ID: 7047596
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
ID: 7048469
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

685 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