|
|
any other way please help me your views and xperience not the reference
Thanks in Advance
|
|
|
|
|
Why are you creating a service with a UI? Before even trying to track this down, are you sure this is what you want? A true service should run without any need for a user context or interface.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I used VC++ CImage class to display a transparent PNG picture.
But its background that should be transparent, display a semi-transparent white layer.
How could I fix these problem ?
|
|
|
|
|
It might sound strange but as far as i know
integer is 2 bytes . But in my code i declared
such a simple array
int arr[2][3][3] = {
{
{2000, 4,1},
{7, 8,1},
{3, 9,1}
},
{
{71, 61,11},
{31, 41,11},
{51, 91,11}
}
};
Why the hell do it store a integer as 4 byte in VC++
it a simple console app.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
In Win32, sizeof(int) is 4 bytes.
|
|
|
|
|
|
size of int is OS dependent
never say die
|
|
|
|
|
actually, it is not OS dependent, but implementation dependent. standard states that sizeof(int) >= sizeof(short), and short is at least 16 bits. so, for different compilers, sizeof(int) can be different even on the same OS.
|
|
|
|
|
and they are also processor dependent but not too much though.
<hr<span style="color:gray;size:15px;">-Prakash
-Prakash
|
|
|
|
|
Processor dependent ?????
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Well to understand this u need to know how softwares are dependent on hardware (processor)
generally the integer size is the size of word size of the processor, for 80386 onwards the word size is 32 bit and hence the integer size in most of the OS on Intel machine is 32bit.
Why the size of integer varies from compiler to compiler/OS 2 OS, because integer is the most used datatype and transfering a 32bit of data from the memory to processor is more efficient than other sized data.
<hr<span style="color:gray;size:15px;">-Prakash
-Prakash
|
|
|
|
|
vikas amin wrote: Processor dependent ?????
In continuation with Mr. Prakash.. if you see := sizeof(long)==sizeof(int) in windows enviornment
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Zdeslav Vojkovic wrote: ...sizeof(int) can be different even on the same OS.
Do you have a valid example of such? I've never seen an int that varied in size on the same machine.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
This goes back a bit in time, but...
In Microsoft C 6.0 (MS-DOS era), an int was 16 bits. Watcom C 9.0, on the same machine, made an int to be 32 bits. The Microsoft target in this case was 16-bit real-mode MS-DOS while the Watcom target was 32-bit protected mode MS-DOS.
Software Zen: delete this; // <a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" rel="nofollow">Fold With Us!</a>[<a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" target="_blank" rel="nofollow" title="New Window">^</a>]
|
|
|
|
|
But was it a true 32-bit int ? That's like saying we have a 64-bit int today, but only because Microsoft's compiler mashes two 32-bit int s together, simulating a bigger one.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Actually it was. The 80386 processors and their descendents included direct 32-bit arithmetic and pointer support. The Watcom compiler supported protected mode execution with a flat memory model for a variety of DOS extenders. A "DOS extender" basically provided an execution environment for a protected mode application in the MS-DOS environment.
DavidCrow wrote: Microsoft's compiler mashes two 32-bit ints together
Hmm. Is that still the case? I was under the impression that __int64 support since VS.NET 2002 was provided directly by native instructions.
Software Zen: delete this; // <a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" rel="nofollow">Fold With Us!</a>[<a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" target="_blank" rel="nofollow" title="New Window">^</a>]
|
|
|
|
|
Gary R. Wheeler wrote: Is that still the case?
I'm not sure since I only use VC++ v6.
Gary R. Wheeler wrote: I was under the impression that __int64 support since VS.NET 2002 was provided directly by native instructions.
Even on processors that do not a have 64-bit bus?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Probably i would preffer to say
implementation dependent then
processor dependent .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
vikas amin wrote: Probably i would preffer to say
implementation dependent then
processor dependent .
yes but the implementation is dependent on the processor.
-Prakash
|
|
|
|
|
The most important thing to do is to always use the "sizeof" operation in any code you're referring to. Never, ever hardcode the size into your code. When reading/writing to a file - there are exceptions -- in general, avoid using "int" as a type when it comes to storage of data structures. Instead, define types such as DWORD, WORD, BYTE, etc. This will save you a lot of trouble down the road.
Read more of what I have to say at http://directx9.blogspot.com/
|
|
|
|
|
segment_fault wrote: The most important thing to do is to always use the "sizeof" operation in any code you're referring to. Never, ever hardcode the size into your code. When reading/writing to a file - there are exceptions -- in general, avoid using "int" as a type when it comes to storage of data structures. Instead, define types such as DWORD, WORD, BYTE, etc. This will save you a lot of trouble down the road.
yes i know that.
-Prakash
|
|
|
|
|
Hi everybody,
I have a sensor to capture the fingerprint image and then send to PC via Serial COM Port. And I use MSCOMM Control 6.0 for transfering & receiving data in Serial COM Port. Here below is the structure of the data which the sensor send to me :
HEADER : 6 bytes
DATA : Fingerprint Image 280 x 240 = 67200 bytes !!!
FOOTER : 4 bytes
But the buffer of MSCOMM Control is only 32768 ( = 2^15 ). Therefore, now my problem is the size of that image is too large to receive in buffer. The buffer is overflow !!! In this situation, I think there are 3 ways to solve it :
+ Incearse the size of the MSCOMM's buffer.
+ Use other class for transfering & receiving data in Serial COM Port with the buffer enough large.
+ Parallel processing : doing both receiving data from sensor and saving data from buffer to other place ... simultaneously.
But I don't know how to implement above methods !!! Please kindly help me or you can show me other solutions ... THIS IS MY FINAL PROJECT FOR GRADUATING MY UNIVERSITY and the deadline is coming nearly, so, again, please help me !!!
Thank you very much !!!
Best regards,
Quang Dien
Email to me : quangdien12jan@yahoo.com
|
|
|
|
|
Did you try searching Code Project[^]?
Software Zen: delete this; // <a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" rel="nofollow">Fold With Us!</a>[<a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" target="_blank" rel="nofollow" title="New Window">^</a>]
|
|
|
|
|
I could not get what is the wrong in this?
Please let me know.
I am getting the error as follows.
error C3861: 'sprintf': identifier not found, even with argument-dependent lookup
TCHAR str1[50]=_T("");
_stprintf(str1,_T("The Sum is %d"),Add(10,20));
MessageBox(NULL,str1,_T("Add"),NULL); Here I Like to use _stprintf. How to use it?
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|