|
Well, VC6++ includes __int64, so you could check
#if defined(_MSC_VER)
#if _MSC_VER >= 1200
// Yup, it's VC6 or later
#endif
#endif
There are different processor type macros, such as _M_IX86 which you can use to determine that it's compiling for X86. There are similar ones supported by (for instance) the ARM compiler for Windows Embedded.
What you need to do is look at the predefined macros like this for each of the compilers you're using for different platforms.
Steve S
Developer for hire
|
|
|
|
|
How do I find out if the target platform supports 64 bit Arithmetic or not
that depends mostly on the compiler. even machines that don't support 64 instructions in hardware can support it in software. ex.: __int64 i; will work wherever MS's C/C++ compiler works.
psychedelic_fur wrote: I will also like to know about finding if the target platform is Little Endian or Big Endian.
int tst=1;
if (((char*)tst)[0])
printf("Low endian");
else
printf("High endian");
Do the chickens have large talons?
|
|
|
|
|
how to read and write in file in case of vs 6.0
|
|
|
|
|
use STL :
std::ifstream and std::ofstream are what you're looking for, in case of C++, fopen() , fread() , fwrite() , fscanf() , fprintf() , fclose() otherwise
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Hi TOXCCT,
I want to create a cpp file template through MFC application. If i specified the class name( TestClass ) the application will automatically create the file TestClass.cpp with some codes like
#include TestClass.h
.
.
.
TestClass::TestClass()
{
}
.
.
.
someComments...etc.
if i want to do the same method or any other method is there????
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
|
if u kno, then please tel me, whether there is any other way to create cpp files
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
|
No problem....
i will use the CFile to create it.
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
yes...i also need it
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
if u r using MFC u can use CFile
never say die
|
|
|
|
|
fread and fwrite
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
hey, this is already told by toxcct in better way....then y u reapeating the same one????
If have any other idea then please tel it
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
You could use standard CFile/CStdioFile classes to read/write from/to files.
Here's a good example - Johan Rosengren's CTextFile: A handy helper[^]
|
|
|
|
|
Hi,
When 2 use glPushmatrix() and glPopMatrix() functions
When the goin gets tough then tough gets going
|
|
|
|
|
|
Methinks the OP is using OpenGL or something similar...
Steve S
Developer for hire
|
|
|
|
|
you use glPushmatrix() to push the current transformation matrix on the matrix stack ( OpenGL use a stack for transformation matrices ), once you are done doing transformations you can go back to the previous transformation with glPopMatrix()
for example ( from MSDN )
(1) glNewList(CYLINDER, GL_COMPILE);
(2) glPushMatrix ();
(3) glRotatef ((GLfloat)90.0, (GLfloat)1.0, (GLfloat)0.0, (GLfloat)0.0);
(4) glTranslatef ((GLfloat)0.0, (GLfloat)0.0, (GLfloat)-1.0);
(5) (6) glPopMatrix ();
(7) glEndList();
(2) will store the current transformation matrix; (3) and (4) will create new tranformation matrices for the next drawing operations. once the drawing is done, (6) pop matrix to the previous state.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I think you already gt a technical answer. A conceptual one could be:
One reason to push or pop matrices is to "accumulate" matrixes, or, in other words, make "hierarchical" transformations.
For example, if you are animating a robot arm, you may move the finger (relative to the point where it is attached to the wrist).
Then you push the matrix (to save it and "remember" its state) and move the wrist relative to the radio (and the finger should be transformed as well, since the wrist is attached to the radio, and the finger to the wrist).
Then you push the matrix again and move the radio relative to the elbow (and the finger and wrist should be transformed as well). And so on.
In the end you pop all the matrices and get the expected result (combined result).
The result is that these movements allow hierarchical relashionships. If it is programmed correctly, then when you rotate the shoulder joint then all the attached components (humerus, radio, wrist, and finger) will move as if they were all connected (as intended).
The advantage is that you don't have to compute all the individual movements relative to the world, because with push and pop they may be relative to each other. If the "parent" moves then all "childs" move.
Anyway, the programming of these tasks will appear reversed in OpenGL, so take this information as a simple and not so accurate conceptual explanation. Once you grasped the concept and its usefullness you should study the technical aspects and play a little with it (by making objects with hierarchical components, and see the efects of accumulating transformations).
I hope this helps,
Rilhas
-- modified at 18:45 Friday 21st July, 2006
|
|
|
|
|
Hi,
i have created the grid lines using CListCtrl (report view) and inserted data from the database.Now i want to read the data by just clicking on it.How can I read it?
Please help me.
Thanks in advance.
Tejaswini
|
|
|
|
|
b more specfic in framing a question... ur question is not clear.....
|
|
|
|
|
|
I have used CListCtrl in report view and style as LVS_EX_GRIDLINES to get the gridlines.I succesfully got the grid lines.In the columns of the gird lines I inserted data from database. Now if I click on any of the row i want to get the data which is already in it .
-- modified at 5:53 Wednesday 19th July, 2006
|
|
|
|
|
For reading data from the row(items) u can use getitemtext.
Thanks
|
|
|
|
|
for using getItemText() method i have to pass the index of the item and subitem.But how can i know the index.(User may click any of the row item)
Thank u.
|
|
|
|