|
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
|
|
|
|
|
|
CApplication app;
...
app.Quit;
system
|
|
|
|
|
Hi,
I found the code below work, but got a problem.
_variant_t var(NULL);
app.Save(var);
If I choose cancel in the SaveAs dialog, the will be an error that says Save method is invalid.
Any suggestion?
system
|
|
|
|
|
hi ,
I have a application to disable buttons .
Example :
There are 50 buttons , If i put 20 in the text box 20 buttons should be shown . Please tell me using ARRAY .
Because i have done it manually i.e
Getdlgitem(id_button)->enablewindow(true);
I need using ARRAY because ,there r 50 buttons know ..
With warm regards
K.Guru moorthy
k.guru moorthy
|
|
|
|
|
The real question is, "Why is your window having 50 buttons on it?".
Anyways, if the IDs of the buttons are sequential, you may run a loop and call EnableWindow(true) from within it.
|
|
|
|