Page 1 of 1

GetCommandLine

PostPosted: Thu Feb 15, 2018 11:08 am
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

Re: GetCommandLine

PostPosted: Thu Feb 15, 2018 12:44 pm
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?

Re: GetCommandLine

PostPosted: Thu Feb 15, 2018 2:25 pm
by Bohrer
Hi,

It was a 32 bit Version

I think the problem could be solved if we found how translate "LongPtr" in libreoffice

Re: GetCommandLine

PostPosted: Thu Feb 15, 2018 2:32 pm
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...

Re: GetCommandLine

PostPosted: Thu Feb 15, 2018 4:04 pm
by JeJe
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?

Re: GetCommandLine

PostPosted: Thu Feb 15, 2018 5:26 pm
by Bohrer
Hi,

Yes, i have tried Double and even LongLong.

Re: GetCommandLine

PostPosted: Thu Feb 15, 2018 8:13 pm
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.

Re: GetCommandLine

PostPosted: Fri Feb 16, 2018 10:05 am
by Bohrer
Hi,

No return value, libreoffice simply crash

http://crashreport.libreoffice.org/stat ... e8adb04ea3