kernel32

  • Thread starter Thread starter Mark Field
  • Start date Start date
M

Mark Field

When I insert the code below, it claims that there is a User Defined Type
Not Defined. In the cases below, it's refering to SYSTEM_INFO and
OSVERSIONINFO. I have matched the reference libraries up, and it still does
not compile. Any ideas? Thanks!
-Mark

** THESE TWO DO NOT WORK ***
Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As
SYSTEM_INFO)
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA"
(lpOSInfo As OSVERSIONINFO) As Boolean

** THIS ONE WORKS!! **
Private Declare Function api_GetUserName Lib "advapi32.dll" Alias
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
 
Mark,
I have matched the reference libraries up, and it still does
not compile. Any ideas?

What do you mean by "matched the reference libraries up"? Do you
actually have the OSVERSIONINFO and SYSTEM_INFO structures defined
somewhere?

BTW, are you using VB.NET? Your Declare statements look like they were
written for VB6.



Mattias
 
* "Mark Field said:
When I insert the code below, it claims that there is a User Defined Type
Not Defined. In the cases below, it's refering to SYSTEM_INFO and
OSVERSIONINFO. I have matched the reference libraries up, and it still does
not compile.

You don't need a reference for using this functions.
** THESE TWO DO NOT WORK ***
Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As
SYSTEM_INFO)
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA"
(lpOSInfo As OSVERSIONINFO) As Boolean

Post your declaration of 'OSVERSIONINFO'.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 
Hello, Mark:

Besides what Mattias and Herfried said, you may find useful the System.Environment class:
http://msdn.microsoft.com/library/?...lrfSystemEnvironmentClassTopic.asp?frame=true

And the System.Windows.Forms.SystemInformation class:
http://msdn.microsoft.com/library/d...emwindowsformssysteminformationclasstopic.asp

Regards.


"Mark Field" <[email protected]> escribió en el mensaje | When I insert the code below, it claims that there is a User Defined Type
| Not Defined. In the cases below, it's refering to SYSTEM_INFO and
| OSVERSIONINFO. I have matched the reference libraries up, and it still does
| not compile. Any ideas? Thanks!
| -Mark
|
| ** THESE TWO DO NOT WORK ***
| Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As
| SYSTEM_INFO)
| Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA"
| (lpOSInfo As OSVERSIONINFO) As Boolean
|
| ** THIS ONE WORKS!! **
| Private Declare Function api_GetUserName Lib "advapi32.dll" Alias
| "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
|
|
 
Back
Top