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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLL Not Found

Status
Not open for further replies.

hkung

Programmer
Jan 9, 2001
19
0
0
MY
Hi there,

I'm one of the ASP newbies and hope to get some advice from the forum.

I have an ASP page, it'll call a VB Active X dll , namely VBDLL.dll. However, the Active X dll will be calling another C DLL (not MFC dll but Win32 dll), namely CDLL.dll. It works fine up to the point where

////////////////codes//////////////////////
Set g_oEracom = Server.CreateObject("VBDLL.CVBDLL")
////////////////end of codes///////////////

However, when the VBDLL.dll tried to call the CDLL.dll in ASP page, it gives an error :

File Not Found : C:\WINNT40\System32\CDLL.dll

the following snippet of codes shows how the Active X function is being called in ASP:

//////////////////codes///////////////////
g_oEracom.Encrypt g_sCSN, g_lngCSNLen, g_sPlainTxt, g_lngPlainLen, g_sIV, g_sCipherTxt, g_lngCipherLen

If Err.number <> 0 Then
Response.Write &quot;Encrypt function failed!<br>&quot;
Response.Write &quot;Reason: &quot; &amp; Err.description &amp; &quot;<br>&quot;
Set g_oEracom = Nothing
Response.End
Else
Response.Write &quot;Here are the results for Encrypt function:<br>&quot;
Response.Write &quot;CipherTxt = &quot; &amp; g_sCipherTxt &amp; &quot;<br>&quot;
Response.Write &quot;CipherLen = &quot; &amp; g_lngCipherLen &amp; &quot;<br>&quot;
End If
/////////////////end of codes///////////////////

The Active X DLL is already registered in the MTS.

Below are the function declaration in my VBDLL.dll :

////////////////codes/////////////////////////
Private Declare Function EncryptOnly Lib &quot;CDLL.dll&quot; _
Alias &quot;_EncryptOnly@28&quot; (ByVal CSN As String, ByVal CSNLen As Long, ByVal PlainTxt As String, _
ByVal PlainLen As Long, ByVal IV As String, ByVal CipherTxt As String, _
ByRef CipherLen As Long) As Long
//////////////end of codes////////////////////

and the function EncryptOnly in VBDLL.dll is as below :

/////////////codes////////////////////////////
Public Function Encrypt(ByVal CSN As String, ByVal CSNLen As Long, ByVal PlainTxt As String, _
ByVal PlainLen As Long, ByVal IV As String, CipherTxt As String, _
CipherLen As Long)

Dim CipherTxt1 As String
Dim CipherLen1 As Long

CipherTxt1 = String(2000, vbNullChar)
CipherLen1 = 2000

ReturnValue = EncryptOnly(CSN, CSNLen, PlainTxt, PlainLen, IV, CipherTxt1, CipherLen1)

CipherTxt = CipherTxt1
CipherLen = CipherLen1
End Function
////////////end of codes//////////////////////

CDLL.dll is placed at the same directory as the VBDLL.dll.
(Winnt\System32) and VBDLL.dll is registered thru RegSvr32.

We tried to create a VB application exe to test the Active X dll and it works fine (by setting the References to the Active X dll location). However, the problem occurs when we test it with the ASP page. It seems that the VBDLL.dll can't locate the CDLL.dll thru ASP. However, by creating the exe in VB and run it,the exe gave the same problem (path not found for C dll).


Is it anyway that i can register a C dll (i tried but it was unsuccessful as it's only a Win32 dll) or what are the proper way that enables the Active X Dll to locate the C dll? I'm rather confused on where to place the dlls and register it.

Any helps will be greatly appreciated! Thanks in advance.

 
hmm.. you can place the dll anywhere and register it.. the only thing in mts package give the account that is running it admin rights and see if it works.. it might be a permission issue.. try to log in to the NT box as the account that runs the first dll and see if you can run the 2nd dll

rgrds Silvers5
As seen on EE
 

Make sure that the IUSR_<servername> user has execute rights on your CDLL.dll

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top