|
The question was posted (and encoded) in Traditional Chinese. In English, it can be translated as "How to capture the 'Enter key' hit on an Edit Control"
My suggested solution would be to use PreTransMessage() and do something like the following;
BOOL CMyDlg::PreTranslateMessage(MSG *pMsg)
{
int ctrlID;
if (pMsg->message == WM_KEYDOWN)
if (pMsg->wParam == VK_RETURN)
{
ctrlID = (GetFocus())->GetDlgCtrlID();
if (ctrlID == IDC_MYEDIT)
return true;
}
return CDialog::PreTranslateMessage(pMsg);
}
Hope it helps
|
|
|
|
|
Hi..
i build an FTP application with VC++ 0.6 to upload files to ftp server in my company i test the project from my home computer it works correctly and it lists all directory in the server and perform the upload correctly ..
but in the company it can not list the ftp directory (No error message or warning) ...
i think it's because of the firewalls installed in my company network ..
How can i over come this problem?????
|
|
|
|
|
Talk nicely to your IT guys, and see if it's possible for them to change the settings. Think about it. If you could software bypass a firewall, how much use would the firewall actually be...?
Steve S
|
|
|
|
|
then can u explain to me why regular FTP software wore in the same case that can be helpful for me!!
|
|
|
|
|
Hi, everyone.
Where can I find reference implementation or some sample codes for CPRM(content protection for recordable media) algorithm? Can anyone help?
Information about CPRM can be find here,
----------
http://www.4centity.com/
----------
Thanks in advance,
Geo
|
|
|
|
|
Hi,
What I want to do is to open a pdf-file in my application using the imported AcrobatReader ocx and go to a certain bookmark( or linenumber) defined in the pdf-document. I just can't figured out how to do it.Does anybody have a tip? Can it be done using the setNamedDest procedure? Does anybody know the syntax of possible parameters of
setNamedDest?
Thanks
Mahesh
Gerald
|
|
|
|
|
When i click on the menu item,dialog should appear and the menu item need to be checked.Similarly when i again click on the menu item when the dialog is open,the dialog should be closed and the check mark must be removed at the menu item.How can i do this.
|
|
|
|
|
a terminal program,using "PostMessage" function to send message to cedit.
My question is why the cursor alway be reset in top of edit control although using follow code:
int i = m_liststr.GetLength(); //m_liststr is cstring variable for cedit
m_list_control.SetFocus(); //m_list_control is cedit variable
m_list_control.SetSel(i,i,false);
|
|
|
|
|
Hi,
Is there anyway to recompile MFC7.1 for AMD64?
I want to port my 32bit program into 64bit with AMD64 compiler included with the newest Driver Development Kit. I tried to recompile MFC7.1 libraries with AMD64 compiler however, I get errors causesd by some preprocessor direcetives where it defines different platforms.
My questions are: Is there any port of MFC available for AMD64? Is there any Platfrom SDK available that supports AMD 64?
Any help appreciated!
Robert Buldoc
|
|
|
|
|
|
Thanks!
I am off to download it! will post the results here.
[editted]
It says Intel 64-bit, so I really doubt it to be AMD64 compatible but I might find something interesting inside.
[/editted]
[editted2]
As I thought it is IA64. In its Lib directory it has an AMD64 directory but there is only one 4KB file named authz.lib
[/editted2]
|
|
|
|
|
I have an SDI program, and I need to access the variables in CFormView from CMainFrame. I cant figure out how to do that.
I'm catching WM_CLOSE in CMainFrame, and whether or not the program will be
allowed to close will depend on a variable thats in CFormView. So, I need to
access this variable from CMainFrame. Any help?
Thanks,
Daniel
|
|
|
|
|
Actually, you can expose a get accessor to your property.
BOOL GetAllowClosing()
{
}
You can get at in CMainFrame by:
CFormView pForm = (CFormView)GetActiveView();
Then you just use the return the value of pForm->GetAllowClosing()
|
|
|
|
|
|
You may be reinventing the wheel.
CDocument has CanCloseFrame(), which currently checks the dirty bit of the document and then prompts if you want to save.
You can override this, and have the document ask the form if it's OK to close, and return false if not.
You then don't need to handle WM_CLOSE in CMainFrame, unless you need to for other reasons.
Steve S
|
|
|
|
|
Steve S is right, Daniel. It actually makes things easier than handling WM_CLOSE in the Main Frame, although that's perfectly OK as well...
Just inject the check on your CFormView derived View's CanCloseView() (or whatever you call it) into your override of CanCloseFrame() :
BOOL CMyDocument::CanCloseFrame(CFrameWnd* pFrame)
{
CMyFormView pView = (CMyFormView)pFrame->GetActiveView();
if (FALSE == pView->CanCloseView()) return FALSE;
return CDocument::CanCloseFrame(pFrame);
}
|
|
|
|
|
Don't know if this is right plac to post, but i have a question. I'm making a program that reads files with have hundreds of lines that begin with the same thing like ObjectTemplate.whatever (variable i need). My quesion is i've read these in as a CString line by line. How to i get rid of the ObjectTemplate part so it leaves the .whatever and i want to get rid of the part after the space which is the variable. So what i want to do is use the .whatever to tell the program what variable it is supposed to change. This is a noob question, and i've looked thorugh the strings section and could not find what i need.
|
|
|
|
|
Look up CString::Right(), CString::Left(), CString::Mid() in MSDN.
|
|
|
|
|
Along with the Right() Left() and Mid() functions, look at the Find() function. Find the . and take everything from the right of the .
Artificial intelligence is no match for natural
stupidity.
|
|
|
|
|
I have a weird one, here. I have a class that uses a linked list of pointers to another class (ie. a mbr var that has a pointer to the next object). In my processing, I loop to create the necessary instances of the "outside" class. As part of the constructor of that object, the linked list is built by calling new inside of a loop. The first "outside" object is created flawlessly. When the second "outside" object is created, while the first mbr of the linked list is being created, HeapAlloc bombs out. Does anyone have any clues on what this could be? I tried wrapping the "obj = new objclass" in a try/catch(...), but nothing is caught.
I'm at my wit's end on this one.
|
|
|
|
|
Recursive memory alloc, perhaps? A TRACE() statement in a constructor or two might identify this if it's the problem.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
It took me going home last night and clearing my head. When I came in today, I started walking through all the memory allocation in that process. I found a copy/paste error that was corrupting the heap.
|
|
|
|
|
I have defined a managed C++ project to call into an unmanaged MFC project. The MFC project builds successfully. However, the build of the managed project fails because the linker cannot resolve the external symbols for the methods defined in the unmanaged class. Attached is the class definition for the managed class:
public __gc class MTracker
{
public:
MTracker(Control* pControl,Control* cControl)
{
m_CTracker = new CComTrackerApp();
IntPtr pPtr = pControl->Handle;
IntPtr cPtr = cControl->Handle;
HWND pHwnd = (HWND)pPtr.ToPointer();
HWND cHwnd = (HWND)cPtr.ToPointer();
m_CTracker->Create(pHwnd,cHwnd);
}
protected:
void Dispose(bool b)
{
MTracker::Dispose(b);
if (m_CTracker != NULL)
{
delete m_CTracker;
m_CTracker = NULL;
}
}
private:
CComTrackerApp* m_CTracker;
};
The CCOMTrackerAPP class is defined in the MFC project. The linker cannot resolve the addresses for CComTracker::CComTracker() or CComTracker::Create(HWND pHwnd,HWND cHwnd). Any suggestions would be appreciated.
|
|
|
|
|
Hello
I need integrate me own topics into MSDN (Document Explorer). Does anybody have any ideas about how this could be done&
|
|
|
|
|