473,382 Members | 1,204 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

kernel32

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
Nov 20 '05 #1
3 2981
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

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Nov 20 '05 #2
* "Mark Field" <mf****@idonotlikespam.cce.umn.edu> scripsit:
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>
Nov 20 '05 #3
Hello, Mark:

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

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

Regards.
"Mark Field" <mf****@idonotlikespam.cce.umn.edu> escribió en el mensaje news:e5**************@TK2MSFTNGP10.phx.gbl...
| 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
|
|
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Saurabh Aggrawal | last post by:
Hi, I am in the process of debugging a 32 bit driver in user mode. I am debugging a dll( printer UI) which internally uses the GDI32.dll. I am using the Windbg for debugging. Windbg is loading the...
2
by: John Sheppard | last post by:
Hi, Im wanting to add kernel32.dll to my references, but it says cant add reference to the specified file. Does anyone know why? or shouldnt I even be trying to do such a thing? I want to be...
3
by: Chua Wen Ching | last post by:
Hi, I have doubts. From p/invoke and most site, they recommend to use this. Example1: static extern bool ReadFile(IntPtr hFile, byte lpBuffer, uint nNumberOfBytesToRead, out uint...
0
by: Henrik Larsson | last post by:
I have made a simple MFC project in VC .NET. After a few compilations I try to rum the program and this error message appears: C:\WINNT\SYSTEM32\KERNEL32.DLL', Cannot find or open a required DBG...
1
by: Boris | last post by:
I have C++ .NET mixed (managed/unmanaged) application. I build it under W2K and it works fine. However when I tried to run it under NT 4.0 I've got the following error message: The procedure...
2
by: Jan Jeitziner | last post by:
I want to find out all dll's a process have. I've found example code on the page http://www.freevbcode.com/ShowCode.asp?ID=295 The problem is, the sample is written in vb6, but Application is...
0
by: Mullai | last post by:
0Hi, My exe comes out with two types of errors like : 1.PG1609VV caused an invalid page fault in module KERNEL32.DLL at 017f:bff9dfff. Registers: EAX=07fbfe38 CS=017f EIP=bff9dfff...
0
by: Mullai | last post by:
Hi Friends, My exe gives an error msg like Exception 03H in module KERNEL32.DLL very often. I am working in VC++ 6.0 ver, mfc and gdi plus. PG1609VZ caused an exception 03H in module...
6
by: alag20 | last post by:
Hi Guys, I need some urgent help with this as I am becoming clueless now. I have 2 DllImport as below from Kernel32 private static extern int GetPrivateProfileString(string section, int key,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.