ASP and COM object problem. Help!

LOAF

Member
Jul 15, 2002
31
0
0
Hi all. I'm having difficulties with an ASP web application that I don't know how to fix. I'm rapidly running out of ideas so I hope you can help me. Here goes...

At work, I'm writing a web application that accesses a third party .DLL through a COM object. I basically just make function calls against the DLL by declaring external functions like this:

Public Declare Function Bal Lib "DCServer.dll" _
Alias "_GetBalance@12" (ByVal goo As String, _
ByRef Amount As Long, _
ByVal location As Integer) As Long

Everything works perfectly on my dev workstation that runs WIN 2K with IIS 5.0 Personal Web Server. But I've run into problems when I put the application and the associated DLLs and COM objects on our production web server. (The web server runs WIN 2K Advanced Server with IIS 5.0 and all the latest patches.) The problem is...once the application is on the web server, it stops working. When I call a script that access the COM object/DLL I get an error saying that the DLL called by the COM object can't be found at the given directory. I've tried moving the DLL around and recompiling the COM object to point at various locations (windows/System32, program files/common files) and with various permissions in those various locations, but to no avail. In all cases, the DLL still can't be found. So my question is...how do I get my app to work with the third party DLL? It works on my workstation, so I'm assuming that there's some settings on the server that I'm missing. By the way, .NET solutions won't work because we're not going down that path for a while.



Thanks in advance.
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
When VB performs a LoadLibrary() for the DLL in your declare statement, it will search in the following paths:

The directory from which the application loaded.
The current directory.
Windows XP: If HKLM\System\CurrentControlSet\Control\SessionManager\SafeDllSearchMode is 1, the current directory is the last directory searched. The default value is 0.

The Windows system directory. Use the GetSystemDirectory function to get the path of this directory.
Windows NT/2000/XP: The name of this directory is System32.

Windows NT/2000/XP: The 16-bit Windows system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is System.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable.

That's verbatim from the documentation. Generally, you should never code path information in your declare statements. If you have the DLL in your %windir%\system or %windir%\system32 (there's an env variable for the system directory, but I forget what it is), it will load.

Also, .NET wouldn't help you here. The platform invocation facilities use LoadLibrary() as well, so the same rules apply.
 

LOAF

Member
Jul 15, 2002
31
0
0
That's the thing, though. I have the DLL in the system32 directory and I still get the "File not found" error. Do I need to make sure that the COM object is looking there with the GetSystemDirectory() function to find it there or should it automatically find it there regardless?

SOrry if I'm not asking this very well. I'm a little new to the systems side of things and am a little frustrated and confused by the error. It doesn't make sense to me 'cause I can browse to the directory and the see DLL there plain as day.
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Do I need to make sure that the COM object is looking there with the GetSystemDirectory() function to find it there or should it automatically find it there regardless?

No, you shouldn't do that unless perhaps you have different versions of the DLL in different directories that would automatically be loaded by LoadLibrary() and you want to decide which you should load. I doubt you'd ever want to do such a thing...

Can you paste the exact error? Is it indeed barking about not being able to find DCServer.dll, or do you have a COM error (i.e. not regsvr32'd properly)?

 

LOAF

Member
Jul 15, 2002
31
0
0
Here you go:

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
DebitCredit (0x800A0030)
File not found: DCServer.dll
/cardinfo/balance/balance.asp, line 10


I've tried looking up that Hex error code on Technet and other places but have come up empty.

Anyway, on that line in the .asp script, I call a function in the COM object that references a function in the DCServer.dll library.

 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Are you certain you've loaded all the dependencies for DCServer.dll? Have you also put the VB6 runtime on the production server for your COM component (at a minimum, you'll need msvbvm60.dll) You can check what dependencies you have w/ depends.exe or via the command-line with 'dumpbin'. Just type "dumpbin /dependents DCServer.dll".

Does IUSR_yourmachinename have the appropriate permissions required to load the DLL?

The last thing I can think of is to run FileMon on your dev box to see what the app is loading with your DLL. I imagine that it's only loading msvbvm60.dll unless DCServer.dll is calling other non-static libraries as well.

Hope that helps. Report back w/ your findings
 

LOAF

Member
Jul 15, 2002
31
0
0
Does IUSR_yourmachinename have the appropriate permissions required to load the DLL?

It's set at guest. Is guest level high enough to access files on the file system?
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |