|
toxcct wrote: of course, you're looking for devil every where [Poke tongue]
of course.
toxcct wrote: BTW, looking at the level of the question, i think it's worth saying that a char IS a BYTE:
Nope. As you know (I know that you know ), char is a signed integer ranging from -128 to 127 , while a BYTE is an unsigned integer ranging from 0 to 255 .
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
but you're already going to far by interpreting the bits pattern.
a BYTE is 8 bits, which is exactly what a char is supposed to be too.
|
|
|
|
|
toxcct wrote: but you're already going to far by interpreting the bits pattern.
Duty sir, duty.
toxcct wrote: a BYTE is 8 bits, which is exactly what a char is supposed to be too.
float and int (even pointers !) have the same size on 32 bit systems but we usually don't consider them being the same.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Something like:
<br />
BYTE* pByte = reinterpretcast< BYTE* >( pChar );<br />
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Matthew Faithfull wrote: BYTE* pByte = reinterpretcast< BYTE* >( pChar );
quite... reinterpret_cast is the correct word ^^
BTW, i didn't try, but wouldn't static_cast just work here ?
|
|
|
|
|
Right you are, I knew that looked wrong somehow. I don't think static_cast works on pointers even when there are in fact a type match as these probably would be. Would have to try it to be sure.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
toxcct wrote: BTW, i didn't try, but wouldn't static_cast just work here ?
A static_cast won't work.
|
|
|
|
|
A BYTE is nothing but an unsigned char. If you do the math, that would tell you that the conversion may result in data loss, depending on the value stored in the char variable. The following situation may be an example:
char p = -23;
int i;
BYTE b;
|
|
|
|
|
To be very picky you don't actually loose data, as it's still an 8-bit value. It's just that the semantics change, your -23 = 11101001 gets reinterpretted as 233 = 11101001.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
[Footer: not for nitpicks, but for the noob op]
|
|
|
|
|
I wanted to use a Console Window to output some debug information for my MFC application, that all works fine, but would like to make the Window a bit larger without having to modify the properties of the Console WIndow by hand each time.
I tried this bit of code as the Console was being created - but did not work.
AllocConsole();
m_hConsole = GetStdHandle( STD_OUTPUT_HANDLE );
int handle = _open_osfhandle( (long) m_hConsole, _O_TEXT );
m_fConsole = _fdopen( handle, "w" );
dwSize.X = 120;
dwSize.Y = 50;
SetConsoleScreenBufferSize(m_hConsole, dwSize);
Any sugegstions please
Andy.
|
|
|
|
|
Hi,
on WinXP the layout tab of the console allows you to modify its buffer and window size, and
to make these changes permanent for all future console windows with the same title.
on Vista the option is gone, it just always does it that way.
So for both: do it once manually, then keep the title constant.
|
|
|
|
|
Hi there
I have a Some Question
When I Get Logon UserName , I try to use GetUsername Function
But, Function retrieve Name that is "SYSTEM"
Why are retrieve "SYSEM" user name?
|
|
|
|
|
|
TCHAR infoBuf[INFO_BUFFER_SIZE]; //Account Name
DWORD bufCharCount = INFO_BUFFER_SIZE;
if(NULL == GetUserName(infoBuf, &bufCharCount) )
{
DWORD dwRet = GetLastError();
}
thats all;
|
|
|
|
|
Member 3736335 wrote: GetUsername Function
The GetUserName function retrieves the user name of the current thread.
Try the NetUserGetInfo() function retrieves information about a particular user account on a server or NetWkstaUserEnum
Hope this helps
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks your reply
now i trying to NetUserGetInfo Function , but thats so hard to me~!
hehe
|
|
|
|
|
Did you try to google with NetUserGetInfo keywork. I got this
Sample Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Very Thanks _AnShUmAn_
When i find some information , i can try WNetGetUser Function.
the function is same retrieve logon user name.
so, what is different that WNetGetUser and GetUserName?
|
|
|
|
|
any body has experience with novell edirectory LDAP server from your application ?
if yes,
I want to send multiple asyncronus requests to edirectory LDAP server. when i try send 1000 request at a time, eDir LDAP server accepts only few requests.
How can i tune eDir LDAP server into support huge requests ?
Thanks,
Sakthi
Nice things do nice works
|
|
|
|
|
is there any API is there using which we can done the os provisioning in windows . ??
Can any body tell me how the provisioning of os can be done programmically .
vineesh
|
|
|
|
|
what are you calling "provisionning the OS" ?
|
|
|
|
|
Can you more explain,please?
|
|
|
|
|
provisioning simply means automatically installing and configuring operating systems,
Suppose i have a server machine and some n number of computers connected to it . The server then done a mulitcast to all the members to know which machine is needed a O/S installation . The client machines which are waiting for installation will send back a request to the server .
Then the server needs to install the O/S followed by the system softwares and appln softwares on to the respective machines .
There are two different ways to achieve this
one is a disk cloning
second is a scripted installation
Both disk cloning and unattended scripted installs can be performed remotely using a PXE/DHCP server.
Now my question is whether we are bale to write some APIs for this
remote installations ?
Is it clear now ..?
vineesh
|
|
|
|
|
Be solved by using CWorkbook::SaveAs and CFileDialog.
system
modified on Monday, July 28, 2008 9:29 AM
|
|
|
|