We’re encountering an issue with a DLL on our new Windows Server 2022. When attempting to register it using regsvr32 c:\windows\system32\pdfstampocx.dll, I received a “failed to load” error. To resolve this, I copied the files to c:\windows\SysWOW64 and successfully registered them using regsvr32 c:\windows\SysWOW64\pdfstampocx.dll.
However, our classic ASP application is still unable to create the object. Do you have any insights on what could be causing this issue?
Customer
------------------------------------
It sounds like you're facing issues with using a COM component (the pdfstampocx.dll
) in your classic ASP application on Windows Server 2022. Here are several troubleshooting steps and considerations to help you resolve the issue:
1. 32-bit vs. 64-bit Application Pool
Classic ASP applications run in a 32-bit mode by default. If you're using a 64-bit version of IIS, you may need to enable the 32-bit application pool. Here's how to do it:
- Open IIS Manager.
- Navigate to Application Pools.
- Find the application pool your ASP site is using.
- Right-click on it and select Advanced Settings.
- Set Enable 32-Bit Applications to True.
2. Permissions
Make sure that the IIS user (usually IUSR
or the application pool identity) has the necessary permissions to access the DLL and any related resources:
- Navigate to the directory where
pdfstampocx.dll
is located. - Right-click the DLL and go to Properties.
- Check the Security tab and ensure that the IIS user has read/execute permissions.
3. Registering the DLL Correctly
Since you registered the DLL in SysWOW64
, ensure that it is correctly registered. You can confirm this by:
- Using the OLE/COM Object Viewer (
oleview.exe
) to see if the component appears in the list of registered components.
4. Check for Dependencies
Ensure that the pdfstampocx.dll
does not have any missing dependencies. You can use tools like Dependency Walker to check for any missing DLLs or other components that pdfstampocx.dll
relies on.
5. ASP Error Messages
Check the ASP error messages you receive when trying to create the object. This can often provide insight into what is going wrong. If error reporting is not turned on, you can enable it in your ASP application by adding the following lines at the top of your ASP file:
<%
On Error Resume Next
Response.Write("Error: " & Err.Description)
On Error GoTo 0
%>
6. Use of Server.CreateObject
Make sure you are using Server.CreateObject
with the correct ProgID for the component. The ProgID can usually be found in the registry under HKEY_CLASSES_ROOT
.
Dim obj
Set obj = Server.CreateObject("PDFStampOCX.CPDFStamp")
7. Windows Server Settings
Ensure that there are no security settings or policies that might prevent COM components from running. This includes checking:
- DCOM Config settings (run
dcomcnfg
, locate your component under Component Services > Computers > My Computer > DCOM Config, and ensure that permissions are set correctly). - Windows Defender or other antivirus settings that might block COM execution.
8. Logging and Debugging
If possible, implement logging in your ASP code to capture when and where the error occurs. This can help pinpoint the issue.
9. Check the permissions for "PDFStampOCX.CPDFStamp" or "PDFStampCOM.CPDFStamp" in Component Services,
You may also look at following web page, you can by the steps on below web page to give permissions to "PDFStampOCX.CPDFStamp" or "PDFStampCOM.CPDFStamp" in Component Services in your system,
Conclusion
If you've gone through these steps and still encounter issues, please feel free to contact us, we are glad to assist you asap.