HighTechTalks DotNet Forums  

NullReferenceException - COM Interop method fails on Windows 2003 Server - Urgent

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss NullReferenceException - COM Interop method fails on Windows 2003 Server - Urgent in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
GPG
 
Posts: n/a

Default NullReferenceException - COM Interop method fails on Windows 2003 Server - Urgent - 04-24-2007 , 02:05 PM






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.



Reply With Quote
  #2  
Old   
Neil Riding
 
Posts: n/a

Default RE: NullReferenceException - COM Interop method fails on Windows 2003 - 04-24-2007 , 06:12 PM






Additional the error only occurs in Windows 2003 Server SP2. I have tested in
on an unpatched machine and under SP1 and both worked fine.

"GPG" wrote:

Quote:
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.




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.