|
|
Greg Mort wrote: you cant read can you?
Yes, I'm able to (as a proof I can see a typo in your sentence... ).
Good luck with your reversed char[] and float .
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]
|
|
|
|
|
This is C++, you don't even need a union , you could just type-pun it directly, from a char[] to a double* or float* or whatever you want. The union isn't any better with Unidefined Behaviour here, only one member of the union is required to have a value at any one time - so it's just as bad as pointer-wise type-punning. Both methods should work anyway.
|
|
|
|
|
Thank you, I just figured this out as well
|
|
|
|
|
|
Looks like an endianess issue.
|
|
|
|
|
I agree, so how to I grab it from a file, reorder the data, and place the value in a double variable?
|
|
|
|
|
Maybe this[^] article will help.
|
|
|
|
|
Please look at the following lines of code.
<br />
PULONG count;<br />
PLUID* sessions;<br />
<br />
LsaEnumerateLogonSessions(count, sessions);<br />
I got the following error on that..
<br />
error C3861: 'LsaEnumerateLogonSessions': identifier not found, even with argument-dependent lookup<br />
Any idea why it's happen there in the code?
Thanks a lot
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Are you sure you're including the correct headers?
|
|
|
|
|
CodingLover wrote: Any idea why it's happen there in the code?
Are you including Ntsecapi.h ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
In my code I'm trying to call SendARP to get the MAC address of a computer on the local network. I have their IP address in the in_addr data format, but SendARP takes it as an IPAddr.
I looked on MSDN and they don't offer any explicit ways to convert between the two and google searches so far have not proven fruitful.
Anyone done this before?
|
|
|
|
|
I am BATMAN wrote: In my code I'm trying to call SendARP to get the MAC address of a computer on the local network. I have their IP address in the in_addr data format, but SendARP takes it as an IPAddr.
I looked on MSDN and they don't offer any explicit ways to convert between the two and google searches so far have not proven fruitful.
Anyone done this before?
Have you looked at the two definitions? IPAddr and in_addr ?
|
|
|
|
|
yes, that was sort of vague...are you talking about how it says you can cast an IPAddr to an in_addr? I tried casting the other direction (in_addr to IPAddr) but it throws errors.
Forgive me, this is basically the beginning of my windows C++ programming, up until now it's all been command line linux code. Is there a special way to cast with the win API or something?
|
|
|
|
|
I am BATMAN wrote: Forgive me, this is basically the beginning of my windows C++ programming, up until now it's all been command line linux code. Is there a special way to cast with the win API or something?
Then you need to study beginners material of the language since you need to understand types, structures and unions as well as many, many other things. Trying to explain them to you in a forum is not appropriate.
typedef struct in_addr {
union {
struct { UCHAR s_b1,s_b2,s_b3,s_b4; } S_un_b;
struct { USHORT s_w1,s_w2; } S_un_w;
ULONG S_addr;
} S_un;
The S_addr member of the union is the same type as IPAddr.
typedef ULONG IPAddr;
|
|
|
|
|
Oh ok, it worked when I saved the variable as a IPAddr the same way I was originally saving the in_addr instead of trying to cast between the two. Thanks anyways
|
|
|
|
|
Anybody has idea how to start specific service in remote using WMI C++ API.
Jack Rong
|
|
|
|
|
Get the frak off of this site you lazy pile of dung.
|
|
|
|
|
Hello all,
I working on one win32 application. I need to change the font of my controls. This can be done by sending WM_SETFONT message to the control. but it need hFont as WPARAM. and to create hFont we need CreateFont() function but it is only available in MFC not in win32. so what is alternative of this.
|
|
|
|
|
I believe you are wrong with that, CreateFont, CreateFontIndirect and such API calls can be used without MFC.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
zakkas2483 wrote: ...to create hFont we need CreateFont() function but it is only available in MFC not in win32. so what is alternative of this.
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I m getting Error Message "CreateFont: identifier not found".
|
|
|
|
|
Sounds like you're not including the right files. Check the dependencies for that function.
|
|
|
|
|
I have derived a subclass from CFileDialog. I would like to check that certain conditions are correct before the dialog is closed. How can I intercept the message to close the dialog? My derived dialog class includes an OnDestroy(), but the dialog is already closed before it is reached.
|
|
|
|
|
No need to derive from CFileDialog , just supply a hook procedure and set the lpfnHook member. See here for more.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|