SOLVED : Need help with an old VB application

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
ccxx
Level 1
Level 1
Posts: 6
Joined: Mon Oct 13, 2008 9:14 am

SOLVED : Need help with an old VB application

Post by ccxx »

Hi,
i'm not new with wine but i'm in trouble with an old vb application.
I just tried everything i know to solve but i'm still at the start point.
I want to open a document (.rtf or .doc ) with OO . This VB application needs the full path of the application i want to use to open the documents. I write down the complete and full path ( Z:/xxx/yy/oowriter ).
The path is correct and the Writer opens quickly but with an error message like "/C:/Programs/xxx/yyy/1.RTF does not exist"
I think the application use some " Shell (application,document) " to open the docs.
What can i do in this case ? I think winepath or other registry tricks cannot apply.

Please i need help, i've just spent many ours without results.

Thank you
Last edited by ccxx on Wed Oct 15, 2008 6:29 am, edited 1 time in total.
James McKenzie

Need help with an old VB application

Post by James McKenzie »

ccxx wrote:
Hi,
i'm not new with wine but i'm in trouble with an old vb application.
I just tried everything i know to solve but i'm still at the start point.
I want to open a document (.rtf or .doc ) with OO . This VB application needs the full path of the application i want to use to open the documents. I write down the complete and full path ( Z:/xxx/yy/oowriter ).
The path is correct and the Writer opens quickly but with an error message like "/C:/Programs/xxx/yyy/1.RTF does not exist"
I think the application use some " Shell (application,document) " to open the docs.
What can i do in this case ? I think winepath or other registry tricks cannot apply.
Your application is making an assumption when handing off the path the
OpenOffice.org. You need to create a drive where the file actually
exists on your system. Look at the Winecfg program on how to do this.

BTW, why are you using the Windows version of OpenOffice.org? I know it
exists for many Linux distributions, Solaris and MacOSX.

James McKenzie
User avatar
dimesio
Moderator
Moderator
Posts: 13368
Joined: Tue Mar 25, 2008 10:30 pm

Post by dimesio »

I write down the complete and full path ( Z:/xxx/yy/oowriter ).
The path is correct
No, it's not. Windows paths use backslashes.
ccxx
Level 1
Level 1
Posts: 6
Joined: Mon Oct 13, 2008 9:14 am

Re: Need help with an old VB application

Post by ccxx »

James McKenzie wrote:ccxx wrote:

BTW, why are you using the Windows version of OpenOffice.org? I know it
exists for many Linux distributions, Solaris and MacOSX.

James McKenzie
I'm using OO for Linux version.
I maked an error writing the path. It's "Z:\usr\bin\oowriter" not "Z:/usr/bin/oowriter"
I'm sorry.

Going to try something with Winecfg ... What ? I don't know :-)

Thank you all for your answers
User avatar
dimesio
Moderator
Moderator
Posts: 13368
Joined: Tue Mar 25, 2008 10:30 pm

Re: Need help with an old VB application

Post by dimesio »

ccxx wrote: I'm using OO for Linux version.
Have you looked at this?
http://wiki.winehq.org/FAQ#head-68d921c ... 58d76ff51f
ccxx
Level 1
Level 1
Posts: 6
Joined: Mon Oct 13, 2008 9:14 am

Re: Need help with an old VB application

Post by ccxx »

dimesio wrote:
ccxx wrote: I'm using OO for Linux version.
Have you looked at this?
http://wiki.winehq.org/FAQ#head-68d921c ... 58d76ff51f
Absolutely yes !
Regarding the 2.3, Open office starts regular but it can not found the file.
Regarding the 2.4 i think it does not apply to this case because the application calls OO Writer passing the file name of the document like a parameter of the command line ( like "Z:\usr\bin\oowriter C:\Programs\xxx\yyy\1.RTF "

A question : why OO give to me a message where the path of the document is "/C:/Programs/xxx/yyy/1.RTF" and not "C:\Programs\xxx\yyy\1.RTF" ?

Thank you
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Need help with an old VB application

Post by vitamin »

ccxx wrote:Regarding the 2.4 i think it does not apply to this case because the application calls OO Writer passing the file name of the document like a parameter of the command line ( like "Z:\usr\bin\oowriter C:\Programs\xxx\yyy\1.RTF "
That's exactly what FAQ 2.4 is all about - calling Linux application from Wine and passing it a file to open.
ccxx wrote:A question : why OO give to me a message where the path of the document is "/C:/Programs/xxx/yyy/1.RTF" and not "C:\Programs\xxx\yyy\1.RTF" ?
You have to use "winepath" program to translate paths between windows and unix paths. Windows programs obviously use windows paths. You can't give them to unix programs.
ccxx
Level 1
Level 1
Posts: 6
Joined: Mon Oct 13, 2008 9:14 am

Re: Need help with an old VB application

Post by ccxx »

vitamin wrote:
ccxx wrote:Regarding the 2.4 i think it does not apply to this case because the application calls OO Writer passing the file name of the document like a parameter of the command line ( like "Z:\usr\bin\oowriter C:\Programs\xxx\yyy\1.RTF "
That's exactly what FAQ 2.4 is all about - calling Linux application from Wine and passing it a file to open.
The Faq 2.4 is about how to associate some Linux program with a file type in Wine. If my application does a shell to call the .doc, 2.4 is the solution.
Whereas my application call OO with the .doc file like a parameter, i think the 2.4 does not apply in my case.
Infact Wine does not know what type of file my application is calling because it's OO that will open the .doc.
But if i'm on the wrong way, I apologize ......
ccxx wrote:A question : why OO give to me a message where the path of the document is "/C:/Programs/xxx/yyy/1.RTF" and not "C:\Programs\xxx\yyy\1.RTF" ?
You have to use "winepath" program to translate paths between windows and unix paths. Windows programs obviously use windows paths. You can't give them to unix programs.[/quote]

I readed something about "winepath" but i don't understand how to apply it in this case. I can write only the full path of the OOWriter whithout spaces .

At this point i think there is not a solution ... but it's stupid.

Thank you for your answer
ccxx
Level 1
Level 1
Posts: 6
Joined: Mon Oct 13, 2008 9:14 am

Post by ccxx »

The final question is : How can i pass the right path to OOWriter ?
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

ccxx wrote:The final question is : How can i pass the right path to OOWriter ?
Use the sample script from 2.4
ccxx
Level 1
Level 1
Posts: 6
Joined: Mon Oct 13, 2008 9:14 am

Post by ccxx »

I think i can't explain as well , but i solved with a few line of code.

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal IpOperation As String, ByVal IpFile As String, ByVal IpParameters As String, ByVal IpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_NORMAL = 1
Sub Main()
Dim X As Long
X = ShellExecute(hWnd, "Open", Command$, vbNullString, vbNullString, SW_NORMAL)
End Sub
This routine take the name of the .doc file and call it directly.
In this case the registry key plays a role ( applyng the faq 2.4 ) because the shell

Thank you all for your suggest
Locked