|
|
I would have a try.
Thanks
|
|
|
|
|
You must override OkOn for Enter and OnCancel fo Esc buttons.
|
|
|
|
|
hi in my program
i have to write some msgs in a mailslot in one computerand i ve to read them in another computer..
the code i'm using for writing is:
handle = CreateFile("\\\\park-testbench4\\mailslot\\sample1",
GENERIC_WRITE,
FILE_SHARE_READ,
0,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
0);
if (handle == INVALID_HANDLE_VALUE)
{
printf("error in creating mailslot");
}
err = WriteFile(handle, MyMessage, sizeof(MyMessage), &numWritten, 0);
if (!err)
{
printf("error in writing");
}
if (sizeof(MyMessage) != numWritten)
printf("WriteFile did not read the correct number of bytes!\n");
park-testbench4 is my computer name..its writing fine...
and i'm using the following code to read:
handle = CreateMailslot("\\\\park-testbench4\\mailslot\\sample1",
0,
MAILSLOT_WAIT_FOREVER,
NULL);
if (handle == INVALID_HANDLE_VALUE)
{
printf("error in creating mailslot :%d",GetLastError());
}
for (;;)
{
DWORD msgSize;
BOOL err;
err = GetMailslotInfo(handle, 0, &msgSize, 0, 0);
if (!err)
{
printf("GetMailslotInfo failed");
}
if (msgSize != (DWORD)MAILSLOT_NO_MESSAGE)
{
char * buffer;
buffer = (char*) malloc(100);
if (!buffer) printf("An error getting a memory block!");
else
{
DWORD numRead;
err = ReadFile(handle, buffer, msgSize, &numRead, 0);
if (!err)
printf("ReadFile error: %d", GetLastError());
else if (msgSize != numRead)
printf("ReadFile did not read the correct number of bytes!");
else
{
printf("%s",buffer);
}
GlobalFree(buffer);
}
}
Sleep(1000);
}
}
but error is coming as Error in creating mailslot ...
why i'm getting such error only during reading...
any help..
thanx n advance..
|
|
|
|
|
mirraa wrote: but error is coming as Error in creating mailslot ...
What is the actual error?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi
in my program i want to change the font to courier new so that i can type in courier new font n my scintilla window...
anyone please help me out how to change the default font of scintillawnd window...
thanx in advance....
|
|
|
|
|
what is a "scintillawnd" ?
|
|
|
|
|
This perhaps.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all
I am running a piece of code and it asserts . Any ideas why so ? . I use VC++ 6.0 Dialog based application
char* one ="hello";
StrRev(one);
.....
.....
void StrRev(char *s)
{
for(char *end = s + (strlen(s) - 1); (end > s) ; --end, ++s)
{
char tmpChar = (*s);
(*s) = (*end); <---- it throws exception here ....why ?
(*end) = tmpChar;
}
}
redindian
|
|
|
|
|
Change
dharani wrote: char* one ="hello";
to
char one[] ="hello";
|
|
|
|
|
That's not very maintainable.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
given that this is the C++/MFC forum, why not look at CString::MakeReverse()
|
|
|
|
|
I think he was either inspired by my recent what-happened-at-the-interview stories in the lounge, or he's got an interview himself.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
dharani wrote: (*s) = (*end); <---- it throws exception here ....why ?
Why have you not bothered to use the debugger to answer such a question? By looking at the values of those variables as the program runs, you'll no doubt see exactly what is happening, and learn a valuable lesson along the way.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Where can I download msdn?What I downloaded can't be setup at all..
Thanks~
|
|
|
|
|
You need to buy it first.
If you want to waste your money, that's fine, but the msdn website is open to all.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
What John meant to say was, you can buy it or find it online here[^]
|
|
|
|
|
Hoho..Thanks a lot.What John said amazing me just now.
|
|
|
|
|
There is nothing as such free lunch!
// ♫ 99 little bugs in the code,
// 99 bugs in the code
// We fix a bug, compile it again
// 101 little bugs in the code ♫
|
|
|
|
|
|
Hi,
I am looking for an example how to create a thread using the library Boost. If someone have un code example that will be grateful.
Thanks
|
|
|
|
|
|
I want source of an application that nobody can kill or terminate it .
please help me as soon as possible ...
DMASTER
|
|
|
|
|
There's no such thing. To kill it, all they have to do is reboot the machine. Now what, Einstein?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John I assure you I could write an application that fits the requirements. As to whether or not YOU in particular would install it remains to be seen. To circumvent your reboot and application is killed scenario I just need to write a service and convince you to install it, IE nortons internet security.
|
|
|
|
|
Developer611 wrote: I want source of an application that nobody can kill or terminate it .
Training for a job application at a 'black hat' or a spam consortium?
Failure is not an option - it's built right in.
|
|
|
|