Click here to Skip to main content
16,005,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Transferring Data from a Dialog to a SDI View Pin
jhwurmbach26-Jul-07 3:36
jhwurmbach26-Jul-07 3:36 
GeneralRe: Transferring Data from a Dialog to a SDI View Pin
CrocodileBuck26-Jul-07 3:45
CrocodileBuck26-Jul-07 3:45 
GeneralRe: Transferring Data from a Dialog to a SDI View Pin
CrocodileBuck26-Jul-07 3:51
CrocodileBuck26-Jul-07 3:51 
Questionwhy the dialog would closed? Pin
kcynic26-Jul-07 2:42
kcynic26-Jul-07 2:42 
AnswerRe: why the dialog would closed? Pin
Cedric Moonen26-Jul-07 3:01
Cedric Moonen26-Jul-07 3:01 
GeneralRe: why the dialog would closed? Pin
kcynic26-Jul-07 4:17
kcynic26-Jul-07 4:17 
AnswerRe: why the dialog would closed? Pin
Hamid_RT31-Jul-07 20:56
Hamid_RT31-Jul-07 20:56 
Questionmailslot in mfc() Pin
mirraa26-Jul-07 2:41
mirraa26-Jul-07 2:41 
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..
QuestionRe: mailslot in mfc() Pin
David Crow26-Jul-07 3:14
David Crow26-Jul-07 3:14 
Questionfont problem in scintillawnd Pin
mirraa26-Jul-07 1:59
mirraa26-Jul-07 1:59 
AnswerRe: font problem in scintillawnd Pin
Roger Broomfield26-Jul-07 2:45
Roger Broomfield26-Jul-07 2:45 
GeneralRe: font problem in scintillawnd Pin
David Crow26-Jul-07 3:15
David Crow26-Jul-07 3:15 
QuestionIn place string reversal throws exception ... Pin
dharani26-Jul-07 1:41
dharani26-Jul-07 1:41 
AnswerRe: In place string reversal throws exception ... Pin
Nemanja Trifunovic26-Jul-07 1:51
Nemanja Trifunovic26-Jul-07 1:51 
AnswerRe: In place string reversal throws exception ... Pin
#realJSOP26-Jul-07 2:11
professional#realJSOP26-Jul-07 2:11 
AnswerRe: In place string reversal throws exception ... Pin
Roger Broomfield26-Jul-07 2:58
Roger Broomfield26-Jul-07 2:58 
GeneralRe: In place string reversal throws exception ... Pin
#realJSOP26-Jul-07 7:32
professional#realJSOP26-Jul-07 7:32 
AnswerRe: In place string reversal throws exception ... Pin
David Crow26-Jul-07 3:18
David Crow26-Jul-07 3:18 
QuestionWhere can I get msdn? Pin
Chen-XuNuo26-Jul-07 1:26
Chen-XuNuo26-Jul-07 1:26 
AnswerRe: Where can I get msdn? Pin
#realJSOP26-Jul-07 2:12
professional#realJSOP26-Jul-07 2:12 
GeneralRe: Where can I get msdn? Pin
Roger Broomfield26-Jul-07 2:34
Roger Broomfield26-Jul-07 2:34 
GeneralRe: Where can I get msdn? Pin
Chen-XuNuo26-Jul-07 3:09
Chen-XuNuo26-Jul-07 3:09 
AnswerRe: Where can I get msdn? Pin
Ravi Sant20-Jun-11 2:48
Ravi Sant20-Jun-11 2:48 
QuestionBoost thread and C++ Pin
Mwambe26-Jul-07 1:14
Mwambe26-Jul-07 1:14 
AnswerRe: Boost thread and C++ Pin
Nemanja Trifunovic26-Jul-07 1:38
Nemanja Trifunovic26-Jul-07 1:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.