CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Jun 1999
    Posts
    9

    required winapi32 description

    Where or how to i get a description of the winapi32 for VB.

    Thanks!


  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: required winapi32 description

    You could use the API loaded that comes with VB.
    It can also be accessed from start->prog.. menu.
    or locate Apiload.exe under VB's inst. folder

    There is also a type library for all WinAPIs. I dont know where to get it from. Also, i am told, there are more troubles with this Typelib than API loader's declarations.

    Ravi


  3. #3
    Join Date
    Jun 1999
    Posts
    9

    Re: required winapi32 description

    the api viewer does not tell you what does the function do


  4. #4
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: required winapi32 description

    To know what the Win32 API does, you have to look at MSDN. They are the OS fns, and not VBs, right?
    Onsite source : Got to MSDN msdn.microsoft.com then Library->Library Home. Click on Platform SDK and you will find Win32API sectn

    Take a look at the opinion expressed by Klaus H. Probst, " Let VB Hook into the OS", at
    http://www.vb-zone.com/free/opinion.asp.



  5. #5
    Join Date
    Jun 1999
    Posts
    9

    Re: required winapi32 description

    thanks alot Ravi Kiran


  6. #6
    Join Date
    Jun 1999
    Posts
    9

    Re: required winapi32 description

    hi Ravi,
    do you know how to use the API function GetSystemTime?

    how to i use it? i have tried it but there is an error and i do not know how to solve it

    Compile Error:
    Variable required - can't assign to this expression


    Thanks.



  7. #7
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: required winapi32 description

    Hi,

    You should have incl. your code...
    Anyway, this is how i defined and used: (This is as-is from API Viewer)


    Type SYSTEMTIME
    wYear as Integer
    wMonth as Integer
    wDayOfWeek as Integer
    wDay as Integer
    wHour as Integer
    wMinute as Integer
    wSecond as Integer
    wMilliseconds as Integer
    End Type
    Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime as SYSTEMTIME)


    public Sub MySysTime()
    Dim tmpSystime as SYSTEMTIME
    GetSystemTime tmpSystime
    With tmpSystime
    Debug.print "System timedd/mm/yyyy), day, hh:mm:ss";
    Debug.print Str(.wDay) & "/" & Str(.wMonth) & "/" & Str(.wYear);
    Debug.print " " & Str(.wDayOfWeek) & ",";
    Debug.print Str(.wHour) & ":" & Str(.wMinute) & ":" & Str(.wSecond);
    End With
    End Sub




    and the trace generated is like this:

    System Timedd/mm/yyyy), day, hh:mm:ss 2/ 6/ 1999 3, 16: 55: 33

    which indeed is correct.

    Ravi
    ps: A WORD (2bytes) in C is an Integer in VB, which is also 2 bytes


  8. #8
    Join Date
    Jun 1999
    Posts
    9

    Re: required winapi32 description

    thanks Ravi butwhen i tried it the hour seem to be difference from what is expected
    that is my computer time is 04:27 and the result i obtained is 08:27
    how to i solve this problem?


  9. #9
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: required winapi32 description

    interesting!!..

    But, on my system there is no diff. I just tested again!!

    There is another function called GetLocalTime
    It also has just the same syntax of GetSystemtime.
    and MSDN doesn't say anything about what is the difference between them?

    Run both, one after other and check the results!!
    On my system, both gave same values.
    Ravi


  10. #10
    Join Date
    Jun 1999
    Posts
    9

    Re: required winapi32 description

    thanks alot Ravi
    getlocaltime give me the correct result



  11. #11
    Join Date
    Apr 1999
    Location
    Netherlands
    Posts
    181

    Re: required winapi32 description

    Hi
    It sounds like that GetLocaleTime gives you the local time setting (for me, that's Central European Time + 1), and the other one gives you the CET (or maybe it gives you the bios time)


    Crazy D :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured