Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COM Interop fails with .NET on a Windows 2003 Server
Message
 
À
26/04/2007 10:27:57
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows Server 2003
Network:
Windows 2003 Server
Divers
Thread ID:
01219471
Message ID:
01220276
Vues:
18
Alexandre,

Thanks for you input. Actually I am already running the Application Pool as as "Local System" so it's not a rights issue. The problem is actually not limited to the Web App. I get the same error if I create a VB Application and try to call a VFP COM object through it. I have opened up a support call to MS. The VFP guys have decided it's not a VFP issue and passed it on. I'll update this thread when I hear a solution.

>Hi Neil as Craig said the prb is permissions, what he fail to explain was why this error so here it goes, it works fine in XP cause any asp.net code that runs in XP or win2k runs under the ASP.NET account that bellongs to the Users group. Now in Windows 2003 server it was introduced what is called application pools that you can see under IIS, by default that applycation pools runs over the NETWORK SERVICE Account, and what is possible is that account only has read permission to the directory where you are trying to create the file.
>so what can you do, you have 2 options you change the application domain for your asp.net app or you create a com+ app add your vfp dll to it and make that COM+ app to run under a user account that has permission to the system.
>
>
>>I have a dll compiled from VFP which I need to access from my ASP.NET web application build using VS .NET 2003. Everything work fine on Windows XP (dev) machines but when I deploy the solution to a 2003 Server I get errors calling the methods of the VFP class.
>>
>>I can create an instance of the object, code in the Init event fires, but when I call the method I get a NullReferenceException.
>>
>>I've included sample code which reproduces the error.
>>
>>Create a VFP project named vfptest
>>Add a new program and add the code between the '--'s.
>>Compile to DLL.
>>--
>>DEFINE CLASS FoxProTest as Custom OLEPUBLIC
>>
>>FUNCTION Init
>>    STRTOFILE( "Test", "InitTest.txt" )
>>ENDFUNC
>>
>>FUNCTION AboutMe AS String
>>    STRTOFILE( "Test", "AboutMe.txt" )
>>    RETURN "Hello My Name is Test"
>>ENDFUNC
>>
>>ENDDEFINE
>>--
>>
>>Creat a VB .NET application project.
>>Add a reference to the vfptest.dll created above
>>Add a button to the form and place the code between the '--'s in the click event.
>>--
>>Dim vfpObj As vfptest.FoxProTest = New vfptest.FoxProTest
>>Dim retVal As Object = vfpObj.AboutMe
>>--
>>
>>Run and debug on a Windows 2003 server.
>>
>>I would much appreciate your help
>>Neil Riding
>>The Guthrie Phillips Group Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform