|
also see this[^]
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
hello all:
I have got a trouble in date time picker control
when i use the date time picker control to adjust the control time ,if i first select the hour field then i can only change the hour field ,even i set the cursor in the minutes field when i click the spin ,only the hour field changed,does this the control bug,how can i put the cursor in which where i chang which field
thanks !
a beginner
|
|
|
|
|
It works perfectly for me. i can change the hours, minutes and seconds as well.
|
|
|
|
|
why,can you tell me the reason?
i know the reason ,because i choose the enable edit property,when i disabled it worked fine
thanks
a beginner
modified on Wednesday, April 1, 2009 1:50 AM
|
|
|
|
|
I dont see any reason why your minutes will not change if you use the spin control.
open a new dialog based application. Add the date picker control. change the format to time from the combo box. and then run the application. It will work the way you wanted.
|
|
|
|
|
Check whether "Allow Edit" Property is enabled? If so disable it.
aks
|
|
|
|
|
Alright, I'm trying to incorporate TerminateProcess() into my progrms. I have two programs running at the same time, the first program opens the second via system("") and then continues to run a series of GetAsyncKeyState()checks that blocks input when certain keys are pressed. The second program is an annoying little game that runs through a random array of MessageBoxes. The issue I've hit is that when the second program finishes, the first program is still going--which means the BlockInput code is still ready to set off. What I'm trying to do is incorporate TerminateProcess() at the very end of the second program so that right before the second program finishes it closes the first, does anyone know how to do this?
|
|
|
|
|
Why not have the first program start the second using CreateProcess() and then wait on the process handle?
An alternative is to use a globally named event and have the first application wait on it (which is pretty much what my first suggestion is doing.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Because I'm attending a High School that offers no programming class at all and thus I have no prior instructed knowledge and have no idea how to do that. I've attempted via examples from searching around but I couldn't get them to work because I just don't have enough knowledge at this point.
|
|
|
|
|
DWORD ExecuteProcess(LPCTSTR pCommandLine, LPCTSTR pDirectory = NULL, DWORD millisecondsTimeout = INFINITE)
{
TCHAR* pCmdLine = (TCHAR*) _alloca((lstrlen(pCommandLine) + 1) * sizeof(TCHAR));
lstrcpy(pCmdLine, pCommandLine);
STARTUPINFO startupInfo;
memset(&startupInfo, 0, sizeof(startupInfo));
startupInfo.cb = sizeof(startupInfo);
PROCESS_INFORMATION processInfo;
memset(&processInfo, 0, sizeof(processInfo));
DWORD rval;
if (CreateProcess(NULL, pCmdLine, NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE, NULL, pDirectory, &startupInfo, &processInfo))
{
rval = WaitForSingleObject(processInfo.hProcess, millisecondsTimeout);
}
else
{
rval = GetLastError();
}
CloseHandle(processInfo.hProcess);
CloseHandle(processInfo.hThread);
return rval;
}
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
okay, thanks for the tidbit of code but I still dont know where to insert it or how to tell it what to open
|
|
|
|
|
You call this function in the first program instead of the system function.
It runs the second program (given in one of the parameters), waits for the second program to finish, then the function returns, so you can carry on doing whatever the first program should do.
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
You call ExecuteProcess with the same command line you would use at a command prompt. The directory is what the current directory should be set to.
For example, ExecuteProcess(_T("C:\\Windows\\System32\\Notepad.exe win.ini"), _T("C:\\Windows"));
This is very simple code, but it illustrates the basic principles. Go to MSDN and read up on CreateProcess() and WaitForSingleObject() . Read up on multi-threading and synchronization. Experiment. Step through the code. Until you fully understand this code, you will not be qualified to write any code.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I never did get an answer to my initial question
|
|
|
|
|
You can't do what you want. system doesn't give you back the identity of your process, so you have no way to (later) control it. You have to use some other mechanism to create the process, like (as Joe suggested) CreateProcess , which does give you the process identity (through the PID and a process handle in the case of CreateProcess ).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
gamefreak2291 wrote: I never did get an answer to my initial question
Your original question was posted when Europe had just gone to bed, India was debating getting to eat its breakfast Bhaji, and the Americas were having their after work beer. Or in your case, doing their homework.
1/ You don't pay us - we'll answer if / when we feel like.
2/ I'll give you credit for not putting "URGENTZ" in your subject line!
Anyway, Joe has given you a very good answer - if you need details, functions like CreateProcess have very long documentation to read.
I wish you success with your course,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
I am upgrading from an older version of Visual Studio to Visual Studio Express 9.0. In my code I have #include tapi.h. This causes an error. Does anyone know how to solve this?
|
|
|
|
|
It's in the platform SDK.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Windows SDK will not load with Visual Studio 2008. In the Platform SDK the dialer example uses tapi.h and does not comiple with VS2008. Do you have the dialer example from the Windows SDK?
|
|
|
|
|
|
If you only have the Visual Studio 2008 EXPRESS, the Windows SDK will not download into your PC.
I was able to solve the problem with '#include tapi.h'. When I created the project, Visual Studio left the "Preprocessor Definitions" blank. When I put in "WIN32;_DEBUG;_WINDOWS" it compiled OK.
Thanks for the responses.
|
|
|
|
|
Member 476468 wrote: Does anyone know how to solve this?
Solve what?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
In Visual Studio 2008, what replaces tapi.h?
|
|
|
|
|
Have you looked in the two include folders to see if the file exists, or search the .h files to see if they contain TAPI-related functions?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
I have derived class which has 2 base calsses CSyncObject and CSingleLock
Since the input to the CSingeLock is a pointer to a CSyncObject my question is
if I first create the CSyncObject can I reference that object object when executing
the Constructer for the CSingleLock with the "this" pointer
e.g. class mylock() : public CSyncObject(NULL) , public CSingeLock(this->
my question really is am I going down the right path
I would assume the "this" pointer gets initialized after excuting the first
contructer
|
|
|
|