|
Hi
in vc++, In my application i am showing my data in list control box from data bases , now my requirment is that when i double click on an individual
data in list box an specific event is fired.
i am using LBN_DBLCLK but its not work properly. can any one told me
how we can do this
Regard's
Kaushik
|
|
|
|
|
Y_Kaushik wrote: i am using LBN_DBLCLK but its not work
Why it didnt work can you explain more?
|
|
|
|
|
Guruji
In this case suppose 10 item come from database suppose its iD
10
11
12
13
20
Now my requirment is that when i bouble click 10 a specific action perform and when double click 11 action perform for id 11 but
in my case its fail
so can u told me in detail
Regard's
Kaushik
|
|
|
|
|
Do you need to this code?
void CDialogDlg::OnLbnDblclkList1()
{
switch(m_List.GetCurSel())
{
case 0:
MessageBox("A");
break;
case 1:
MessageBox("B");
break;
case 2:
MessageBox("C");
break;
}
}
if its not your answer can your more explain,please
|
|
|
|
|
Hi
MSDN says
This message is sent only by a list box that has the LBS_NOTIFY style.
|
|
|
|
|
Y_Kaushik wrote: i am using LBN_DBLCLK but its not work properly.
Why not? Remember, the quality of answer you receive is directly proportional to the amount of relevant information that you provide.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have a populated multiline edit control. I wish to read one line at a time from it and do some manipulation on it. According to CEdit documentation on MSDN i have implemented the logic as below:-
LRESULT l_numEvents = ::SendMessage(hwnd, (UINT)EM_GETLINECOUNT, 0, 0);
LRESULT llinelength = ::SendMessage(hwnd, (UINT)EM_LINELENGTH, index, 0);
//Set the first word of this buffer to the llinelength, in TCHARs, of the buffer
<br />
<br />
llinelength = ::SendMessage(hwnd, (UINT)EM_GETLINE, index, (LPARAM)(LPCTSTR)tbuffer);<br />
<br />
I wish to know how do i set the first word of this buffer to llinelength of the buffer.
|
|
|
|
|
Like this...
WORD llinelength = ::SendMessage(hwnd, (UINT)EM_LINELENGTH, index, 0);
*((WORD*)tbuffer) = llinelength;
|
|
|
|
|
tom groezer wrote: I wish to know how do i set the first word of this buffer to llinelength of the buffer.
*(LPINT)tbuffer = llinelength;
SendMessage(hwnd, EM_GETLINE, index, (LPARAM)tbuffer);
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi, everyone!
I want to realize an application which can get file's content through dragging mouse. Now I had get the list of files in a list-control. How to realize this function? Plz give me some idea. Thx!
|
|
|
|
|
Do you want to see content of files when they are dragging on your program?
|
|
|
|
|
No. I need to develop an application which can take a file from PDA to PC. The file saved in PDA had been listed in a list-box of my program. When the user drag an icon of a file from the list-box to desktop, my program get the file's name and then get it from PDA. That's all I must develop.
|
|
|
|
|
I had known I must use the API:DoDragDrop(). But I don't know how to implement the interface of IDataObject and IDropSource. Would u be kind to give me some advice? The context of this calling of DoDragDrop is in a Dialog. So whether I must add declerations of IDataObject and IDropSource in the header file as I do in C#? I need some help. Thx!
|
|
|
|
|
|
Thx for you introduce me this article. But I want to know more knowledge about this. Because my goal is to drag file into desktop, I wonder this method can't work.
|
|
|
|
|
Well I saw your answer previous drag with explorer or destop of a program on the codeproject you need to search.;)
|
|
|
|
|
i have a CDialog ,1 button for print i have a print but i need a button for print preview !How i have read all codeproject stuf but nothing ...
this is my code for print :
CPrintDialog dlgPrint(FALSE,PD_ALLPAGES,this);
if (dlgPrint.DoModal()==IDOK)
{
// ** Attach the printer DC from the dialog
// ** to a CDC object
CDC dcPrint;
dcPrint.Attach(dlgPrint.GetPrinterDC());
// ** Create and fill a DOCINFO structure
DOCINFO myPrintJob;
myPrintJob.cbSize = sizeof(myPrintJob);
myPrintJob.lpszDocName = "MyPrintJob";
myPrintJob.lpszOutput = NULL;
myPrintJob.lpszDatatype = NULL;
myPrintJob.fwType = NULL;
// ** Start the printing document
if (dcPrint.StartDoc(&myPrintJob)>=0)
{
// ** Start a page
dcPrint.StartPage();
CString sQuestion;
m_question.GetWindowText(sQuestion);
CString sText;
sText = "Command";
CString sText1;
sText1 = "Display :";
////////////////////////////////////////////////////////////////////////////////////////
dcPrint.TextOut(2000,350,sText);
dcPrint.TextOut(300,500,sText1);
// ** Throw the page
dcPrint.EndPage();
// ** Close the document
dcPrint.EndDoc();
}
// ** Delete the printer device context
dcPrint.DeleteDC();
}
Bravoone
|
|
|
|
|
|
No i need something more easy...is to hard for me !you see my code for print ?! i need something like that ...easy not so complicate !can you help me ?!
Bravoone
|
|
|
|
|
some times ago (I think two years ago) I had this problem I wanted to have a preview before print so I explain for you but before it(you can also use of printer driver if you dont have a real printer or dont access to it see this thread[^] ) I calculate dimension for pages like A4,A3,... and convert to screen and then use of a handle to display device context (hdc) sent my datas with BitBlt to screen and it worked and finaly sent my datas to printer like this
PRINTDLG pd;
...
m_Image.BitBlt(pd.hDC,100,134,640,480,0,0,SRCCOPY);
|
|
|
|
|
what is m_image ?! what control ?!
Bravoone
|
|
|
|
|
It was an example and m_image was CImage for print images.
|
|
|
|
|
you see my code?
i need print preview for this HOW?help me!
Bravoone
|
|
|
|
|
I dont have any solution for my problem please help me !if you can !
Bravoone
|
|
|
|
|
I searched my CDs for send my program for you but I didnt find it instead I found this article that I think it will be helpful for you. see Introduction to MFC Printing[^]
|
|
|
|