GetCommandLine

Creating a macro - Writing a Script - Using the API

GetCommandLine

Postby Bohrer » Thu Feb 15, 2018 11:08 am

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
Bohrer
 
Posts: 4
Joined: Thu Feb 15, 2018 10:55 am

Re: GetCommandLine

Postby Zizi64 » Thu Feb 15, 2018 12:44 pm

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; LO4.4.7, LO6.1.5 on Win7-10 x64Prof.
PortableApps, winPenPack: LO3.3.0-6.2.2; AOO4.1.5
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.
User avatar
Zizi64
Volunteer
 
Posts: 7909
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: GetCommandLine

Postby Bohrer » Thu Feb 15, 2018 2:25 pm

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
Bohrer
 
Posts: 4
Joined: Thu Feb 15, 2018 10:55 am

Re: GetCommandLine

Postby Zizi64 » Thu Feb 15, 2018 2:32 pm

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; LO4.4.7, LO6.1.5 on Win7-10 x64Prof.
PortableApps, winPenPack: LO3.3.0-6.2.2; AOO4.1.5
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.
User avatar
Zizi64
Volunteer
 
Posts: 7909
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: GetCommandLine

Postby JeJe » Thu Feb 15, 2018 4:04 pm

Explanation here:

https://msdn.microsoft.com/en-us/vba/language-reference-vba/articles/64-bit-visual-basic-for-applications-overview

Have you tried using the Double data type instead of Long for the return value on 64bit?
Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 481
Joined: Wed Mar 09, 2016 2:40 pm

Re: GetCommandLine

Postby Bohrer » Thu Feb 15, 2018 5:26 pm

Hi,

Yes, i have tried Double and even LongLong.
LibreOffice_5.3.7_Win_x64
W7 x64 pro
Bohrer
 
Posts: 4
Joined: Thu Feb 15, 2018 10:55 am

Re: GetCommandLine

Postby JeJe » Thu Feb 15, 2018 8:13 pm

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.
Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 481
Joined: Wed Mar 09, 2016 2:40 pm

Re: GetCommandLine

Postby Bohrer » Fri Feb 16, 2018 10:05 am

Hi,

No return value, libreoffice simply crash

http://crashreport.libreoffice.org/stat ... e8adb04ea3
LibreOffice_5.3.7_Win_x64
W7 x64 pro
Bohrer
 
Posts: 4
Joined: Thu Feb 15, 2018 10:55 am


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 8 guests