|
How do i maintain the focus in a edit box? For example i was typing half-way in the edit box, however an event occur and the focus got changed. How do i set the focus to remain in the edit box.
This is wat i tried to do when the event occurs
<br />
if(m_alarmOn==false)<br />
{ <br />
m_alarmOn= true;<br />
<br />
CWnd* prev = this->SetFocus();<br />
prev->SetFocus();<br />
<br />
CreateThread(0,NULL,CSecurityDlg::playSound,this,0,0);<br />
}<br />
<br />
The above code reside in a OnBtnClick function. So when alarm is on, the button will be auto click....and the alarm sound goes off....
But in the process of these, i might be typing in a editbox. So i will lose the focus...How do i get it to stay?
Aaron
|
|
|
|
|
void APPDlg::OnKillfocusTextBox()
{
//set condtion here to see if the user has finshed typing..
//else do this,
m_TextBox.SetFocus();
}
u can never get out of ur textbox if u dont handle it correctly
V
|
|
|
|
|
Tks. I resolved it using pic control and defining a WM_action message instead. Thought this would be neater.
|
|
|
|
|
How do i include a header files directory of another library to my project's include file path.
|
|
|
|
|
Open the project settings.
Go to the C++ tab.
Use the combobox to go to the Preprocessor entry.
Under 'additional include folder' enter a relative or absolute path.
I prefer to use relative paths from the DSW file, since I might end up with a different drive letter or arrange items into different levels. Less work if things are relocated relatively to each other than a hard coded path to some specific drive in some specific rooted folder hierarchy.
|
|
|
|
|
Suppose im using an open source library borZoi-1.0.2.I copy its folder to my project and the header files r in
borZoi-1.0.2\src directory so what will b the relative path with respect to DSW file
|
|
|
|
|
hi,
i am trying to use the borzoi 1.02 with Visual studio 2008 C# .NET,
i am trying to use the ECC implementation in this library,
so how can i integrate this library and use its functions from within VS 2008 C#.
thanks alot
|
|
|
|
|
|
who can tell me about change the tcp/ip packet on ndis or spi,please give me
the code for example,thanks a lot!!!
riynivke
|
|
|
|
|
Hi,
Do anyone know will DDE(dynamic data exchange) still be supported
in window longhorn ?
Thank
|
|
|
|
|
Hi all,
While i use
CreateProcess(
LPCWSTR pszImageName,
LPCWSTR pszCmdLine,
LPSECURITY_ATTRIBUTES psaProcess,
LPSECURITY_ATTRIBUTES psaThread,
BOOL fInheritHandles,
DWORD fdwCreate,
LPVOID pvEnvironment,
LPWSTR pszCurDir,
LPSTARTUPINFOW psiStartInfo,
LPPROCESS_INFORMATION pProcInfo
);
I want to pass a structure as second parameter(pszCmdLine) in this function. But somehow child process can't correctly get the structure! Should i do anything like "cast" or.. before i pass it? thanks for any advice!
|
|
|
|
|
How do you plan to pass the data of the structure ? You can't just pass a pointer to the second process because the pointer is only valid in the context of the original process.
I think you need to pass the value of each member of the structure as a text string to the second process and it must parse the values and "re-assemble" the data structure.
|
|
|
|
|
gosh - it didn't occur to me that he could be trying to pass a pointer
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I don't know - I try to assume literal interpretations of questions. I could easily be wrong.
I guess another option for him is WM_COPYDATA.
|
|
|
|
|
I also assumed they wanted to pass data or a pointer to some data.
|
|
|
|
|
The command line parameter is a string. Because it's a wide string, each character is two bytes. You should pass the parts of the struct as a comma seperated string and rebuild it in the process.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Generate a new GUID.
Make a memory mapped file (MMF) using this GUID as its name.
Pass this name as a command line argument to the new process.
Open the MMF from the second process and read your data from the MMF.
|
|
|
|
|
in jscript:
var shell = new ActiveXObject("WScript.Shell");
var fso = new ActiveXObject("Scripting.FileSystemObject");
Is there a way for MFC to do this and how?
Tnx in advance....
quistiun
|
|
|
|
|
Hello my fellow programmers,
I am in the process of writing some front end software that takes to an engine management unit that will program it and perform data acquisition in real time.
I have written software for this before using the MFC Doc View Framework and I have had considerable success with this. However this new project is for a newer unit and will most probably have a life span for the next 5 years. The target operating systems for this will be Win98 SE through to XP.
My question is Should I be writing this in MFC or should I consider using managed C++ and the new .NET Framework. Any inputs/questions would be greatly appreciated.
Best Regards
Danny Nowlan
|
|
|
|
|
MFC. Simply because I don't think the .NET framework in C++ will give you anything that justifies having the ship the framework.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian,
I must admit that is a very valid point. Some of the machines we will ship too are very underspeced Win98 machines and I don't think they would take too kindly to the .NET framework. MFC I know very well and I know it works. Thank you for your consuel.
Danny
|
|
|
|
|
|
LOL - when I last used WTL it was really interesting, due to lack of support and docs. Do Microsoft officially support it now ? Is it being developed still ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
It is open source now[^] and still developed by original Microsoft guys.
I have seen quite a number of job ads mentioning WTL, so I wouldn't count it out.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Given what you've seen of the requirements, why would WTL be a better choice than MFC?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|