Using VB6 Enterprise
Is there a simply way i.e an API call that can tell me what O/S my program at runtime is currently
program at runtime is currentlyQuote:>> Is there a simply way i.e an API call that can tell me what O/S my
Environ("OS") assumes you've set an environment variable called OS.Quote:>> running on?
>> Adrian Harrison
>I use Environ("OS"). There may be better ways.
I couldn't see it set on any PC's I looked at, so it's probably not standard
or default on all Windows PCs.
There are API's which return the info, but the *simplest* way in VB6 is to
use "Microsoft Sysinfo control 6.0" (goto Project, Components and select
this component (sysinfo.ocx)).
Then simply access the OSPlatform property of the control which will return
one of the following three values:
0 = Win32s
1 = Windows 95/98
2 = Windows NT
You can also access the version and build information of the operating
system (as well as things like battery power left etc.). This control is
really just a wrapper for the corresponding API calls (so it's arguably
overkill), but you did ask for the *simplest* method. 8)
Hope that helps,
Public Sub GetSystemVersion()
'copy declarations from API viewer. OSVersion is a OSVERSIONINFO struct.
Dim ret As Long
OSVersion.dwOSVersionInfoSize = Len(OSVersion)
ret = GetVersionEx(OSVersion)
'strippen overbodige gegevens: we hebben alleen low-order word nodig
OSVersion.dwBuildNumber = (OSVersion.dwBuildNumber And ((2 ^ 16) - 1))
at runtime is currentlyQuote:>Using VB6 Enterprise
>Is there a simply way i.e an API call that can tell me what O/S my program
I have developed an application using VB5 EE SP3 on Win 95 and have updated
it using the same VB version on Win 98. The application is installed at a
client running Win 95 and NT.
When compiling under Win 95 and running executable at client site on an NT
machine, I receive a run-time error 50003 regarding the use of GIF files. I
don't use any GIF files or picture controls. I had a problem with a newer
version of the common dialog control - VB5 on W95 thought it was a picture
box - but I thought I had corrected that. I am also using Sheridan calendar
widgets v1.08 build 2.
Can someone help with this one??? I cannot reproduce the error on my W95 or
W98 machine. Also, I would like to be able to compile on my W98 machine
referencing the W95 version of the necessary controls. Any suggestions?