Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing DLLs

Status
Not open for further replies.

AndyApp

Programmer
Dec 20, 2001
259
GB
Is it possible to use a DLL without registering it on a server?

Visual InterDev recognises it and tells me the correct information that is required to be passed in but then I get an Invalid Class String error whenever I try to run the ASP page.

I can do it in development but i'm not sure whether my ISP will let me register a DLL on their server. Is there another way? "Life is like a Ferrari, it goes to fast.
But that's ok, because you can't afford it anyway" - Jim Davis (Garfield)
 
No to my knowledge, you always need to register the dlls. You can't just reference to them.
 
You could try using code like this to register the dll yourself:

<%
' register.asp

Response.Write (&quot;Current Path: &quot; & _
Server.MapPath(Request.ServerVariables(&quot;SCRIPT_NAME&quot;)))

''Work only if Path string includes the regsvr32 /s
Path = Request.Form(&quot;Path&quot;)

If Path <> &quot;&quot; Then
filepath = Replace(Path, &quot;regsvr32 /s&quot;, &quot;&quot;)
filepath = Trim(filepath)
Response.Write(&quot;<br><br>File Path: &quot; & filepath)

Dim WshShell, fso
Set WshShell = CreateObject(&quot;Wscript.Shell&quot;)
Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)

If fso.FileExists(filepath) Then
WshShell.run Path , 1, True
Response.Write &quot;<br><br><br><div align=&quot;&quot;center&quot;&quot;><b>&quot;
Response.Write &quot;Register <font color=&quot;&quot;#C50D6F&quot;&quot;>&quot;
Response.Write Path & &quot;</font> succeeded !</b></div>&quot;
Else
Response.Write &quot;<br><br><br><div align=&quot;&quot;center&quot;&quot;><b>&quot;
Response.Write &quot;Target DLL not found at filepath!</b>&quot;
Response.Write &quot;</div>&quot;
End If

Set fso = Nothing
Set WshShell = Nothing

Else

%>

<br><br>
<div align=&quot;center&quot; style=&quot;background-color: #E3E4EB;
margin:100px;border:1px ridge #000000;&quot;>
<form method=&quot;POST&quot;>
<b><font color=&quot;#2A00A2&quot;>Register DLL</font></b>
<br> <input name=&quot;path&quot; type=&quot;text&quot; size=&quot;40&quot; value=&quot;regsvr32 /s &quot;>
<br>e.g. <font color=&quot;#57009C&quot; style=&quot;background-color:white&quot;>
<b>regsvr32 /s G:\domain\app\DLL\test9.dll</b></font><br><br>
<input type=&quot;submit&quot; value=&quot;Submit&quot; style=&quot;background-color:#BDC99B;&quot;>
</form>
</div>

<%
End If
%>


hth

Ben ----------------------------------------
Ben O'Hara
----------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top