Click here to Skip to main content
15,892,537 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: VC++ 6.0 and XP Pin
Joe Woodbury6-Nov-03 10:40
professionalJoe Woodbury6-Nov-03 10:40 
GeneralRe: VC++ 6.0 and XP Pin
iltallman6-Nov-03 11:06
iltallman6-Nov-03 11:06 
GeneralRe: VC++ 6.0 and XP Pin
Joe Woodbury6-Nov-03 14:09
professionalJoe Woodbury6-Nov-03 14:09 
GeneralPrinting a CDialog Pin
doctorpi6-Nov-03 7:20
doctorpi6-Nov-03 7:20 
GeneralRe: Printing a CDialog Pin
Peter Molnar7-Nov-03 15:44
Peter Molnar7-Nov-03 15:44 
GeneralDependency Generator Pin
Kant6-Nov-03 7:09
Kant6-Nov-03 7:09 
GeneralRe: Dependency Generator Pin
unitrunker6-Nov-03 15:36
unitrunker6-Nov-03 15:36 
GeneralTerminal Server Problem Pin
Spiros6-Nov-03 6:47
Spiros6-Nov-03 6:47 
Hi everybody

I am creating an application using VC++ that runs on a terminal server with 30 end users. The end users will use thin clients as front end machines. The application consists of a main menu executeble that opens other executables depending on the user selection. In order to establish that communication I use named pipes. Actually I use 1 named pipe as the main tube for data transfer. What happens is that sometimes the session of any user may freeze and another user may view his data. As a result I have started suspecting that something is wrong with the method that creates the child process and also that at a certain point one user may "use" the name pipe share of the other. The code that performs the above call is:

int CTransfer::StartTalking(CString szNewProcess, CNamedPipe* m_ServerObject, char *pszBuffer)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
char szProcess[128];

strcpy(szProcess , (LPCTSTR)szNewProcess);

ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );

szNewProcess += ".exe";

// Start the child process.
if( !CreateProcess( NULL, // No module name (use command line).
szProcess, // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
TRUE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ) // Pointer to PROCESS_INFORMATION structure.
)
{
return 1;
}
#ifndef _DEBUG
if (strlen(pszBuffer))
{
DWORD dwBytesWritten;
if (m_ServerObject->ConnectClient())
m_ServerObject->Write(pszBuffer , strlen(pszBuffer), dwBytesWritten);
}
#endif
// Wait until child process exits.
WaitForSingleObject( pi.hProcess, INFINITE );

// Close process and thread handles.
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );

return 0;
}

I am thinking that I could do certain things such as:
1. create 1 named pipe per module in order to distribute traffic to more named pipes.
2. use a CreateMutex before the CreateProcess and Release it before the WaitforSingleObject

I will definitely appreciate any opion or help that you might provide.
Thank you for your time

Spiros Prantalos
Miami the place to be!!
Generalhi to everyone! newbie Pin
Guhji6-Nov-03 6:43
Guhji6-Nov-03 6:43 
GeneralRe: hi to everyone! newbie Pin
Dominik Reichl6-Nov-03 7:58
Dominik Reichl6-Nov-03 7:58 
GeneralRe: hi to everyone! newbie Pin
vhunghl6-Nov-03 17:05
vhunghl6-Nov-03 17:05 
GeneralRe: hi to everyone! newbie Pin
Dominik Reichl6-Nov-03 20:55
Dominik Reichl6-Nov-03 20:55 
GeneralRe: hi to everyone! newbie Pin
Jean Bédard6-Nov-03 10:43
Jean Bédard6-Nov-03 10:43 
GeneralRe: hi to everyone! newbie Pin
parths6-Nov-03 16:15
parths6-Nov-03 16:15 
Questionfile version manipulation? Pin
badsmonkey6-Nov-03 4:26
badsmonkey6-Nov-03 4:26 
AnswerRe: file version manipulation? Pin
valikac6-Nov-03 5:39
valikac6-Nov-03 5:39 
GeneralRe: file version manipulation? Pin
badsmonkey6-Nov-03 7:27
badsmonkey6-Nov-03 7:27 
GeneralClass/Library for connecting FTP through Proxy servers (SOCKS4, 5, HTTP) Pin
Uwe Keim6-Nov-03 3:38
sitebuilderUwe Keim6-Nov-03 3:38 
GeneralRe: Class/Library for connecting FTP through Proxy servers (SOCKS4, 5, HTTP) Pin
Niall Barr6-Nov-03 4:02
professionalNiall Barr6-Nov-03 4:02 
GeneralRe: Class/Library for connecting FTP through Proxy servers (SOCKS4, 5, HTTP) Pin
Uwe Keim6-Nov-03 4:18
sitebuilderUwe Keim6-Nov-03 4:18 
GeneralRe: Class/Library for connecting FTP through Proxy servers (SOCKS4, 5, HTTP) Pin
Uwe Keim11-Nov-03 0:31
sitebuilderUwe Keim11-Nov-03 0:31 
GeneralShutdown n/w "WIN98" computer Pin
Jackson Antony6-Nov-03 2:53
Jackson Antony6-Nov-03 2:53 
GeneralRe: Shutdown n/w "WIN98" computer Pin
Brian Shifrin6-Nov-03 3:42
Brian Shifrin6-Nov-03 3:42 
QuestionWhere can I get 'dxerr8.h'? Pin
knokke6-Nov-03 2:10
knokke6-Nov-03 2:10 
AnswerRe: Where can I get 'dxerr8.h'? Pin
Mike Dimmick6-Nov-03 2:36
Mike Dimmick6-Nov-03 2:36 

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.