O$10.22: GetEnvironmentVariableW

Grzegorz (Greg) Pasternak gpasternak at cogeco.ca
Sat Aug 27 01:31:27 UTC 2022


Phil;

Thanks for your help, I can confirm that the 'ICCM' instead of 'JCC' works indeed both on Omnis Studio 5.1 and 10.22 on Windows 10 64bit.
Now that I know the "why" I think that the orignal code should be changed to getenv(), it should work on both 32/64bit systems and O$5.1.x and 10.x.

Grzegorz (Greg) Pasternak





> On Aug 26, 2022, at 5:16 PM, Phil (OmnisList) <phil at pgpotter.co.uk> wrote:
> 
> Hi Greg,
> 
> I have different call for the computer name:
> 
> Register DLL('kernel32','GetComputerNameW','ICM')
> 
> Call DLL('kernel32','GetComputerNameW',lcComputername,255)
> 
> 
> But for your call, I think you are missing a parameter:
> 
> Register DLL('kernel32.dll','GetEnvironmentVariableW','ICCM')
> 
> Call DLL('kernel32.dll','GetEnvironmentVariableW','COMPUTERNAME',lcComputername,255)
> 
> Register DLL('kernel32.dll','GetEnvironmentVariableW','ICCM',kTrue)
> 
> 
> regards
> Phil Potter
> Based in Chester in the UK.
> 
> On 26/08/2022 20:38, Grzegorz (Greg) Pasternak wrote:
>> 
>> The following code works on Windows 10 64bit in Omnis Studio 5.1
>> Register DLL ('kernel32.dll','GetEnvironmentVariableW','JCC')
>> Call DLL ('kernel32.dll','GetEnvironmentVariableW','COMPUTERNAME',vComputerName) Returns vError
>> 
>> but it does not work on Windows 10 64bit in Omnis Studio 10.22
>> 
>> Any suggestions why?
>> 
>> Grzegorz (Greg) Pasternak
>> 
>> 
>> 
>> 
>> 
>> _____________________________________________________________
>> Manage your list subscriptions athttps://lists.omnis-dev.com
>> Start a new message ->mailto:omnisdev-en at lists.omnis-dev.com  
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list