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 "Encrypt function failed!<br>"
Response.Write "Reason: " & Err.description & "<br>"
Set g_oEracom = Nothing
Response.End
Else
Response.Write "Here are the results for Encrypt function:<br>"
Response.Write "CipherTxt = " & g_sCipherTxt & "<br>"
Response.Write "CipherLen = " & g_lngCipherLen & "<br>"
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 "CDLL.dll" _
Alias "_EncryptOnly@28" (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.
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 "Encrypt function failed!<br>"
Response.Write "Reason: " & Err.description & "<br>"
Set g_oEracom = Nothing
Response.End
Else
Response.Write "Here are the results for Encrypt function:<br>"
Response.Write "CipherTxt = " & g_sCipherTxt & "<br>"
Response.Write "CipherLen = " & g_lngCipherLen & "<br>"
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 "CDLL.dll" _
Alias "_EncryptOnly@28" (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.