|
almost:
switch(sizeof(type))
{
case sizeof(short): //need pre-defined
break;
includeh10
|
|
|
|
|
|
|
|
|
|
Ian Darling wrote:
Of course, IIRC, typeid and type_info are platform dependant, so code isn't necessarily portable, right?
Not sure what you mean... Comparing type_info s generated on two different platforms probably won't work, if that's what you had in mind.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
CP SearchBar v2.0.2 released
|
|
|
|
|
Michael Dunn wrote:
Not sure what you mean... Comparing type_infos generated on two different platforms probably won't work, if that's what you had in mind.
Nope. Just that you couldn't rely on certain things about the type_info implementation always being the same across platforms, for example, what typeinfo::name() returns.
My reading of "Design and Evolution of C++" suggests that there is scope for differing definitions of the type_info class on different C++ platforms.
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
|
Thanks! Althougth I am not quite sure if I might be able to use it as I hoped, it is still a better alternative then declaring your own Type-Ids.
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
|
I'm a newbie to MFC . Now in my project, I need to implement the spell-checking feature and I have figured out the ASpell is one of the best outthere but I don't know how to implement it in my project. Can someone do me a favour, give me a sample project that use ASpell with MFC.
Thanks a lot .
|
|
|
|
|
|
Hi,
VC6 used a separate set of toolbar settings while debugging. In VS.Net 2003, I just don't get it. Is there any way to get this feature? (If not, I'm going to rant)
"Vierteile den, der sie Hure schimpft mit einem türkischen Säbel."
sighist | Agile Programming | doxygen
|
|
|
|
|
Go to the View/Toolbars menu and select the Debug toolbar.
Ed
|
|
|
|
|
I want to control the application's access to internet,so as to deny the unauthorized one if not match a rule.
Any comment appreciated.
|
|
|
|
|
u want to check just ur application access or any application??
Muhammad Shoaib Khan
http://geocities.com/lansolution
|
|
|
|
|
ever heard of a firewall!?
Don't try it, just do it!
|
|
|
|
|
i wish to know how to draw pixel by pixel onto a view, i am not loading any bitmap but want to create one during coding and view it in SDI. Can anyone help?
|
|
|
|
|
You wouldn't want to try drawing each pixel one-by-one onto the screen. Instead, try creating a DibSection and editing its bits, then BitBlt'ing it onto the view.
See the CreateDibSection[^] function.
"It is appallingly obvious that our technology exceeds our humanity." - Albert Einstein
FLUID UI Toolkit
|
|
|
|
|
If you truly want to set an individual pixel's color, you can use CDC's SetPixel method:
<big>CDC::SetPixel </big>
COLORREF SetPixel( int x, int y, COLORREF crColor );
COLORREF SetPixel( POINT point, COLORREF crColor );
Return Value
An RGB value for the color that the point is actually painted. This value can be different
from that specified by crColor if an approximation of that color is used. If the function
fails (if the point is outside the clipping region), the return value is -1.
Parameters
x
Specifies the logical x-coordinate of the point to be set.
y
Specifies the logical y-coordinate of the point to be set.
crColor
Specifies the color used to paint the point.
point
Specifies the logical x- and y-coordinates of the point to be set. You can pass either a
POINT structure or a CPoint object for this parameter.
Remarks
Sets the pixel at the point specified to the closest approximation of the color specified by
crColor. The point must be in the clipping region. If the point is not in the clipping region,
the function does nothing.
Not all devices support the SetPixel function. To determine whether a device supports SetPixel,
call the GetDeviceCaps member function with the RASTERCAPS index and check the return value
for the RC_BITBLT flag.
|
|
|
|
|
Hello, everyone!
How to use C (not C++) to check whether a character buffer (char*) contains a double or float number? I want to know how to check it with standard C (not C++) method and not VC++ specific method.
For example,
----------
char buf1 [5] = "123.4";
char buf2 [5] = "123.m";
----------
What the result I want to get is, when I input buf1, I can get TRUE and when I input buf2, I can get FALSE.
I find the function atof is not working properly.
Thanks in advance,
Geo
|
|
|
|
|
TCHAR * end = NULL;
double x = strtod(buf, &end);
// end points to the character that stopped the scan - this should be the 0 term
if (*end != '\0' || !_finite(x))
{
// not a valid number
}
"Vierteile den, der sie Hure schimpft mit einem türkischen Säbel."
sighist | Agile Programming | doxygen
|
|
|
|
|
#include <stdio.h>
#include <stdlib.h>
Thanks, peterchen buddy!
I found your code is not working properly, Here is a piece of sample code, which should return 0, but it returns 1 instead.
Source Code:
--------
int main (int argc, char** argv)
{
char* end = NULL;
char buf [5] = "123.4";
double x = strtod (buf, &end);
if ((*end != '\0') || (!finite (x)))
{
// not valid
return 1;
}
//valid
return 0;
}
--------
Is there something wrong?
regards,
Geo
|
|
|
|
|
Try replacing char buf [5] = "123.4"; by
char *buf = "123.4";
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|