Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


how to display DWORD or WORD of a sturcture as string...

grahamojgrahamoj Member Posts: 366
hiya there is 3 system structures i want to display some of their fields..i.e SYSTEM_INFO,SYSTEM_POWER_STATUS and SYSTEMTIME structures.
Most of them are DWORD or WORD type fields. how do u display such fields??

i have use this but it gives me the wrong output..

// system info
SYSTEM_INFO sys_stat;
CString strNumProcessors;

strNumProcessors.Format("%d", sys_stat.dwNumberOfProcessors );
AfxMessageBox( strNumProcessors );

// system time
SYSTEMTIME sys_time;
CString strTime;

strTime.Format( "Year %d", sys_time.wYear );
AfxMessageBox( strTime );



  • kuphrynkuphryn Member Posts: 266
    Consider the "%f."

    sText.format("%f", variable);

  • Justin BibJustin Bib USAMember Posts: 0

    ___ \ \ free ebooks and video tutorials about // Delphi Objective-C Go Visual Basic .NET Assembly MATLAB Python C++ Visual Basic R Ruby Perl PL/SQL C C# PHP Java Swift JavaScript Scratch VBScript Transact-SQL Clojure Rust Erlang Scala Lisp D Prolog Kotlin Julia LabVIEW Fortran Logo Bash SAS Lua Crystal FoxPro ML ABAP Awk COBOL Scheme Ada F# Alice Apex Hack Dart // __

Sign In or Register to comment.