|
Good to know. I guess I am off to look into & now.
Appreciate your help,
ns
|
|
|
|
|
void GetWindowText( CString& rString ) const; implies that the function it self will not change any data that belongs to the CWindow class. Your code will work fine.
|
|
|
|
|
I would like to catch user changes on a combo, but only once he is finished typing. How could I do that?
NOTE: CBN_EDITCHANGE don't work. In fact, it is called every time the user types something in the edit, and CBN_SELCHANGED is only called when the user selects an item in the list.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Try catching the killfocus event of the combobox -- when the cursor leaves the control, you can assume they're done with it.
"If at any time I announce that a nation or kingdom is to be uprooted, torn down and destroyed, and if that nation I warned repents of its evil, then I will relent and not inflict on it the disaster I had planned. And if at another time I announce that a nation or kingdom is to be built up and planted, and if it does evil in my sight and does not obey me, then I will reconsider the good I had intended to do for it." -- Jeremiah 18:7-10 (God, commenting on the value of the United Nations)
|
|
|
|
|
Consider CBN_DROPDOWN event handler.
Kuphryn
|
|
|
|
|
My CDialog has two editboxes. I want the Enter key to tab from one box to the other. How would I do this?
Appreciate your help,
ns
|
|
|
|
|
Override the BOOL CMyXxx::PreTranslateMessage(MSG* pMsg) handler and then try something like:
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN)
{
if(pMsg->hWnd == m_edit1.GetSafeHwnd())
m_edit2.SetFocus();
else if(pMsg->hWnd == m_edit2.GetSafeHwnd())
m_edit1.SetFocus();
return CXxxx::PreTranslateMessage(pMsg);
}
"If at any time I announce that a nation or kingdom is to be uprooted, torn down and destroyed, and if that nation I warned repents of its evil, then I will relent and not inflict on it the disaster I had planned. And if at another time I announce that a nation or kingdom is to be built up and planted, and if it does evil in my sight and does not obey me, then I will reconsider the good I had intended to do for it." -- Jeremiah 18:7-10 (God, commenting on the value of the United Nations)
|
|
|
|
|
So thats how its done! MAny thanks.
Appreciate your help,
ns
|
|
|
|
|
I get this warning:
C:\DbInput.cpp(72) : warning C4715: 'CDbInput::PreTranslateMessage' : not all control paths return a value for the code you gave me above> how can I fix this warning?
Appreciate your help,
ns
|
|
|
|
|
This is even easier:
BOOL CYourClass::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN)
{
CWnd *pWnd = GetFocus() ;
CButton *pButton = static_cast<CButton*>(pWnd) ;
if (pButton == NULL)
pMsg->wParam = VK_TAB ;
}
return CDialog::PreTranslateMessage(pMsg);
}
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Hi !
I am using MSFlexGrid on one of my dialogs. When I run the program on my PC it runs OK, but when I run it on a PC that does not have the developer studio on it it will crash with :
Debug assertion fail on "winocc.cpp line 301"
When I went to this file, this is the function it runs
BOOL CWnd::ShowWindow(int nCmdShow)<br />
{<br />
ASSERT(::IsWindow(m_hWnd));<----This is line 301<br />
<br />
if (m_pCtrlSite == NULL)<br />
return ::ShowWindow(m_hWnd, nCmdShow);<br />
else<br />
return m_pCtrlSite->ShowWindow(nCmdShow);<br />
}
I tried to copy the msflxgrd.ocx file to this PC and still no help.
To active the window with the flex grid, I use from the main dialog this sequance:
ctst *y=new ctst;<br />
y->Create(IDD_DIALOG1,this);<br />
y->ShowWindow(SW_SHOWNORMAL);
So aperantly it fails on the ShowWindow,
But why ???????????????????//
|
|
|
|
|
Did you register the ocx ?
Signature space for rent. Apply by email to....
|
|
|
|
|
Some controls bundled with Visual Studio, though redistributable, still require a runtime license (and MSFlexGrid.ocx is one of them). I encountered a similar problem before I used the IClassFactory2 interface to request a runtime license for the FlexGrid. Look into this. If you need some help with the coding of this let me know.
The following link might help you get started:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q151771
Adam
Adam Gardner
|
|
|
|
|
Thank you for the answer.
I decided not to take the risk, since my code is going to be distributed over few different Windows platforms. I will try to use the ListCtrl as much as I can.
Shay
|
|
|
|
|
I'm having the same problem as I'm using the flexgrid control. I've looked up your link and requested the license but now I'm not sure how to implment it. I've read something about having to embed it into the executable but how/where? Do, I have to override GetLicenseKey() or some other function in the flex grid control?
If you have some code on how to do this, I would really appreciate it. Thanks.
|
|
|
|
|
I'm trying to clean up some C code and eventually transform, port and adapt it to be more and more C++ and more importantly object oriented.
Is there some documentation that talks about this kind of thing?
The biggest problem is the use of global variables, defines, enums,typedefs and structs. Is using namespace to contain those globals a good idea ? at least before objectifying the code ?
Thanks
Max.
|
|
|
|
|
If I were you, I'd recommend looking at "The Big Picture". In other words, do a design - see what classes your code should have, and how they should interface to each other. Global variables may end up member variables of a class... or perhaps static member variables. Global functions may turn into member functions.
Namespaces can help control name conflicts.. but chances are you are better off figuring out what classes each of these things should go to. Generally, static member functions and variables can achieve the same things as global variables, but in a much nicer way.
"Time spent with cats is never wasted." - Colette
|
|
|
|
|
I concur.
I've often simply compiled 'C' code using the C++ compiler, but if I want to change it significantly, I find its usually better to back off and look at, as Navin suggested, "The Big Picture."
When I've rewritten old 'C' code, the improvement is almost always more dramatic than even I expected at first.
|
|
|
|
|
1) I want to programatically download a file from http server. Is there any API available or any other method/article you know ????
2) I want to resume the download if not completed successfully in previous attempt! Any idea about this ???
|
|
|
|
|
|
I have a CFormView. The border for the entire program is ugly. How can I get rid of the thick, default border for a CFormView and just make it a thin
border? I can make the individual items of the CFormView thin border, but that doesn't effect the overall border of the program. Please any response any one can give me will be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
In the dialog resources for the "Border" box, select None (WS_BORDER off). You can also add/remove other window styles by calling CWnd::ModifyStyle() in the overridden CMyFormView::InitialUpdate(). Also, CWnd::ModifyStyleEx() can give you access to extra styles not found in the other one...
"If at any time I announce that a nation or kingdom is to be uprooted, torn down and destroyed, and if that nation I warned repents of its evil, then I will relent and not inflict on it the disaster I had planned. And if at another time I announce that a nation or kingdom is to be built up and planted, and if it does evil in my sight and does not obey me, then I will reconsider the good I had intended to do for it." -- Jeremiah 18:7-10 (God, commenting on the value of the United Nations)
|
|
|
|
|
I will usually put this function call in the CFormView derived class's OnInitialUpdate:
ModifyStyleEx( WS_EX_CLIENTEDGE, 0, SWP_DRAWFRAME );
This removes the border. You also may want to override the WM_SIZE (OnSize) handler, and comment out the call to the CFormView::OnSize because otherwise, if you size it too small, you will get scrollbars.
Chris Richardson
|
|
|
|
|
Hello world...
I can't executed 2 identicals applications (construct with VC++ 6.0) using a sharable MFC DLL (construct with VC++ 6.0 too)...
Only the file's name of those applications is different.
What I've missed???
The second executable simply couldn't opened. But the first well and works...
Thanks in advance
Hello World!!!
from Raphaël
|
|
|
|
|
I can think of a few possibilities (none of which will be right of course!)
Maybe one of the executables was debug compiled, and is looking for MFC42D.dll which may not exist on the system you are running on.
You may have MFC42.dll in the directory of one exe rather than in the path, so only one can find it.
You may have other dependencies than mfc42.dll and this is where the difference lies. You can use
the DEPENDS tool on yout executable to find all the files they are looking for and find and differences.
I hope these help.
Iain.
|
|
|
|