|
-
Mar 25th, 2000, 12:07 PM
#1
Thread Starter
New Member
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
-
Mar 26th, 2000, 02:56 PM
#2
Frenzied Member
I've never had any problems!
Have you ever had any sucess?
How are you doing it?
-
Mar 27th, 2000, 05:38 AM
#3
Thread Starter
New Member
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")
%>
-
Mar 27th, 2000, 02:32 PM
#4
Frenzied Member
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....
-
Mar 29th, 2000, 05:35 AM
#5
Thread Starter
New Member
Yep that'll do it
Thanks Mark, I got it all working
Cheers
Jarrod
-
Apr 7th, 2000, 02:49 AM
#6
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|