|
Sorry guys.
I've noticed that a long only uses 4 bytes.
I'm a java programmer and a long is 8 bytes in java
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
why have you put an L at the end of the numbers? could that be the problem?
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
If you don't put the L, the compiler assumes that's an integer. We add the L to reserve a bigger memzone.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
oh...didnt know that
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
I don´t think that the L will reserve a bigger memzone.
It only says the compiler that the number is to been seen as long, a typ-cast.
Try to trace every variable after assign it!!
|
|
|
|
|
You've overflowed the LONG. Try __int64.
|
|
|
|
|
Why do all the languages take there very own amount of bytes for the data types? java-long=8 <-> c++long=4 ...
Very confusing
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Type sizes in C++ are implementation-dependant. The standard only dictates the minimum size. However, for most (all?) 32-bit compilers, sizes are just like in VC++.
The next version of C++ standard most likely will include types with fixed size, like int32 , int64 etc., to aid in the developing of cross-platform code.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
If I use a double, that will do too?
A double is 8 bytes, msdn says so.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
double is not integer, but floating point
use hyper
|
|
|
|
|
I'm curious as to why you are adverse to using __int64?
|
|
|
|
|
I'm writing dirty-java at the moment, that's something like a combination of java and c++ through jni (java native interface).
and the __int64 doesn't exist there. But it works if you put the c++ calculation in a double and when returned to java cast it back to a (8bytes) long.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Is the 8bytes long an integer or floating point?
If integer, then a java long IS an __int64. If floating point, then it is the same as a double in C.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
It's no floating point.
The range for long is this:
[-9.223.372.036.854.775.808,9.223.372.036.854.775.807]
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
As far as I know the __int64 is just an 8 byte value (hince the 64). You should be able to just as easily case __int64 to java long as a double. Also, double is a C++ intrinsic type which means that if you use it in your C++ it is going to be interperted as a floating point value.
good luck.
|
|
|
|
|
You can cast it to double AND long. But the double uses floating point notation and that's no good if you're coding front-end.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Hi,
How can i use file handling in ATL ActiveX
I tried _open and other functions but it says
unresolved symbol to _main
Please help
Sameer
|
|
|
|
|
_open uses the CRT so you need to remove the ATL_MIN_CRT flag.
|
|
|
|
|
If you're familiar with STL, iostreams will do the job well.
|
|
|
|
|
But iostreams use the CRT, so he'll face the same problem.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Your're right. He was trying to use _open/_XXX functions so I suggested the CRT stuff, but then I though I'd suggest stl. Should have included that CRT was needed.
Thanks.
|
|
|
|
|
I guess you're not linking the C run-time library. Try with raw Win32 functions CreateFIle , ReadFile , etc (or change your settings to add the C run-time.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín M López Muñoz wrote:
I guess you're not linking the C run-time library
How do i Link with C run-time Library
|
|
|
|
|
Hi, pals!
I have added a shortcut of my program to the toolbar of IE. The
function of my program is to scan the content of the source codes
of the current webpage in IE. (When mentioning source codes, I am
referring to the codes which can be seen from "View"-->"Source files"
in the menu of IE).
But now I meet with a trouble, how can I read the content of the source codes of the current webpage in IE to a CString buffer?
Can you give me some sample codes?
Best regards,
George Ma
|
|
|
|