GetCommandLine

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Bohrer
Posts: 4
Joined: Thu Feb 15, 2018 10:55 am

GetCommandLine

Post by Bohrer »

Hi,

With "libreoffice-5-0-4-multi-win", i had in a macro: Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As Long
Everything worked well

I upgraded to "LibreOffice_5.3.7_Win_x64", and now this does'nt work.

I had the same problem with office (64 bits) and I needed to edit to change it to ;
#If Win64 Then
Private Declare PtrSafe Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As LongPtr
#Else
Private Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As Long
#End If

How to do the same thing with libreoffice ?

Thank you in advance for your answers
LibreOffice_5.3.7_Win_x64
W7 x64 pro
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: GetCommandLine

Post by Zizi64 »

With "libreoffice-5-0-4-multi-win", i had in a macro: Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As Long
Everything worked well

I upgraded to "LibreOffice_5.3.7_Win_x64", and now this does'nt work.
Which type was your 5.0.4 version: 32 bit or 64 bit type?
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Bohrer
Posts: 4
Joined: Thu Feb 15, 2018 10:55 am

Re: GetCommandLine

Post by Bohrer »

Hi,

It was a 32 bit Version

I think the problem could be solved if we found how translate "LongPtr" in libreoffice
LibreOffice_5.3.7_Win_x64
W7 x64 pro
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: GetCommandLine

Post by Zizi64 »

It was a 32 bit Version
And the new one is 64bit.
"LibreOffice_5.3.7_Win_x64",32"LibreOffice_5.3.7_Win_x64",
As I know it, the calling method of the dll functions are basicly different in 32 an 64 bit softwares.

I am using 32 bit LO only, with some dll calling in my macros. I am using only the 32 bit version of the dll (CoolProp.dll)
Therefore I can not help you about the 64 bit versions...
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
JeJe
Volunteer
Posts: 2763
Joined: Wed Mar 09, 2016 2:40 pm

Re: GetCommandLine

Post by JeJe »

Explanation here:

https://msdn.microsoft.com/en-us/vba/la ... s-overview

Have you tried using the Double data type instead of Long for the return value on 64bit?
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Bohrer
Posts: 4
Joined: Thu Feb 15, 2018 10:55 am

Re: GetCommandLine

Post by Bohrer »

Hi,

Yes, i have tried Double and even LongLong.
LibreOffice_5.3.7_Win_x64
W7 x64 pro
JeJe
Volunteer
Posts: 2763
Joined: Wed Mar 09, 2016 2:40 pm

Re: GetCommandLine

Post by JeJe »

All I can think of is looking at the return value, and the GetLastError Function. And going back to a 32 bit version of course.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Bohrer
Posts: 4
Joined: Thu Feb 15, 2018 10:55 am

Re: GetCommandLine

Post by Bohrer »

Hi,

No return value, libreoffice simply crash

http://crashreport.libreoffice.org/stat ... e8adb04ea3
LibreOffice_5.3.7_Win_x64
W7 x64 pro
Post Reply