Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Launching a COM object
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01400670
Message ID:
01401158
Vues:
31
>>Yes we used DCOMCNFG to provide NETWORK SERVICE with access to the COM file. This produced a slightly different result. Whereas before the failure and error message was immediate, now the website/browser seems to hang for a minute or so before it reports the same error. IE Cannot create ActiveX object. Further digging shows that the reason is a timeout waiting for the COM to report back that it had started. Here is the frontend of the code. Do you see anything that might be producing the problem? Remember it works fine in the Cassini environment.
>
>Are you seeing anything in your log file? One thing I sometimes do is to add a one liner to the Init() just to make sure COM instanciation is even completing, ex:
>
>STRTOFILE(TRANSFORM(DATETIME()) + " : Started", "C:\SomePath\Test.log")
>RETURN
>
>Then I'll make sure both ASP.NET and the COM component have access to that path and run your code. If the log file is written you know that the interop stuff is working OK, it's probably a permission issue.
>
>I also tend to move code out of the Init() and into another method (ex. Setup()). This lets me do things like the paths in the properties before that code runs. I instanciate the object, set the properties, then call Setup().
>
>One thing to be aware of - you're probably not sitting in the directory you think you are in the Init() - that could be why it's failing.
>
>Take a look at this post by Rick Strahl re: debugging your VFP COM component - it can definitely help to be able to trace through the code:
>
>http://www.west-wind.com/weblog/posts/170736.aspx

Thanks Paul -
Rick's article included a couple of words that caused a light to come on. He mentioned adding a reference to the COM in the NET application. So I did that and noticed the 'wrapper' it creates is a DLL. I also noticed that everything I have read on the subject refers to the COM as a DLL. So I tried adding a reference to the EXE and got the same result. Then I recompiled the EXE as a DLL instead and Hooray it loads. Unfortunately, although it loads, the function I need doesn't work from a DLL. According to MERE it needs to be compiled as an EXE so it will run out of process. So I am still stuck. But it seems like the permissions and web setup is not the issue. I looks like the problem is something to do with it being an EXE. btw- If you look at the code I posted earlier you will notice that I have lots of logging built in as you suggest.
- Don
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform