|
-
Jan 30th, 2003, 09:46 AM
#1
Thread Starter
New Member
ActiveX dll and ASP query
Hello!
I've created a simple ActiveX dll in VB6 to put into my ASP page.
using this tutorial http://www.4guysfromrolla.com/webtech/040300-1.shtml
My query is ...do I have to make any special settings on my main web server as it's coming up 'Page cannot be displayed'.
I think the problem is that it cannot connect to the com object as normal asp's work fine.
It also works perfectly on my own pc running IIS 5.1.
Thank you !
-
Jan 30th, 2003, 09:48 AM
#2
What does your ASP code look like? How is the object being created? How are you calling it? How is the page being written out? Has the object bee properly registered on the server?
-
Jan 30th, 2003, 10:01 AM
#3
Thread Starter
New Member
ASP is....
<%
Dim oCheckYear 'Create an object for the component
Dim IsLeapYear 'Create a string to hold the result
Dim Year 'Create a var to hold the year
Year = 1900 'You can cahnge this number to any year
'you want, keep the years 4 digits though
'Create an instance of the Component we just wrote
Set oCheckYear = CreateObject("CheckYear.LeapYear")
'Call the IsLeapYear function in our component, and
'store the result
IsLeapYear = oCheckYear.IsLeapYear(Year)
'Close the instance, good programming practice
Set oCheckYear = Nothing
%>
<HTML>
<HEAD>
<TITLE>The world population</TITLE>
</HEAD>
<BODY>
<%
'Let the user know
If IsLeapYear = True Then
Response.Write "<P>The year <b>" & Year & "</b> is a leap year.</P>"
Else
Response.Write "<P>The year <b>" & Year & "</b> is not a leap year.</P>"
End If
%>
</BODY>
</HTML>
I created the ActiveX Dll in VB 6 and clicked File -> Make dll and created it on the web server form there - is that the same as registering it?
-
Feb 8th, 2003, 12:30 AM
#4
Fanatic Member
if you created it and compiled with vb, it should have registered itself, but just to make sure, give it one more try. the next thing to do though is to add a reference to your dll in your iis project. go project > references in your visual interdev and pick up your dll (you should see a line added in the global.asa file after that).
-
Apr 16th, 2003, 12:12 PM
#5
Junior Member
Dll Problem
I am having a similar problem...
I read your solution to make a reference in the Global.asa file, but I don't use InterDev and I'm not sure how to. I use a text editor for my scripts. I did try to make a reference manually by putting the following at the top of my global.asa file:
<!-- METADATA TYPE="TypeLib"
file="Dll_Path" -->
Where Dll_Path is the actual file path of my Dll file.
But it still does not work I. I get the following error when I run a script that tries to use CreateObject of the DLL:
Microsoft VBScript runtime (0x800A01AD)
ActiveX component can't create object
If I run the script while my IDE for the DLL is running, it works fine, and I can even debug the code once the class is created.
I'm really stuck here, thanks in advance for any help.
Stodolos
-
Apr 16th, 2003, 12:25 PM
#6
Originally posted by radum
if you created it and compiled with vb, it should have registered itself,
That depends if he compiled it on his machine, but created the file on the server.... it gets registered on the PC the compiled it....
and created it on the web server form there
I suspect this is what he did.
To fix, copy the dll to the server (or not, since it sounds like it already there), then run (on the server, not from your PC) Regsrv32 "Path_to_the_Dll\Dll_name.dll"
That will register it on the server.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|