 |
|
|
|
| Author |
Message |
Roger Stenson
Joined: 04 Oct 2007 Posts: 4
|
Posted: Wed May 02, 2007 11:39 am Post subject: Further Idiot Question |
|
|
Hi again
Never having used a Windows API before I have typed the following
declaration into one of my modules
and received the complaint "User-defined type not defined
I have lookd for a 'reference' to a WinApI library and included several that
had some faint whiff but no progress. Can I ask you to give me a bit more
information
Roger Stenson
Public Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA"
(lpVersionInformation As OSVERSIONINFO) As Long
Archived from group: microsoft>public>vb>syntax |
|
| Back to top |
|
 |
Ralph
Joined: 04 Oct 2007 Posts: 4148
|
Posted: Wed May 02, 2007 11:19 am Post subject: Re: Further Idiot Question |
|
|
"Roger Stenson" wrote in message$8E.2832@newsfe5-win.ntli.net...
> Hi again
> Never having used a Windows API before I have typed the following
> declaration into one of my modules
> and received the complaint "User-defined type not defined
> I have lookd for a 'reference' to a WinApI library and included several
that
> had some faint whiff but no progress. Can I ask you to give me a bit more
> information
> Roger Stenson
>
> Public Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA"
> (lpVersionInformation As OSVERSIONINFO) As Long
>
You need to also declare the OSVERSIONINFO struct (UDT).
Download a API Viewer. Here's one.
http://www.activevb.de/rubriken/apiviewer/index-apiviewereng.html
Or perhaps you have defined it, but not in scope.
-ralph |
|
| Back to top |
|
 |
Larry Serflaten
Joined: 04 Oct 2007 Posts: 2644
|
Posted: Wed May 02, 2007 11:57 am Post subject: Re: Further Idiot Question |
|
|
"Roger Stenson" wrote
> Hi again
> Never having used a Windows API before I have typed the following
> declaration into one of my modules
> and received the complaint "User-defined type not defined
> I have lookd for a 'reference' to a WinApI library and included several that
> had some faint whiff but no progress. Can I ask you to give me a bit more
> information
> Roger Stenson
>
> Public Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA"
> (lpVersionInformation As OSVERSIONINFO) As Long
Here is an example suitable for pasting into a Form:
(I got it from the API viewer I use...)
LFS
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Private Sub Form_Load()
Dim OSInfo As OSVERSIONINFO, PId As String
'KPD-Team 1998
'URL: http://www.allapi.net/
'KPDTeam@Allapi.net
'Set the graphical mode to persistent
Me.AutoRedraw = True
'Set the structure size
OSInfo.dwOSVersionInfoSize = Len(OSInfo)
'Get the Windows version
Ret& = GetVersionEx(OSInfo)
'Chack for errors
If Ret& = 0 Then MsgBox "Error Getting Version Information": Exit Sub
'Print the information to the form
Select Case OSInfo.dwPlatformId
Case 0
PId = "Windows 32s "
Case 1
PId = "Windows 95/98"
Case 2
PId = "Windows NT "
End Select
Print "OS: " + PId
Print "Win version:" + Str$(OSInfo.dwMajorVersion) + "." + LTrim(Str(OSInfo.dwMinorVersion))
Print "Build: " + Str(OSInfo.dwBuildNumber)
End Sub |
|
| Back to top |
|
 |
Jeff Johnson
Joined: 04 Oct 2007 Posts: 1327
|
Posted: Wed May 02, 2007 7:39 pm Post subject: Re: Further Idiot Question |
|
|
"Roger Stenson" wrote in message $8E.2832@newsfe5-win.ntli.net...
> Never having used a Windows API before I have typed the following
> declaration into one of my modules
> and received the complaint "User-defined type not defined
> I have lookd for a 'reference' to a WinApI library and included several
> that had some faint whiff but no progress. Can I ask you to give me a bit
> more information
> Roger Stenson
>
> Public Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA"
> (lpVersionInformation As OSVERSIONINFO) As Long
Somewhere out there (don't have a URL handy, sorry) is a type library with
loads of API functions and structures declared. I believe the file name of
the one I have is win.tlb, and its friendly name is "Windows API (ANSI)." |
|
| Back to top |
|
 |
Ralph
Joined: 04 Oct 2007 Posts: 4148
|
Posted: Thu May 03, 2007 11:08 am Post subject: Re: Further Idiot Question |
|
|
"Jeff Johnson" wrote in message@TK2MSFTNGP04.phx.gbl...
> "Roger Stenson" wrote in message
> $8E.2832@newsfe5-win.ntli.net...
>
> > Never having used a Windows API before I have typed the following
> > declaration into one of my modules
> > and received the complaint "User-defined type not defined
> > I have lookd for a 'reference' to a WinApI library and included several
> > that had some faint whiff but no progress. Can I ask you to give me a
bit
> > more information
> > Roger Stenson
> >
> > Public Declare Function GetVersionEx Lib "kernel32" Alias
"GetVersionExA"
> > (lpVersionInformation As OSVERSIONINFO) As Long
>
> Somewhere out there (don't have a URL handy, sorry) is a type library with
> loads of API functions and structures declared. I believe the file name of
> the one I have is win.tlb, and its friendly name is "Windows API (ANSI)."
>
That's most likely Bruce McKinney's.
(http://vb.mvps.org/hardweb/mckinney2a.htm).
I use this typlib myself, but didn't recommend it, as it hasn't been
updated/repaired since it was published, and the OP didn't sound like he was
quite ready for another layer of confusion.
-ralph |
|
| Back to top |
|
 |
Jeff Johnson
Joined: 04 Oct 2007 Posts: 1327
|
Posted: Thu May 03, 2007 4:27 pm Post subject: Re: Further Idiot Question |
|
|
"Ralph" wrote in message @arkansas.net...
> That's most likely Bruce McKinney's.
> (http://vb.mvps.org/hardweb/mckinney2a.htm).
>
> I use this typlib myself, but didn't recommend it, as it hasn't been
> updated/repaired since it was published, and the OP didn't sound like he
> was
> quite ready for another layer of confusion.
Updated I can understand. What needs to be repaired? |
|
| Back to top |
|
 |
Ralph
Joined: 04 Oct 2007 Posts: 4148
|
Posted: Thu May 03, 2007 5:43 pm Post subject: Re: Further Idiot Question |
|
|
"Jeff Johnson" wrote in message
news:%23btb$%23ZjHHA.3512@TK2MSFTNGP06.phx.gbl...
> "Ralph" wrote in message
> @arkansas.net...
>
> > That's most likely Bruce McKinney's.
> > (http://vb.mvps.org/hardweb/mckinney2a.htm).
> >
> > I use this typlib myself, but didn't recommend it, as it hasn't been
> > updated/repaired since it was published, and the OP didn't sound like he
> > was
> > quite ready for another layer of confusion.
>
> Updated I can understand. What needs to be repaired?
>
Right off nothing critical comes to mind. I've been add'n, change'n, fix'en
my copy for so long, I couldn't tell the difference.
-ralph |
|
| Back to top |
|
 |
Jeff Johnson
Joined: 04 Oct 2007 Posts: 1327
|
Posted: Fri May 04, 2007 1:24 am Post subject: Re: Further Idiot Question |
|
|
"Ralph" wrote in message @arkansas.net...
>> Updated I can understand. What needs to be repaired?
>>
>
> Right off nothing critical comes to mind. I've been add'n, change'n,
> fix'en
> my copy for so long, I couldn't tell the difference.
And, uh, where might one acquire this new-and-improved version, hmmm? |
|
| Back to top |
|
 |
Ralph
Joined: 04 Oct 2007 Posts: 4148
|
Posted: Fri May 04, 2007 1:36 am Post subject: Re: Further Idiot Question |
|
|
"Jeff Johnson" wrote in message@TK2MSFTNGP02.phx.gbl...
>
> "Ralph" wrote in message
> @arkansas.net...
>
> >> Updated I can understand. What needs to be repaired?
> >>
> >
> > Right off nothing critical comes to mind. I've been add'n, change'n,
> > fix'en
> > my copy for so long, I couldn't tell the difference.
>
> And, uh, where might one acquire this new-and-improved version, hmmm?
>
I guess that is a hint.
I never thought of publishing it. As far as I know McKinney or mvp.org still
'own' it. I have also employed my own naming conventions and namespaces
which are not consistent and would be embarrassing to defend.
Should you run into any issues with any particular call I would be glad to
share my solution.
-ralph
|
|
| Back to top |
|
 |
|
|
| Related Topics: | Another API Question I have this lonStatus = strCmdLine, _ 0#, 0#, 1, &H40, 0&, workpath, But what exactly are 0#, 0#, &H40, 0& doing? I don't get it Thanks Adamb
help on this question Given the function (FullFileName as string) as string, write the statements necessary to return just the file name.
Combo box question Good morning all I have a simple question, but I can't think of the answer...need more coffee. I have a small database table from which I draw a list of QA Schemes. The list has 4 entries. Normally, I would want to populate a combobox with the full list,
Implements question Hi all, I have a question about the VB6 Implements keyword: If I have a class A with a method called Save and this method saves to the database. I then have a second class B which implements class B. When calling the method of class B, will ClassA.Save be
Directory Question Got a real simple question... My program requires that two directories reside on the C:\ drive of the computer - PDF and PDFWrite. When my program starts, I want to check if those directories exist. If they don't, then create them. I'd like to do this |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|