-
July 25th, 2007, 02:17 AM
#16
Re: converter from byte to kilobyte
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...
-
July 25th, 2007, 02:23 AM
#17
Re: converter from byte to kilobyte
-
July 25th, 2007, 02:44 AM
#18
Re: converter from byte to kilobyte
Originally Posted by ashukasama
post error
error C2065: 'StrFormatKBSize' : undeclared identifier
-
July 25th, 2007, 02:55 AM
#19
Re: converter from byte to kilobyte
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.
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.
-
July 25th, 2007, 03:27 AM
#20
Re: converter from byte to kilobyte
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.
how do i add that??
i have no idea on it...
-
July 25th, 2007, 03:30 AM
#21
Re: converter from byte to kilobyte
-
July 25th, 2007, 03:36 AM
#22
Re: converter from byte to kilobyte
Originally Posted by ashukasama
OS version - ??
window xp
-
July 25th, 2007, 03:58 AM
#23
Re: converter from byte to kilobyte
-
July 25th, 2007, 04:20 AM
#24
Re: converter from byte to kilobyte
Originally Posted by ashukasama
Visual Studio - ??
visual studio 6.0
-
July 25th, 2007, 05:07 AM
#25
Re: converter from byte to kilobyte
Originally Posted by lsy
visual studio 6.0
use StrFormatByteSize for VC6
the earlier function is not available .
-
July 25th, 2007, 07:13 AM
#26
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.
-
July 25th, 2007, 09:53 PM
#27
Re: converter from byte to kilobyte
Originally Posted by ashukasama
use StrFormatByteSize for VC6
the earlier function is not available .
Can you provide me any sample for this??
-
July 25th, 2007, 10:53 PM
#28
Re: converter from byte to kilobyte
whats the problem in this
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
-
July 25th, 2007, 11:19 PM
#29
Re: converter from byte to kilobyte
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
-
July 25th, 2007, 11:28 PM
#30
Re: converter from byte to kilobyte
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 ??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|