Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error writing to file when VFP com server is called

Status
Not open for further replies.

longda

Programmer
Jul 24, 2001
66
US
I created a small test com server in VFP that will return the operating system. It is a small exe.

When I run this code in excel I get a VFP error window stating "Error writing to file.". The VFP com server doesn't use any files so why does this come up? It happens right after I set the object variable to nothing.

Code in Excel:
Private Sub Workbook_Open()

Dim ox As New common
Dim ln As Integer
Dim ls As String
Set ox = CreateObject("common.common")
ls = ox.m_checkos()
ln = MsgBox("OS used " & ls, vbOKOnly, "TEST")
Set ox = Nothing

End Sub
 
I don't offhand know what might be going wrong...
Post the code to the VFP COM server too and we'll have a better chance!
 
Here is the code from the method of the ole public class:

*m_oscheck method: returns the OS name.
LOCAL l_cOS
l_cOS=OS(1)
DO CASE
CASE "5.01" $ l_cOS
RETURN "WINDOWS XP"
CASE "5.00" $ l_cOS
RETURN "WINDOWS 2000"
CASE "NT" $ l_cOS
RETURN "WINDOWS NT"
CASE "4.90" $ l_cOS
RETURN "WINDOWS ME"
CASE "4.10" $ l_cOS
RETURN "WINDOWS 98"
CASE "4.00" $ l_cOS OR "3.9" $ l_cOS
RETURN "WINDOWS 95"
CASE "3." $ l_cOS
RETURN "WINDOWS 3.1"
OTHERWISE
RETURN "UNKNOWN"
ENDCASE


Code from main prg:

*Common.prg: main program.
RETURN


That's all there is to it. Do you think it has something to do with a resource file? I am not sure if that would be it because this was only a test com object to try and get my feet wet.

Thanks in advance
Dave L.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top