CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 37
  1. #16
    Join Date
    Feb 2005
    Posts
    568

    Re: converter from byte to kilobyte

    Quote Originally Posted by ashukasama
    right click on file

    #include "shlwapi.h"

    on context menu you will find Open Document "shlwapi.h"
    try to open it ,
    if not found then search file in your computer
    the file can be open...
    but error still there...

  2. #17
    Join Date
    May 2007
    Posts
    437

    Re: converter from byte to kilobyte

    post error
    ashu
    always use code tag

  3. #18
    Join Date
    Feb 2005
    Posts
    568

    Re: converter from byte to kilobyte

    Quote Originally Posted by ashukasama
    post error
    error C2065: 'StrFormatKBSize' : undeclared identifier

  4. #19
    Join Date
    May 2007
    Posts
    437

    Re: converter from byte to kilobyte

    Quote Originally Posted by lsy
    error C2065: 'StrFormatKBSize' : undeclared identifier
    may be this can be your problem :


    • Microsoft Visual C++ includes copies of the Windows header files that were current at the time Visual C++ was released. Therefore, if you install updated header files from an SDK, you may end up with multiple versions of the Windows header files on your computer. If you do not ensure that you are using the latest version of the SDK header files, you will receive the following error code when compiling code that uses features that were introduced after Visual C++ was released: error C2065: undeclared identifier.

    • Certain functions that depend on a particular version of Windows are declared using conditional code. This enables you to use the compiler to detect whether your application uses functions that are not supported on its target version(s) of Windows. To compile an application that uses these functions, you must define the appropriate macros. Otherwise, you will receive the C2065 error message.

    • From MSDN


    The following table indicates the common macros you must define to target each major operating system release. (Individual header files may use different macros; therefore, if compilation problems occur, check the header file that contains the definition for conditional definitions.)

    Minimum system required
    Macros to define Windows Server 2003
    _WIN32_WINNT>=0x0502 WINVER>=0x0502

    Windows XP
    _WIN32_WINNT>=0x0501 WINVER>=0x0501

    Windows 2000
    _WIN32_WINNT>=0x0500 WINVER>=0x0500

    Windows NT 4.0
    _WIN32_WINNT>=0x0400 WINVER>=0x0400

    Windows Me
    _WIN32_WINDOWS=0x0500 WINVER>=0x0500

    Windows 98
    _WIN32_WINDOWS>=0x0410 WINVER>=0x0410

    Windows 95
    _WIN32_WINDOWS>=0x0400 WINVER>=0x0400

    Internet Explorer 6.0
    _WIN32_IE>=0x0600 Internet Explorer 5.6
    _WIN32_IE>=0x0560 Internet Explorer 5.01, 5.5
    _WIN32_IE>=0x0501 Internet Explorer 5.0, 5.0a, 5.0b
    _WIN32_IE>=0x0500 Internet Explorer 4.01
    _WIN32_IE>=0x0401 Internet Explorer 4.0
    _WIN32_IE>=0x0400 Internet Explorer 3.0, 3.01, 3.02
    _WIN32_IE>=0x0300
    Note that some features introduced in the latest version of Windows may be added to a service pack for a previous version of Windows. Therefore, to target a service pack, you may need to define _WIN32_WINNT with the value for the next major operating system release. For example, the GetDllDirectory function was introduced in Windows Server 2003 and is conditionally defined if _WIN32_WINNT is 0x0502 or greater. This function was also added to Windows XP SP1. Therefore, if you were to define _WIN32_WINNT 0x0501 to target Windows XP, you would miss features that are defined in Windows XP SP1.

    You can define these symbols by using the #define statement in each source file, or by specifying the /D compiler option supported by Visual C++.

    Visual C++ 7.0: To specify compiler options, go to the Projects menu and click Properties.
    Visual C++ 6.0: To specify compiler options, go to the Projects menu and click Settings, then select the C/C++ tab.
    ashu
    always use code tag

  5. #20
    Join Date
    Feb 2005
    Posts
    568

    Re: converter from byte to kilobyte

    Quote Originally Posted by ashukasama
    may be this can be your problem :


    • Microsoft Visual C++ includes copies of the Windows header files that were current at the time Visual C++ was released. Therefore, if you install updated header files from an SDK, you may end up with multiple versions of the Windows header files on your computer. If you do not ensure that you are using the latest version of the SDK header files, you will receive the following error code when compiling code that uses features that were introduced after Visual C++ was released: error C2065: undeclared identifier.

    • Certain functions that depend on a particular version of Windows are declared using conditional code. This enables you to use the compiler to detect whether your application uses functions that are not supported on its target version(s) of Windows. To compile an application that uses these functions, you must define the appropriate macros. Otherwise, you will receive the C2065 error message.

    • From MSDN


    how do i add that??
    i have no idea on it...

  6. #21
    Join Date
    May 2007
    Posts
    437

    Re: converter from byte to kilobyte

    OS version - ??
    ashu
    always use code tag

  7. #22
    Join Date
    Feb 2005
    Posts
    568

    Re: converter from byte to kilobyte

    Quote Originally Posted by ashukasama
    OS version - ??
    window xp

  8. #23
    Join Date
    May 2007
    Posts
    437

    Re: converter from byte to kilobyte

    Visual Studio - ??
    ashu
    always use code tag

  9. #24
    Join Date
    Feb 2005
    Posts
    568

    Re: converter from byte to kilobyte

    Quote Originally Posted by ashukasama
    Visual Studio - ??
    visual studio 6.0

  10. #25
    Join Date
    May 2007
    Posts
    437

    Re: converter from byte to kilobyte

    Quote Originally Posted by lsy
    visual studio 6.0
    use StrFormatByteSize for VC6

    the earlier function is not available .
    ashu
    always use code tag

  11. #26
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: converter from byte to kilobyte

    Seriously, do you have something against division???

    KB = bytes / 1024. How hard is that?
    Last edited by GCDEF; July 25th, 2007 at 08:34 AM.

  12. #27
    Join Date
    Feb 2005
    Posts
    568

    Re: converter from byte to kilobyte

    Quote Originally Posted by ashukasama
    use StrFormatByteSize for VC6

    the earlier function is not available .
    Can you provide me any sample for this??

  13. #28
    Join Date
    May 2007
    Posts
    437

    Re: converter from byte to kilobyte

    whats the problem in this

    Quote Originally Posted by GCDEF
    Seriously, do you have something against division???

    KB = bytes / 1024. How hard is that?
    its simple way guy,

    use

    although

    these three line of code

    only sample code

    Code:
    char * strlp ;
    	char   strlp1[256];	
    	strlp1 = StrFormatByteSize(23506,strlp1 , 256);
    but best way use as GCDEF suggested you
    ashu
    always use code tag

  14. #29
    Join Date
    Feb 2005
    Posts
    568

    Re: converter from byte to kilobyte

    Quote Originally Posted by ashukasama
    whats the problem in this



    its simple way guy,

    use

    although

    these three line of code

    only sample code

    Code:
    char * strlp ;
    	char   strlp1[256];	
    	strlp1 = StrFormatByteSize(23506,strlp1 , 256);
    but best way use as GCDEF suggested you
    there is error on this...
    for GCDEF method i did try, but got a minor error...
    if my file size is 13824 byte, it will return 13kb instead of 14kb

  15. #30
    Join Date
    May 2007
    Posts
    437

    Re: converter from byte to kilobyte

    Quote Originally Posted by lsy
    there is error on this...
    for GCDEF method i did try, but got a minor error...
    if my file size is 13824 byte, it will return 13kb instead of 14kb
    whether it is my case or GCDEF

    it will retun 13.5 KB

    BTW Error ??

    ashu
    always use code tag

Page 2 of 3 FirstFirst 123 LastLast

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