Results 1 to 6 of 6

Thread: General COM Question (IIS)

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Location
    Brisbane,Qld,Australia
    Posts
    7
    Can someone please tell me - if theoretically, should a activex dll that works correctly when referenced from a Standard.exe also work as COM object accessed from active server pages on IIS?

    Are there any circumstances when they wont??

    Thanks

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    I've never had any problems!

    Have you ever had any sucess?

    How are you doing it?


    Mark
    -------------------

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Location
    Brisbane,Qld,Australia
    Posts
    7

    Idea and Code

    Hi Mark, Thanks for your reply.

    The basic idea was to use the faxcom.dll in Windows 2000 to allow staff to send faxes via our company intranet.

    The code works from a standard exe and also from an exe that references the com object.

    This is the error that is returned from my ASP page:

    Error Type:
    DCGIntranet (0x80004005)
    Method '~' of object '~' failed
    /netfax/Default.asp, line 13

    Below is the code for the COM object and also the ASP page.

    Thanks for your time

    Jarrod


    '************* Code From COM ************************
    Public Function NetFax(ServerName, FileName, FaxNumber, RecipientTitle, RecipientName, RecipientCompany, RecipientOfficePhone, SenderTitle, SenderName, SenderFax, SenderCompany, SenderOfficePhone)

    Dim FaxServer As Object
    Dim FaxDoc As Object
    Set FaxServer = CreateObject("FaxServer.FaxServer")

    FaxServer.Connect (ServerName)

    'Create Document to Fax
    Set FaxDoc = FaxServer.CreateDocument(FileName)

    'Fax Recipient Details
    FaxDoc.RecipientTitle = RecipientTitle
    FaxDoc.RecipientName = RecipientName
    FaxDoc.RecipientCompany = RecipientCompany
    FaxDoc.RecipientOfficePhone = RecipientOfficePhone
    FaxDoc.FaxNumber = FaxNumber

    'Fax Sender Details
    FaxDoc.SenderTitle = SenderTitle
    FaxDoc.SenderName = SenderName
    FaxDoc.SenderFax = SenderFax
    FaxDoc.SenderCompany = SenderCompany
    FaxDoc.SenderOfficePhone = SenderOfficePhone

    'Send Fax
    Result = FaxDoc.Send()

    'Disconnect from Faxserver
    FaxServer.Disconnect

    Set FaxServer = Nothing
    Set FaxDoc = Nothing

    End Function


    '***************** CODE From ASP Page ***************

    <%

    Set objNetFax = Server.CreateObject("DCGIntranet.NetFax")
    objNewFax = objNetFax.NetFax("\\Server", "\\Server\D\test.doc", "0 3257 4511", "Mr", "Smith", "DCG", "07 3257 4500", "Mr", "Jarrod Jones", "07 3257 4511", "DCG", "07 3257 4500")

    %>

  4. #4
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Er...

    are uyou sure you should be trying to do this:

    objNewFax = objNetFax.NetFax(


    There doesn't appear to be a return value from the NetFax function so I'm not sure what you're trying to assign to objNewFax....




  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Location
    Brisbane,Qld,Australia
    Posts
    7

    Yep that'll do it

    Thanks Mark, I got it all working

    Cheers

    Jarrod

  6. #6
    New Member
    Join Date
    Apr 2000
    Posts
    1
    To follow up on this thread, I am trying to do almost the same thing except I am accessing faxcom.dll from a standard .exe (the VB app is CGI). The problem I am having is that whenever I try and do anything but connect or disconnect (I can read attributes of the server, ie: discoutstart time) I get this error:

    Error -2147024894: Method '~' of object '~' failed

    I will post code very similar to jarrod's code to make things easier. (it seems that whenver the FaxDoc.Send() is included, it causes that error, w/o that statement it works fine)

    Sub Cgi_Main()
    ...
    NetFax "\\ROMAN", "\\ROMAN\D\test.doc", "0 3257 4511", "Mr", "Smith", "DCG", "07 3257 4500", "Mr", "Jarrod Jones", "07 3257 4511", "DCG", "07 3257 4500"
    ...
    End Sub

    Public Sub NetFax(ServerName, FileName, FaxNumber, RecipientTitle, RecipientName, RecipientCompany, RecipientOfficePhone, SenderTitle, SenderName, SenderFax, SenderCompany, SenderOfficePhone)
    On Error GoTo error_olemsg

    Dim FaxServer As Object
    Dim FaxDoc As Object
    Set FaxServer = CreateObject("FaxServer.FaxServer")

    FaxServer.Connect (ServerName)

    'Create Document to Fax
    Set FaxDoc = FaxServer.CreateDocument(FileName)

    'Fax Recipient Details
    FaxDoc.RecipientTitle = RecipientTitle
    FaxDoc.RecipientName = RecipientName
    FaxDoc.RecipientCompany = RecipientCompany
    FaxDoc.RecipientOfficePhone = RecipientOfficePhone
    FaxDoc.FaxNumber = FaxNumber

    'Fax Sender Details
    FaxDoc.SenderTitle = SenderTitle
    FaxDoc.SenderName = SenderName
    FaxDoc.SenderFax = SenderFax
    FaxDoc.SenderCompany = SenderCompany
    FaxDoc.SenderOfficePhone = SenderOfficePhone

    'Send Fax
    Result = FaxDoc.Send()

    'Disconnect from Faxserver
    FaxServer.Disconnect

    Set FaxServer = Nothing
    Set FaxDoc = Nothing

    Exit Sub
    error_olemsg:
    Send "<br>"
    Send "Error " & Str(Err) & ": " & Error$(Err)
    Send "<br>"
    Exit Sub

    End Sub

    [Edited by nelson on 04-07-2000 at 05:48 PM]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width