|
Maybe there is a problem with the synchronisation between the threads. Make sure all variables shares between the threads are secured by mutexes, critical sections or other synchronisation mechanisms.
The error you described could be caused by a global class that is initialized by one thread, and accesses by another one at the same time. You have to be very careful with multithreading, it needs lots of planning that it really works without any problems.
Don't try it, just do it!
|
|
|
|
|
Thankx a lot Alexander
It really helped me a lot
Thankx again
Amarelia Maehesh
Gujarat
India
|
|
|
|
|
I've managed to host a web browser window in my program but am unable to work out how to handle events fired from the browser window. I know it has something to do with the DWebBrowser2 interface but how do you hook it up? The program is written in plain Win32 ie. not MFC, ATL etc.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
i need help in developing a remote software deployment Application.
Suggest an API for this..
Kalpesh
|
|
|
|
|
K@LPESH wrote:
i need help in developing a remote software deployment Application.
Suggest an API for this..
Hello Kalpesh,
there is no such api for remote software deployment,you have o craete your own.
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
I know Alok ,But I am such an Optimistic about code-project thats why.
|
|
|
|
|
|
This macro fills the frame buffer with a single uncompressed frame from the capture device.
The above discription found in MSDN library, do you know what is the format of the uncompressed frame? is it bitmap???
Thanks alot!
|
|
|
|
|
I wanted to know whether , "kill" is a command provided by every windows OS , or what?
|
|
|
|
|
|
What kill command?? There is no kill command!
Don't try it, just do it!
|
|
|
|
|
No, it is not common to all. That would be one amazing utility since there are at least 54 different OSs[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Yes they are so many operating systems. But you can find the kill command in OS's like unix
-oam-
|
|
|
|
|
Of course, but re-read the original post again. It was whether KILL was supported on all OSs not whether it was supported on Unix.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Then we will be living in a new planet if it can be supported by all OSs.
-oam-
|
|
|
|
|
In my MFC MDI application I'm trying to add some new entries to the "Help" menu.
I have an existing menu item with ID_HELP identifier, this works fine, and displays the correct message in the application status bar (as specified under ID_HELP in the String Table).
If I add a new menu item, say ID_HELP_NEW, and a new string in the String Table under ID_HELP_NEW - you'd expect that string to show in the status bar when you hover over the new menu item, yes?
However, regardless of my string table entry the application shows "Switch to the previous document window" in the status bar for all new entries on the help menu. Seems to be something automatic done by MFC. (I've deleted my "Window" menu, if that makes any difference).
Anyone have an inkling what isgoing on here?
Cheers,
Dan
|
|
|
|
|
Seems I was accidently reusing one of the default resource IDs, hence I was getting the wrong message. If I change my new resource ID to something lower, everything works fine!
|
|
|
|
|
.
modified 1-Dec-11 1:54am.
|
|
|
|
|
Are you trying to interfere a LAN party?
Don't try it, just do it!
|
|
|
|
|
i'm using a list box and list control to displaying my data which retrieve from my database in different dialog and now i would like to save the data that i retrieve in a .txt file..
i wish to use CFileDialog.DoModal() to save my file...
can anybody give me some guide on how to transfer my data in list box or list control to a txt file?
|
|
|
|
|
if you are a MFC user, the following should help :
CString str;
ofstream file("file.txt");
CListBox* pLB = GetDlgItem(IDC_LISTBOX);
int NbLines = pLB->GetCount();
for (int i = 0; i < NbLines; i++) {
pLB->GetLBText(i, str);
file << (LPCTSTR)str << '\n';
}
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Here is the CFileDialog part only, the other part you asked was already answered....
static char BASED_CODE szFilter[] = _T("Text Files (*.txt)|*.txt||");
CFileDialog m_ldFile(FALSE,_T(".txt"),_T("file.txt"),OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter);
if (m_ldFile.DoModal() == IDOK)
{
CString strPath = m_ldFile.GetPathName();
}
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
with doing this my file is not created!! Do u have any syntax that can let my file created?
|
|
|
|
|
Am trying to telnet a server on a particular port immediately after reboot of a 98 PC and obtained a failure in the connection.After repeating the telnet connection for 3 times,only at the fourth time am able to connect to the server on that port.This happens only in Windows 98 PC.Hope I would get help on this.
URagav
Everything can be sacrificed for truth, but truth cannot be sacrificed for anything .
|
|
|
|
|
Pliz help me to validate my input in my program below.I want to accept the integer input only but not characters, how do i do it because i used dafault in my case statement. If i enter characters the program crushes.
#include <stdio.h>
#define _WIN32_WINNT 0x0400
#define WINVER 0x0400
#include <windows.h>
#include <stdio.h>
#include <windef.h>
#include <winbase.h>
#include <imagehlp.h>
#include <stdlib.h>
typedef struct _iobuf FILE;
#include <assert.h>
#include <sys types.h="">
#include <sys stat.h="">
int menu(void)
{
int choice;
printf ("\n");
printf ("*****************************************\n");
printf ("*\t\t\t\t\t*\n*\tPROCESS CREATION \t\t*\n");
printf ("=========================================");
printf ("\n=\t 1: Create a process \t\t=");
printf ("\n=\t 2: Suspend the process\t\t=");
printf ("\n=\t 3: Resume process \t=");
printf ("\n=\t 4: Shutdown the process \t=");
printf ("\n=========================================\n");
printf ("\n");
printf("\nEnter choice (1-4): ");
scanf("%d", &choice);
return choice;
}
int main(int argc, char **argv)
{
PROCESS_INFORMATION pi; /* filled in by CreateProcess */
STARTUPINFO si; /* startup info for the new process*/
HANDLE hProcess;
DWORD lpAddr = 0;
TCHAR lpApplicationName[_MAX_PATH]="";
int result;
char ans [4]="";
int choice;
while((choice = menu())!=5)
{
switch (choice)
{
case 1:
GetStartupInfo(&si);
lpAddr = 0;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
printf("Enter process you want to execute: ",lpApplicationName);
scanf ("%s",lpApplicationName);
printf("Process %d reporting for creation\n",GetCurrentProcessId());//print out our process ID
CreateProcess(NULL, /* lpApplicationName */
lpApplicationName, /* lpCommandLine assumes to use curent process directory*/
NULL, /* lpsaProcess */
NULL, /* lpsaThread */
FALSE, /* bInheritHandles */
CREATE_NEW_CONSOLE, /* dwCreationFlags */
NULL, /* lpEnvironment */
NULL, /* lpCurDir */
&si, /* lpStartupInfo */
&pi /* lpProcInfo */
);
hProcess = pi.hProcess;
printf("New Process ID: %d ",pi.dwProcessId);
printf("has started \n");
break;
case 2:
SuspendThread(pi.hThread);// identifies thread to suspend
break;
case 3:
ResumeThread(pi.hProcess);
break;
case 4:
printf("\nYou are about to terminate a running process, do you want to continue ( y or n) ");
scanf ("%s",ans);
result = strcmp(ans,"y");
if (result==0)
{
TerminateProcess(pi.hProcess, 0);//identifies the process to terminate
GetLastError();
}
break;
default:
printf("\nInvalid choice: ");
}
}
return (0);
}
-oam-
|
|
|
|