Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COM Interop fails with .NET on a Windows 2003 Server
Message
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:
01219540
Vues:
13
I'm running from a Domain Administrator account. I can run the dll through FoxPro from the command line. Everything works fine. It's only though Interop where it fails. I don't see how COMRETURNERROR() will help as the VFP code does not cause an error, it doesn't even execute.

If you look at my example. I get a file named InitTest.txt which shows that the class initializes and runs but I do not get and AboutMe.txt file when I call the method. It looks like the method call itself throws the NullReferenceException. In fact the .NET debugger bears this out as it shows all the object properties but each one only shows an exception. I'll copy the watch data.

vfpObj {vfptest.FoxProTestClass} vfptest.FoxProTest
[vfptest.FoxProTestClass] {vfptest.FoxProTestClass} vfptest.FoxProTestClass
BaseClass error: an exception of type: {System.NullReferenceException} occurred
etc...


>Most likely cause is that the user id running the component doesn't have write rights. You can use COMRETURNERROR() in the VFP code to get error information back.
>
>>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