RC5.FSO.ReadTextContent: Automation error

Questions about Wine on Linux
Locked
DreamManor
Newbie
Newbie
Posts: 1
Joined: Thu Aug 09, 2018 9:14 am

RC5.FSO.ReadTextContent: Automation error

Post by DreamManor »

When I tested a VB6 program under Wine, the system prompted "Automation error". This program uses vbRichClient5.FSO to read the contents of a text file. The specific code is as follows:

Code: Select all

Public Sub Main()
    Dim l_File As String
    Dim l_FSO As vbRichClient5.cFSO
    Dim p_CodePage As vbRichClient5.MSCodePages
    Dim l_Utf16NoBom As Boolean
    Dim l_Content As String
    
    On Error GoTo ErrTest
    
    l_File = "Z:\root\VbFcgi-master\bin\vbml\index.vbml"
    
    Set l_FSO = New_c.FSO
    
    If l_FSO.FileExists(l_File) = False Then
        MsgBox "The file '" & l_File & "' does not exist !"
    Else
        l_Content = l_FSO.[color=#FF0000][b]ReadTextContent[/b][/color](l_File, l_Utf16NoBom, p_CodePage)
        MsgBox "Read the contents of the file successfully !"
    End If
    
    Exit Sub
    
ErrTest:
    MsgBox "Failed to read the contents of the file !" & vbCrLf & vbCrLf & Error
End Sub
When the program runs to "m_Content = libFso.ReadTextContent(p_FilePathOrContent, l_Utf16NoBom, p_CodePage)", the system prompts "Automation error".

Could someone help me find out why? Thank you!


Description of the problem:
(1) This code references vbRichClient5.dll

(2) The software version I'm using is as follows:
      cUbuntu 16.04 32bit
      Wine 3.0.2
      VNC-Viewer 6.17.1113 32bit

(3) When I run "wine test.exe" via VNC, the system prompts as follows:
0077:fixme:atl:AtlAxWinInit version 0300 semi-stub

(4) When I run "wine test.exe" via UBuntu CommandLine, the system prompts as follows:

Code: Select all

wine test.exe

00a0:err:user:load_desktop_driver failed to load L"C:\\windows\\system32\\winex11.drv"

00a0:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.

00a0:err:winediag:nodrv_CreateWindow The explorer process failed to start.

wine: Unhandled stack overflow at address 0x7bc54c42 (thread 00a0), starting debugger...

00a0:err:seh:setup_exception_record stack overflow 832 bytes in thread 00a0 eip b7597142 esp 00240ff0 stack 0x240000-0x241000-0x340000
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Unable to run a VB6 program under remote Ubuntu / headless W

Post by Bob Wya »

The forum thread title:
RC5.FSO.ReadTextContent: Automation error
is useful if you expect a computer AI to parse your post... :roll:

Otherwise, for the purposes of standard human consumption, please use a title in plain / simple english, e.g.
Unable to run a VB6 program under remote Ubuntu / headless Wine
You haven't made it very clear what it is you are trying to do, so I'm just guessing...

Obvious first questions:
  • does the application run under a local Ubuntu session (either bare metal or a VM)?
  • are you using a 32-bit WINEPREFIX - set to Windows XP compatibility?
  • have you registered the VB dll libraries you are using?

Code: Select all

l_File = "Z:\root\VbFcgi-master\bin\vbml\index.vbml"
Wine is not designed to be ever run as root.
See: WineHQ FAQ: 6.2 Should I run Wine as root?

Bob
Locked