(Answer) (Category) Expert-tools : (Category) TIFF2PDF :
How can I register the DLL (BT2P.dll) in order to instantiate it from ASP page?
Jim Kinter answers:
 I worked around the problem by creating an
ActiveX DLL that implemented Methods that mirrored the methods exposed
by your component. The ActiveX DLL was then able to be
registered....which means that it can be instantiated by the ASP page.

SNIP
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Converter"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Private m_ReturnCode As String
Private Declare Function t2p_s Lib "BT2P.dll" (ByVal strOutFile As
String) As Long
Private Declare Function t2p_d Lib "BT2P.dll" (ByVal strOutFile1 As
String, ByVal strOutFile2 As String) As Long
Private Declare Function t2p_x Lib "BT2P.dll" (ByVal list As String) As
Long
Private Declare Function t2p_mx Lib "BT2P.dll" (ByVal multiple As
String, ByVal Out As String) As Long
Private Declare Function ValidateTiff Lib "BT2P.dll" (ByVal strOutFile
As String) As Long


Public Function Convert(ByVal SourceFileName As String) As Long
    m_ReturnCode = t2p_s(SourceFileName)
    Convert = m_ReturnCode
End Function


Public Function ConvertAndRename(ByVal SourceFileName As String, ByVal
TargetFileName As String) As Long
    m_ReturnCode = t2p_d(SourceFileName, TargetFileName)
    ConvertAndRename = m_ReturnCode
End Function


Public Function Merge(ByVal FileList As String) As Long
    m_ReturnCode = t2p_x(FileList)
    Merge = m_ReturnCode
End Function


Public Function MergeAndRename(ByVal FileList As String, ByVal
TargetFileName As String) As Long
    m_ReturnCode = t2p_mx(FileList, TargetFileName)
    MergeAndRename = m_ReturnCode
End Function


Public Function Validate(ByVal SourceFileName As String) As Long
    m_ReturnCode = ValidateTiff(SourceFileName)
    Validate = m_ReturnCode
End Function


Public Property Get Status() As String
    Select Case m_ReturnCode
        Case -1
            Status = "The function has not been executed"
        Case 0
            Status = "No Error. Conversion Succeeded"
        Case 1
            Status = "Incorrect syntax of the input argument"
        Case 2
            Status = "Invalid input file (wrong format or non-existing
file)"
        Case 3
            Status = "Invalid output file (non-existing or locked
folder, locked/write-protected file)"
        Case 4
            Status = "Output file is not specified"
        Case 202
            Status = "Program must be run in compilation mode"
    End Select
End Property



Private Sub Class_Initialize()
    m_ReturnCode = -1
End Sub
/SNIP

Follows the implementation code from the ASP side.


Function ConvertTifToPDF(ByVal SourceFilePath, ByVal DestFilePath)
        dim objT2P, bIsEmptyDest, strError, intRetCode


        strError=""


        if len(DestFilePath)=0 then
                bIsEmptyDest=true
        else
                bIsEmptyDest=false
        end if


        set objT2P =server.createobject("t2pwrapper.converter")
        
        if bIsEmptyDest then
                intRetCode = objT2P.Convert(SourceFilePath)
        else
                intRetCode = objT2P.ConvertAndRename(SourceFilePath,
DestFilePath)
        end if


        if intRetCode<>0 then
                strError= objT2P.Status 
        end if


        set objT2P=nothing
        
        ConvertTifToPDF=strError
End Function
Previous: (Answer) Where do I find the details of my registration?
This is a Faq-O-Matic 2.711. This FAQ administered by expert.tools.com