ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   GetCommandLineA fails under Vista (https://www.excelbanter.com/excel-programming/385402-getcommandlinea-fails-under-vista.html)

Josh Sale

GetCommandLineA fails under Vista
 
I have an old add-in that somebody is now trying to run under Vista using
Excel 2003. My add-in makes use of GetCommandLineA. The definition is:

Private Declare Function GetCommandLineA Lib "kernel32" () As String

This works under all previous versions of Windows and lots of flavors of
Excel ... but not with Vista.

I tried doing a GetCommandLineW and that doesn't fail, but it looks like
every character is preceded by a space.

Anybody got any suggestions?

TIA,

josh



NickHK

GetCommandLineA fails under Vista
 
Josh,
Working with the W visions of API calls means you have Unicode strings.
The easiest way (for me) is using byte arrays and StrConv when necessary.

Can't tell you about Vista though..

NickHK

"Josh Sale" <jsale@tril dot cod wrote in message
...
I have an old add-in that somebody is now trying to run under Vista using
Excel 2003. My add-in makes use of GetCommandLineA. The definition is:

Private Declare Function GetCommandLineA Lib "kernel32" () As String

This works under all previous versions of Windows and lots of flavors of
Excel ... but not with Vista.

I tried doing a GetCommandLineW and that doesn't fail, but it looks like
every character is preceded by a space.

Anybody got any suggestions?

TIA,

josh





Josh Sale

GetCommandLineA fails under Vista
 
Thanks Nick.

Great advice that worked for me.

josh




All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com