|
I have few edit boxes (for double prec. numbers)in a dialog (in a dialog based MFC program).
I want to go to the next edit box when I press ENTER. Normally the control goes to OnOk and the program exits.
Similarly I want to reset (to blank) all the data in the edit boxes when I press ESCAPE. But the program closes when I do so.
Will someone help?
|
|
|
|
|
override OnCancel() and OnOk() functions in your dialog message map
so you can write your own code for these keys
|
|
|
|
|
This question was asked a few days ago... Override PreTranslateMessage() like this:
BOOL CMyDialog::PreTranslateMessage(MSG *pMsg)
{
if((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_RETURN))
pMsg->wParam = VK_TAB;
return CDialog::PreTranslateMessage(pMsg);
} This should work as required.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
as title
|
|
|
|
|
string? -> std::string?
std::string str = "burp";
USES_CONVERSION;
LPCSTR lpcstr = T2A(str.c_str());
|
|
|
|
|
1. To convert a CString to a LPCSTR
#include <atlconv.h>
USES_CONVERSION;
CString str = _T("Whatever");
LPCSTR lpsz = T2CA(str); 2. To convert a std::string to a LPCSTR
std::string str("Whatever");
LPCSTR lpsz = str.c_str(); 3. To convert a std::wstring to a LPCSTR
#include <atlconv.h>
USES_CONVERSION;
std::wstring(L"Whatever");
LPCSTR lpsz = W2CA(str); Hope this helps
Have a look at the tutorial on string handling on CP. That will say more
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hello every one, I was wondering if any body knows a way to trim mpeg 1 file with out corrapting it? or of an API/SDK that i could use to achive this.
Any help would be great !!
|
|
|
|
|
I am Using VS.NET 2003. I tried dragging Activex controls
from toolbar to the form.
It does the following things
1. Creating tlbimp wrapper file and it is sucess.
2. Creating Aximp wrapper file and it does something after
that it poppedup "File or assemblyname Axinterop.ID.dll or one of the depencies was not found". (Note:ID is activex name)
I tried even with command prompt
1. tlbimp abc.ocx /out:interop.abc.dll and it created sucessfully
2. aximp abc.ocx /out:axinterop.abc.dll /rcw:interop.abc.dll /rcw:interop.stdole.dll
AxImp Error: File or assembly name stdole, or one of its dependencies, was not found.
Can any body faced this type of problem?
(Note: Even Microsoft activex control also giving the same problem? )
Please tell me some method to use Activex control in .NET
Thanks,
Uma Mahes
|
|
|
|
|
hey.. really need a solution to my problem
when i set text to an edit box.. using funcion like SetDlgItemText or SetWindowText... is there any way i could know if the edit box is completly filled with the text or not.. edit box is multiline but with no scollbar option...
|
|
|
|
|
You have to do custom drawing, I guess, because you need to have DC.
Look at ::GetTextExtentExPoint or ::GetTextExtentExPoint
|
|
|
|
|
CDC* pDC = GetDC();
char szTmp[256];
edt.GetWindowText(szTmp);
int nSize = pDC->GetTextExtent(szTmp).cx;
//and now simply compare the edt width with nSize;
|
|
|
|
|
I have to develop an application that manages a double network interface.
This means that the target PC is equipped with 2 network cards with different
IP address.
My application must be able to manage both cards, to send data over both
networks and to distinguish data received from one or the other card.
How can I solve this problem ??
Thanks a lot!
|
|
|
|
|
If you're using sockets, you can create one socket for each IP address, and then whatever is received is available through that particular socket.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
can anybody tell me something different between WM_CTLCOLOR and =WM_CTLCOLOR
in mfc?
gucy
|
|
|
|
|
The WM_CTLCOLOR message is used in 16-bit versions of Windows to change the color scheme of list boxes, the list boxes of combo boxes, button controls, edit controls, static controls, message boxes, and dialog boxes.
If an application processes this message, it returns a handle to a brush. The system uses the brush to paint the background of the control
=WM_CTLCOLOR
In classwizard WM_CTLCOLOR will appear as "=WM_CTLCOLOR"
|
|
|
|
|
This has to do with subclassing of controls. I really can't elaborate that much on the topic because I have used it only once and I hardly remember it, but go to MSDN and search for subclassing.
// Afterall, I realized that even my comment lines have bugs
|
|
|
|
|
WM_CTLCOLOR is the Windows message sent to the parent of a control.
MFC allows the control itself to handle some messages that are actually sent to its parent. This is called message reflection, and WM_CTLCOLOR is one of these messages. If you handle WM_CTLCOLOR in a particular window (eg. myWindow ), then you handle a message sent from one of myWindow 's children. If you handle =WM_CTLCOLOR , you handle a message that was sent from myWindow to its parent.
I hope this is clear enough to understand
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
your descprition is clear enough for me to understand.thank you!
gucy
|
|
|
|
|
You're welcome
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
my regular dll is dynamicly linked to my application.the regular dll is built using the dynamic_link library version of mfc while the application is built using the static_link library version of mfc.
when i call AfxGetInstanceHandle() in my regular dll.it caused severe error.
then i rebuild my application using dynamic_link library version of mfc.it is ok.
i wonder if i must use dynamic_link library of mfc in my application when the
application calls a regular dll.
gucy
|
|
|
|
|
not necessarily. It could be std itself. Check /MD, /MT compiler flags.
|
|
|
|
|
hi everybody
i used int system("...") function to execute a command .now i don't know if it is possible to read the result of the command and store it somewhere.
reading the line using cin is impossible before that execution terminated.
if it is possible using ShellExecute please help me.
thank you.
|
|
|
|
|
The output in command prompt can be redirected to a file this way:
app.exe > outfile.txt
Parse the file to get the output. I hope this helps.
// Afterall, I realized that even my comment lines have bugs
|
|
|
|
|
simple and complete !
thank you .
i always said ,you codeproject guys rock!
|
|
|
|
|
Hi folks,
I have a problem with my application.
I'd like to debug a program with an Graphical User Interface with some buttons,Edit bix etc...
This project call a Dll, where inside it there is a COM object with its methods and interface, it's placed in another project.
so,I register this component with Component Service (Control Panel/dministrator tools/Component Service.
When I tried to debug my GUI, happens that the new Visual Studio application is loaded but unfortunatly appear only an assembly windows and in a workspace windows only a DllHost.exe.
After that the VS assembly windows is complete blocked and the complete application crashed.
Someone,do you know how to debug component out of process or can tell me where I make a mistake?
Thanks in advance for your answers..
Andrea
|
|
|
|