kappa12
06-03-2003, 06:35 AM
I've written dll's before and this is the first time I haven't been able to get past this issue. I'm getting the all-too-common "ActiveX component can't create object" error message when trying to call a dll from an ASP page. I'm using server-side script, and the dll is registered on the system. "Everyone" has been given full usage persmissions on the dll as well. It was compiled as a single threaded dll. I know it recognizes that it's there b/c the list of methods is there when I try to access it during coding. I can also access and successfully use the dll from within a VB program, using the CreateObject method. I'm at a loss here as to why my ASP page simply sits there when I try to run it, then eventually returns with that error message. Any ideas?
iowahawk43
06-03-2003, 07:04 AM
I've written dll's before and this is the first time I haven't been able to get past this issue. I'm getting the all-too-common "ActiveX component can't create object" error message when trying to call a dll from an ASP page. I'm using server-side script, and the dll is registered on the system. "Everyone" has been given full usage persmissions on the dll as well. It was compiled as a single threaded dll. I know it recognizes that it's there b/c the list of methods is there when I try to access it during coding. I can also access and successfully use the dll from within a VB program, using the CreateObject method. I'm at a loss here as to why my ASP page simply sits there when I try to run it, then eventually returns with that error message. Any ideas?
You mentioned that the DLL is registered on "the system". I hope you mean the server. You did mention this is a server side script, so the server needs it! Sorry, if this is what you meant, but I wonder if this is why your local machine works fine when coding, but after migrating to the server...
HTH
kappa12
06-03-2003, 07:19 AM
Yeah, I'm developing it on the server. When I refer to "the system", I mean the server. Sorry for the confusion. This is why I'm so confused, since it works in VB IDE, but won't work in the ASP page. Hmm, actually, I just noticed something... it turns out it will create a reference to the object, but the problem comes in when I try to call the method in the DLL. This is the code, maybe someone can see what can be giving me the problem? I've given full access to "Everyone" for the Redemption DLL.
Public Sub sendMessage(sender As String, message As String)
Dim safeItem, oItem, Application, Namespace
Set Application = CreateObject("Outlook.Application")
Set Namespace = Application.GetNamespace("MAPI")
Set safeItem = CreateObject("Redemption.SafeMailItem")
Set oItem = Application.CreateItem(0)
safeItem.Item = oItem
safeItem.Recipients.Add ("mailrecipientdeleted")
safeItem.Recipients.ResolveAll
safeItem.Subject = sender
safeItem.Body = message
safeItem.Send
End Sub
The Redemption DLL is used to get around the annoying prompts generated when trying to use automation to send an e-mail via Outlook. Like I said, it all works in the VB IDE, but not from an ASP page.
kappa12
06-03-2003, 07:47 AM
Ok, turns out it's erroring out on the Set Application = CreateObject("Outlook.Application") line. I've included the Outlook 10.0 Object Library as a reference and changed the relevent code to the following:
Dim Application As Outlook.Application
Set Application = New Outlook.Application
However, I'm still getting the same error. Still very confused...
kappa12
06-03-2003, 12:51 PM
Ok, I scrapped the dll (which is STILL giving me the same error, BTW), and have resorted to using CDO for the e-mailing. I had to download the cdonts.dll file from here http://dll.yaroslavl.ru/index.php3?lng=&in_char=C and register it on the server before it would work, but it works like a charm. Just thought I'd follow up on my own topic for anyone who's having similar issues...