473,785 Members | 2,369 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 "GetVersion ExA"
(lpOSInfo As OSVERSIONINFO) As Boolean

** THIS ONE WORKS!! **
Private Declare Function api_GetUserName Lib "advapi32.d ll" Alias
"GetUserNam eA" (ByVal lpBuffer As String, nSize As Long) As Long
Nov 20 '05 #1
3 3009
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****@idonotl ikespam.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 "GetVersion ExA"
(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.Environm ent class:
http://msdn.microsoft.com/library/?u...asp?frame=true

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

Regards.
"Mark Field" <mf****@idonotl ikespam.cce.umn .edu> escribió en el mensaje news:e5******** ******@TK2MSFTN GP10.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 "GetVersion ExA"
| (lpOSInfo As OSVERSIONINFO) As Boolean
|
| ** THIS ONE WORKS!! **
| Private Declare Function api_GetUserName Lib "advapi32.d ll" Alias
| "GetUserNam eA" (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
2206
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 symbol files for the GDI32.dll, kernel32.dll..... and all the other dll's properly. While debugging i want to see what is happening in GDI32 behind the scene. Is there a way? If not then why do we load the GDI32.pdb for debugging. Thanks,...
2
7818
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 able to edit .ini files with some VB code that references that library. Does anyone know how to do this from access? Thanks for your help!
3
5823
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 lpNumberOfBytesRead, IntPtr lpOverlapped);
0
3766
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 file. I managed to run the program a few times then suddenly I could not run it and this error appears. The .dll file is of course in place in the SYSTEM32 folder.
1
2188
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 entry point GetLocalPathName could not be located in the dynamic link library Kernel32.dll" Apparently this function is not implemented in Windows NT 4.
2
4458
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 written in vb.NET. I've rewritten the code for vb.net, but if I run the application, there is following runtime error message System.NullReferenceException: Object reference not set to an instance of an object. at...
0
1090
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 EFLGS=00000206 EBX=81d10cbc SS=0187 ESP=07fbfc88 EBP=07fbfe38 ECX=00000187 DS=0187 ESI=81d10cbc FS=130f
0
877
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 KERNEL32.DLL at 017f:bff768a1. Registers: EAX=00000000 CS=017f EIP=bff768a1 EFLGS=00000247
6
3813
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, string defaultValue, byte result, int size, string fileName); private static extern int GetPrivateProfileString(string section, string key, string defaultValue, StringBuilder result, int size, string fileName);
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9481
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10341
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8979
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2881
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.