|
Hi Prasad.
Thank you for your response.
The original window that I am having trouble creating was derived from CView. The suggestion that Mark Salsbery is making is that this could be the problem. I am going to try creating a window derived from CWnd, just to see what happens.
Cheers,
Mark
|
|
|
|
|
Jethro63 wrote: The suggestion that Mark Salsbery is making is that this could be the problem
Mark was refering to certain styles like WS_OVERLAPPEDWINDOW , would be inappropriate for view class.
|
|
|
|
|
Probably, this is last post this year. Its friday 11:37 PM here. Can continue on your problem on tuesday.
Happy new year.
|
|
|
|
|
Hi
I am using LDAP protocol (OpenLDAP) to speak to a MS active directory server. I have a DN of a user, and wants to retreive this users msExchMailboxGUID attribute which is (as far as I can read) a octal 16 byte array.
After a little research, I discovered a way to convert this value to a GUID that looks like this (string representation)
{A64B2D95-B730-4F2A-8F74-C6A37C11B7E5} (38 characters)
This works now on my computer which is an Intel based computer WinXP 32bit.
Which is what I am used to when I view GUID entries in MS SQL or .NET language.
I read somewhere that the GUID in memory is presented as
DWORD-WORD-WORD-BYTE BYTE-BYTE BYTE BYTE BYTE BYTE BYTE
I am no expert on the little-endian vs big-endian, but to obtain the guid string above, I had to start with byte [3], byte[2], byte[1] and byte[0], to get the first DWORD correct.
Is there anyone who has any advice on how to do this easier, or any knowledge if the first 4 bytes will always be in this order when I use LDAP protocol?
How can I in c++, convert a 4 byte "number" to an ascii string of 8 hex characters?
I did it by using _snprintf, and %02X for each byte, but I had to pick the bytes in the correct order out of the 16 byte array to get the right GUID.
I'm just posting to see if anyone has some advice or comments.
Thank you for reading.
|
|
|
|
|
Use StringFromCLSID() and CLSIDFromString() to convert between the two formats.
|
|
|
|
|
Hi again,
Thanks for the advice. I didn't get StringFromCLSID to work, as I didn't quite understand what to place into the function, but for my need, I could just copy the 16 octet bytes onto a GUID struct and call StringFromGUID2, and it worked.
Cheers.
|
|
|
|
|
My Dad just came across the following "interesting" bit of code while trying something out:
unsigned char fred[] = {1, 2, 3, 4};
unsigned char *p = fred;
printf("%d %d %d %d\n", fred[0], fred[1], fred[2], fred[3]);
printf("%d %d %d %d\n", *p++, *p++, *p++, *p++);
Looks like printf is being evaluated backwards, any idea as to the reasoning for this? Happens on the compiler he was using for the M16C and also on MSVC8.
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
Ed.Poore wrote: ...any idea as to the reasoning for this?
The result is undefined because the order of evaluation of function arguments are undefined. For more on this, search for sequence points.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Bizarre to say the least but at least we know it's there and can avoid it.
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
There's nothing bizarre about it. If the arguments are pushed on the stack from right to left
then it's behaving as implemented.
As David stated, this behavior is undefined. A C compiler is free to implement how function
calls are made in any way so relying on a specific behavior like this would be bad
Mark
|
|
|
|
|
I agree with your points, it's just that he [Dad] thinks that it should work the way he says it should
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
I agree. I'm ready for a compiler that works the way I say it should
|
|
|
|
|
|
That's why I wear a robe and carry a staff when I code...
|
|
|
|
|
Chris Meech wrote: Sorry, couldn't resist.
You shouldn't have
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
Ed.Poore wrote: Looks like printf is being evaluated backwards
Have a look on printf implementation. It calls a function output (I think is in output.c file in folder crt).
From what I saw, printf evaluates from left to right the format string and uses the va_list argument as format specifier requires.
The arguments are probably stored in va_list from right to left, and your p points actually to the last argument. It's a __cdecl, after all.
(I am not sure - just thinking with loud voice).
|
|
|
|
|
I'd take a look but it doesn't bother me, Dad can't understand why it does it that way but that's the way it does it so he has to put up with it.
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
how to print out the characters and integers mixed together randomly.
|
|
|
|
|
Could you please be a little more descriptive?
Artificial Intelligence is no match for Natural Stupidity
No one can understand the truth until he drinks of coffee's frothy goodness. ~Sheik Abd-al-Kadir
I can't always be wrong ... or can I?
|
|
|
|
|
Hi ,
sorry anyway..
for example .. k 10 5 r 3 .. etc..
But I set 4 char and 10 int(frm 1-10) ..
thz in advance!
|
|
|
|
|
Do you want to have string and integer together on output?
|
|
|
|
|
...rather vague...
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.
|
|
|
|
|
Hi all. I was just curious on how to keep a function going until i close the window manually. I know i'll need a loop of some sort however i dont know what i should do. I made a test function to see if i could do it.
<br />
#include <fstream><br />
using namespace std;<br />
int main (){<br />
int loop;<br />
for(loop=0;loop<=10;loop++)<br />
{<br />
printf("Test looping\n");<br />
}<br />
system("pause");<br />
return 0;<br />
}<br />
Now anyone can clearly see that this function loops "Test looping" 10 times. But thats not my intention. Suppose i had a function that would check the time every 30 seconds, then print the time to a file. And it wouldnt stop until i forced it to stop. I hope im making sense, and that everyone understands. If im not being clear enough please let me know. Thanx in advance.
|
|
|
|
|
I think you need to use a timer...
|
|
|
|
|
dellthinker wrote: system("pause");
A much easier way to do that:
printf("Press enter to continue...");
char buff[2];
fgets(buff,sizeof(buff),stdin);
Software Zen: delete this;
|
|
|
|