|
Thank for your reply. The SUBCLASS change the background color by the mouse movement. I need to change the color when it was focused by mouse or tab order. Could you help me? Thanks
|
|
|
|
|
Not so. See here[^]
Steve
|
|
|
|
|
he he he.. good one.. i already got your answer
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
You could subclass it or use this[^] approach.
Steve
|
|
|
|
|
Hello,
I want only digits in CRichEditCtrl then what type of edit styles should I use or there is no such edit style and I will have to write code for it .
Regards,
Prithaa
|
|
|
|
|
ES_NUMBER style.
You can set it from resource editor also if you are placing it in the dialog resource.
- NS -
|
|
|
|
|
Hello,
No I am not using resource editor.I am placing it on a window derived from CMDIChildWnd.
Is there anything else?
Thanks,
Prithaa
|
|
|
|
|
The style still applies whether you add it at design time or run time.
You can also derive a class from CRichEditCtrl , and override the OnChar() method.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
As David said, you can specify the style ES_NUMBER at the time of creation.
- NS -
|
|
|
|
|
hi my dll can't register on one pc ,but can register on another pc,
why? the error is :" *.dll DllRegisterServer failed ,error code is :0x8007007 "
thanks
|
|
|
|
|
If this works on one machine but not another check who is logged on. Does the user have Administrator permissions of both machines. If not then registering will not work.
0x8007007 seems to be related to passing too little memory (buffer too small) to some API call or another but it doesn't appear to be documented. Are you 100% sure this is the error code? It's 1 digit shorter than I would have expected for a COM error.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
AFAIK, you are right! we don't need to register MFC dll!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
szcococut wrote: hi my dll can't register on one pc ,but can register on another pc,
why? the error is :" *.dll DllRegisterServer failed ,error code is :0x8007007 "
thanks
you don't need to register dll written in MFC. it is the COM dll you have to register.. try placing the DLL in same folder as of Application
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
//this folllowing code is from the article "Three Ways to Inject Your Code into Another Process" By Robert Kuster.
some one please tell me how he calculated the size of InjectFunc in his application( 192 for debug and 128 for release ) ?
#ifdef _DEBUG<br />
#define cbInjectFunc 192<br />
#else<br />
#define cbInjectFunc 128<br />
#endif
//
//
static DWORD WINAPI InjectFunc (INJDATA *pData)
{
// Subclass START button
pData->fnOldProc = (WNDPROC)
pData->fnSetWindowLong ( pData->hwnd, GWL_WNDPROC,(long)pData->fnNewProc );
return (pData->fnOldProc != NULL);
}
int InjCode (HWND hWnd, bool fUnicode)
{
.
.
WriteProcessMemory( hProcess, pCodeRemote, &InjectFunc, cbInjectFunc, &dwNumBytesXferred );
.
.
.
Thanks & Regards
|
|
|
|
|
My guess is he did it by being totally savvy (knowledgeable) about his code. Compiling into an object, examing the object and extracting just the relevant bits etc..
|
|
|
|
|
nirdhar wrote: InternetOpen() problem
hence you need:
InternetOpen() solution
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
where is the question
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
You need to forward your request to the OP (he deleted the message).
BTW, technically yours
ThatsAlok wrote: where is the question
is not a question.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: You need to forward your request to the OP (he deleted the message).
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
About the quetion?
There has been SDK about TTS(text to speech) provided by the third party.Among it,here are some functions can be called by other application.
eg. testToWave(text,SaveIndex,SaveName).
I want to take use of webservice to call the functions to accomplish converting text language to voice.
In vc8(vc 2005),I add the .h headers file.The compile result is as follows.
Maybe you could help me.
Thanks.
-------------------------------------------------------------------
------ 已启动生成: 项目: jxjtts, 配置: Debug Win32 ------
正在编译...
jxjttsClass.cpp
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(103) : error C2146: 语法错误 : 缺少“;”(在标识符“MMVERSION”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(103) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(103) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(111) : error C2143: 语法错误 : 缺少“;”(在“*”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(111) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(121) : error C2146: 语法错误 : 缺少“;”(在标识符“ms”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(121) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(121) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(122) : error C2146: 语法错误 : 缺少“;”(在标识符“sample”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(122) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(122) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(123) : error C2146: 语法错误 : 缺少“;”(在标识符“cb”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(123) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(123) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(124) : error C2146: 语法错误 : 缺少“;”(在标识符“ticks”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(124) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(124) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(129) : error C2146: 语法错误 : 缺少“;”(在标识符“hour”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(129) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(129) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(130) : error C2146: 语法错误 : 缺少“;”(在标识符“min”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(130) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(130) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(131) : error C2146: 语法错误 : 缺少“;”(在标识符“sec”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(131) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(131) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(132) : error C2146: 语法错误 : 缺少“;”(在标识符“frame”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(132) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(132) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(133) : error C2146: 语法错误 : 缺少“;”(在标识符“fps”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(133) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(133) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(134) : error C2146: 语法错误 : 缺少“;”(在标识符“dummy”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(134) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(134) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(136) : error C2146: 语法错误 : 缺少“;”(在标识符“pad”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(136) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(136) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(143) : error C2146: 语法错误 : 缺少“;”(在标识符“songptrpos”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(143) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(143) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(146) : error C2143: 语法错误 : 缺少“;”(在“*”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(146) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(146) : error C2143: 语法错误 : 缺少“;”(在“*”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(146) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(146) : error C2377: “FAR”: 重定义;typedef 不能由任何其他符号重载
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(111) : 参见“FAR”的声明
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(146) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(285) : error C2065: “HDRVR”: 未声明的标识符
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(285) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(298) : error C2146: 语法错误 : 缺少“;”(在标识符“dwDCISize”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(298) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(298) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(299) : error C2146: 语法错误 : 缺少“;”(在标识符“lpszDCISectionName”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(299) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(299) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(300) : error C2146: 语法错误 : 缺少“;”(在标识符“lpszDCIAliasName”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(300) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(300) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(301) : error C2146: 语法错误 : 缺少“;”(在标识符“dnDevNode”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(301) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(301) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(302) : error C2143: 语法错误 : 缺少“;”(在“*”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(302) : error C2371: “NEAR”: 重定义;不同的基类型
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(146) : 参见“NEAR”的声明
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(302) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(302) : error C2143: 语法错误 : 缺少“;”(在“*”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(302) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(302) : error C2086: “int FAR”: 重定义
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(146) : 参见“FAR”的声明
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(302) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(336) : error C2146: 语法错误 : 缺少“;”(在标识符“dwDCISize”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(336) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(336) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(337) : error C2146: 语法错误 : 缺少“;”(在标识符“lpszDCISectionName”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(337) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(337) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(338) : error C2146: 语法错误 : 缺少“;”(在标识符“lpszDCIAliasName”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(338) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(338) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(339) : error C2143: 语法错误 : 缺少“;”(在“*”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(339) : error C2371: “NEAR”: 重定义;不同的基类型
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(146) : 参见“NEAR”的声明
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(339) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(339) : error C2143: 语法错误 : 缺少“;”(在“*”的前面)
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(339) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(339) : error C2086: “int FAR”: 重定义
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(146) : 参见“FAR”的声明
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(339) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(356) : error C2065: “CALLBACK”: 未声明的标识符
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(356) : error C2065: “DRIVERPROC”: 未声明的标识符
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(356) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mmsystem.h(356) : fatal error C1903: 无法从以前的错误中恢复;正在停止编译
deviceout.cpp
..\..\demo\deviceout.cpp(41) : error C3641: “waveOutProc”: 用 /clr:pure 或 /clr:safe 编译的函数的调用约定“__stdcall ”无效
正在生成代码...
jxjtts - 89 个错误,0 个警告
========== 生成: 0 已成功, 1 已失败, 0 最新, 0 已跳过 ==========
|
|
|
|
|
Hi,
The value stored in Float and same value when stored in double there is difference in the value Why?
Eg:
void main()
{
CString str;
union
{
float f1;
unsigned long a1;
}un1;
union
{
double d_f1;
unsigned long d_a1;
}d_un1;
float flt;
double d_flt;
un1.a1 = 0;
un1.f1 = 0.0;
un1.a1=0x6fffffff;
flt = un1.f1;
d_un1.d_a1 = 0;
d_un1.d_f1 = 0.0;
d_un1.d_a1=0x6fffffff;
d_flt = d_un1.d_f1;
}
Output:
d_flt 9.2837315805324e-315
flt 1.58456e+029
d_un1.d_f1 9.2837315805324e-315
un1.f1 1.58456e+029
I need the variable to hold value upto 0xffffffff as float cannot hold it i used double but there is a variation in the value if value is <7fffffffff.Is due to IEEE internal representation.HOw to resolve this.
Thanks
|
|
|
|
|
shir_k wrote: I need the variable to hold value upto 0xffffffff as float
Why? I mean: cannot you use the unsigned integer instead?
shir_k wrote: Is due to IEEE internal representation.HOw to resolve this
The above is true and there's nothing to resolve.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Yes we can use unsigned integer but am more concerned about float value.
Is any function in VC++ to convert hex value (0xffffffff) to equivalent float value.
Thanks
|
|
|
|
|
shir_k wrote: Is any function in VC++ to convert hex value (0xffffffff) to equivalent float value.
You cannot have such a function since the float value of 0xffffffff, according to IEEE 754 standard belongs to the NaN (Not a Number) set.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|