|
Hi All,
I am using MS FlexGrid with VC++ 6.0(MFC).
How to merge 4 adjacent cells( they form a square) to a single one in the flexgrid.
All the 4-cells contain the same text or picture.
TIA,
Regards,
Jahfer V P
|
|
|
|
|
i have some problem in designing the multithreaded tcp server using CAsyncSocket class.the problem is my server can accept only one connection at a time,even though i have used AfxBeginThread logic.so how can i make my server to aceept multiple clients.please help me.i dont want console program.i am using MFC.
|
|
|
|
|
You don't need a multithreaded app to handle multiple connections!
CAsyncSocket has overrideable notification functions, e.g. OnAccept, which informs the app about an incoming connection.
The whole notification works via windows messages (WSAAsyncSelect), so you only need one single thread for the message loop (which is done by MFC) and you will be able to handle many connections.
Using multithreading just makes sense when the CAsyncSocket::OnReceive has to do operations that take much time because it would block the message loop.
Don't try it, just do it!
|
|
|
|
|
I Have been doing things similar to this for ages but all of a sudden it doesn't seem to work.
I am testing the contents of a CEdit control on the EN_CHANGE message and then ebabling/disabling the OK button depending on the result. the only trouble is that the EN_CHANGE message seems to trigger before the InitDialog routine and therefore doesn't recognize and of the controls i have set up in the InitDialog.
What am I doing, or what can i do?
|
|
|
|
|
could you give us a piece of code about what you are doing ?
i.e, how you declare your CEdit, how you initializes it (in the constructor on OnInitDialog() ), how you use it then...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
(aaah.....i didnt quite follow ur question(i am assuming that u need to verfiy the string entered before enabling a button!!!!!).....
the EN_CHANGE message is called whenever there is a change in the Edit control.....but i beleive u want the final data.....but the en_change only tellz u only when there is a change in the data....and gives u no clue if the data entered is over!!!!!(as u dont have a button that updatez the dadta in the edit control).....so herez what u can do(assuming that u press enter key once u have made the changez in the Edit control.....override the function PreTranslateMessage().....
BOOL CXyzDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message==WM_KEYDOWN)
{
if(pMsg->wParam==VK_RETURN)
pMsg->wParam=VK_TAB;
}
return CDialog::PreTranslateMessage(pMsg);
}
so what we have done here is that,we have made the edit control to loose focus when the enter key is pressed(actually the tab key does that,but we have changed it using the above code)(u can give any key u ant to i just stuck with the enter key).....
now add thiz code to the messahe that is passed when the control is lost ( EN_KILLFOCUS).....
void CXyzDlg::OnKillfocusEdit0()
{
UpdateData(TRUE);
}
by doing thiz we get the final output on th edit control .....hope thiz helpz.....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
When you call SetWindowText() from within OnInitDialog() , an EN_CHANGE notification will eventually get generated. What you simply need to do is differentiate between the control's contents changing during initialization vs. the user changing it. The simplest way is to add a m_bInitialized variable to the dialog. Set the variable to false in the dialog's constructor, and then set it to true at the very end of OnInitDialog() . Now in each of the EN_CHANGE handlers, only alter the OK button if m_bInitialized is true. Make sense?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
DavidCrow wrote:
When you call SetWindowText() from within OnInitDialog(), an EN_CHANGE notification will eventually get generated.
I thought EN_CHANGE notifications are only sent in response to a user (vs. programmatic) action that changes the contents of an edit control.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
I thought EN_CHANGE notifications are only sent in response to a user (vs. programmatic) action that changes the contents of an edit control.
But now you know otherwise.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello,
I am working with MS FlexGrid and VC++ 6.0(MFC). I need to load a picture(bmp) to the cell of the flexgrid.
How can I do this?
TIA,
Regards,
Jahfer V P
|
|
|
|
|
|
Dear Suhredayan,
Thank You for your great help.
The sample you pointed out helped me to reach the destination.
Here is the way that I implemented it. It is very simple.
/******************************/
CPictureHolder picHdr;
picHdr.CreateFromBitmap(IDB_BITMAP1);
m_FlexGrid.SetCol(2);
m_FlexGrid.SetRow(1);
m_FlexGrid.SetRefCellPicture(picHdr.GetPictureDispatch());
/******************************/
Thanks & Regards,
Jahfer V P
|
|
|
|
|
|
Thats all, i need to get the line index where the cursor is placed in a CRchEditCtrl.
Thanks
|
|
|
|
|
check for EM_EXLINEFROMCHAR message in msdn.
suhredayan There is no spoon.
|
|
|
|
|
hi all
i used API function hWndApp=FindWindowEx(0,0,"Notepad",0),and then i want to send WM_MBUTTONDBLCLK message to hWndApp but it didn't work as i think...
i send WM_MBUTTONDBLCLK message to hWndApp,and then send WM_COPY message to hWndApp so that i want to copy word what is highlighted (when call WM_MBUTTONDBLCLK message) to Clipboard (so call WM_COPY message)>>>but i didn't know how to code correctly///
please help me...
thanks...
Here we go!!!
|
|
|
|
|
|
i have read your code>>>that's very useful>>>and thank you so much
but 1 more question for you///please
after enumming all childwindows of mainwindows that can get HWND easily>>>but how to get HWND of edit childwindows that always are used in a typing program.Because we really don't know contents of edit childwindows if we use GetWindowText() in EnumChildProc() function to get HWND hic hic///
i really understand all that you code...
thanks...waiting for you hic hic
Here we go!!!
|
|
|
|
|
Hi,
I have an application (in VC++ 6.0) wherein it displays the images in ListView. So the application starts displaying the images from the Top left corner (0,0).
Now I have added the manifest file (to give XP look to application) in applicatoin resource successfully. (as outlined in the below mentioned link http://www.codeguru.com/Cpp/controls/controls/article.php/c5227/[^])
The application is having the XP look but the images are displayed from the Bottom left corner.
Question:How to set the origin of the ListCtrl to top left corner (0,0) so that the images are displayed from the top left corner (0,0) ?
Thanks & Regards,
Neeraj
|
|
|
|
|
Why can't i use Ctrl+C,V like commands with CFormView. When i want to use it doesnt respond.
is there any way to activate them.
I'm using SDI style.
|
|
|
|
|
Implement your own handler for WM_COPY message to CFormView. Because by default CFormView dosen't implement it.
suhredayan There is no spoon.
|
|
|
|
|
this works but i guess i must write some code.
Thanks
|
|
|
|
|
Add accelerators for Ctrl+C, Ctrl+V, and any other keys you want. The AppWizards make Edit menu commands with IDs of (I think) ID_EDIT_COPY , ID_EDIT_PASTE , and so on, so use those same IDs for the accelerators and add command handlers using those IDs as well. Then the menus and accelerators will go through the same handler.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
void CClass::OnEditCopy()
{
// TODO: Add your command handler code here
((CEdit*)GetFocus())->Copy();
}
I write the code above for(copy,paste,cut,undo). these already have acceleretors. They seem to work. When i want to use on a combobox, as guessed it doesn't copy but at least there is no errors.
|
|
|
|
|
Hi
I would like to ask you how to select a line drawn between 2 points
Thanks
Javi
|
|
|
|