|
|
Handle WM_KILLFOCUS.
Another way would be to create your window with WS_POPUPWINDOW style.
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I have created my window with WS_POPUP.
How can I handle WM_KILLFOCUS. Please elaborate it if possible.
Thanks
|
|
|
|
|
If it is a modal dialog box then you have no chance. On the other hand, if it is a modeless dialog, then send it the WM_CLOSE message.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes it is a modal dialog box. I am doing DoModal.
|
|
|
|
|
SendMessage(hwnd,WM_CLOSE,0,0);.
|
|
|
|
|
Dhiraj kumar Saini wrote: Now i want to close the dialog...
If it's a modal dialog, call EndDialog() .
Dhiraj kumar Saini wrote: ...when mouse is clicked outside it.
See here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hello All
I am working in VS 6 (VC++) using win32...
My task is to display an avi file in Animate control.....
I use Animate_Open And Animate_Play...Both Works fine.....
But The problem is it displays the avi file with Player also .....it looks as .avi is playing in the media player....
Can anybody suggest me how to display the picture only without any player in the animation control
|
|
|
|
|
If you want to play avi file or even your pictures you can use of MCI functions however you dont need to use of MCI functions for pictures.
|
|
|
|
|
hi i m usng the below code for writing data to excel from vc++
but the saved file is not in good format.
can anyone suggest a gud one?
UpdateData(TRUE);
ofstream o;
char ch[101];
o.open("D:\\tdy1",ios::app);
int s, s1;
s = m_edit1.GetLength();
strcpy(ch,"\n");
o.write(ch,2);
strcpy(ch,m_edit1);
o.write(ch,s);
strcpy(ch,"\t");
o.write(ch,2);
s1 = m_edit2.GetLength();
strcpy(ch,m_edit2);
o.write(ch,s1);
o.close();
|
|
|
|
|
hellogany wrote: hi i m usng the below code for writing data to excel from vc++
1) no, you're not - you're writing to a file you hope excel can read - since D:\tdy1 has no extension and you're likely not doing a file import, excel wont have a clue how to read the data.
2) your use of ostream is an abomination !!!
how about :-
ofstream o;
o.open("D:\\tdy1.csv", ios::app);
if (!o.is_open())
{
cout << "Cant Open D:\\tdy1.csv For Output" << endl;
return -1;
}
o << m_edit1.GetLength() << "," << m_edit1 << endl;
o << m_edit2.GetLength() << "," << m_edit2 << endl;
o.close();
Because Excel knows how to read a file with a .csv extension, you should see 2 x 2 rows/columns with your data
'g'
|
|
|
|
|
i tried savin in xls format
but whil openin the excel file, it is showing " the file format is not recognisable"
|
|
|
|
|
so what makes you think those values you are saving constitute the Excel .xls format ? - they dont
if you dont like the help Ive offered, learn to use a textbook or google for instance
modified on Monday, November 17, 2008 6:42 AM
|
|
|
|
|
Garth J Lancaster wrote: if you dont like the help Ive offered, learn to use a textbook, google for instance
Hey Garth, is Google a textbook now?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
you cheeky so and so corrected, replaced ',' with 'or'
sorry, I was a bit exasperated
reminder to self, must not post on CP when work hours > 14
'g'
|
|
|
|
|
Garth J Lancaster wrote: reminder to self, must not post on CP when work hours > 14
Wow, I usually work no more than 6 hours per day
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
HI all,
i m using the below code , but the result saves in another excel file.
can anyone suggest y it happens?
_Application app;
Workbooks books;
_Workbook book;
Worksheets sheets;
_Worksheet s;
Range range;
Font font;
Range cols;
LPDISPATCH lpDisp; // Often reused variable.
// Commonly used OLE variants.
COleVariant
covTrue((short)TRUE),
covFalse((short)FALSE),
covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
// Start Excel and get Application object.
if(!app.CreateDispatch("Excel.Application"))
{
AfxMessageBox("Couldn't start Excel and get Application object.");
return;
}
lpDisp = app.GetWorkbooks(); // Get an IDispatch pointer.
ASSERT(lpDisp);
books.AttachDispatch(lpDisp); // Attach the IDispatch pointer
// to the books object.
// Open a new workbook and attach that IDispatch pointer to the
// Workbook object
lpDisp = books.Add( covOptional );
ASSERT(lpDisp);
book.AttachDispatch( lpDisp );
lpDisp = books.Open("D:\\test.xls",
covOptional, covFalse, covTrue, covOptional,
covOptional, covTrue, covOptional, covOptional,
covTrue, covOptional, covOptional, covOptional,
covOptional, covOptional);
// Get the Sheets collection and attach the IDispatch pointer to your
// sheets object.
*/
/* lpDisp = book.GetSheets();
ASSERT(lpDisp);
sheets.AttachDispatch(lpDisp);
// Get *** #1 and attach the IDispatch pointer to your ***
// object.
lpDisp = sheets.GetItem( COleVariant((short)(1)) );
//GetItem(const VARIANT &index)
ASSERT(lpDisp);
s.AttachDispatch(lpDisp);
// Fill range A1 with "1/25/98", the settlement date.
lpDisp =s.GetRange(COleVariant("A1"), COleVariant("A1"));
ASSERT(lpDisp);
range.AttachDispatch(lpDisp);
range.SetValue2(COleVariant("change")); // Excel 2002 and Excel 2003
// checking for the particular cell if it's empty
VARIANT value1;
char str[]="A";
char strf[]="";
int i = 1;
char str1[10];
_itoa(i,str1,10);
strcpy(strf,str);
strcat(strf,str1);
range = s.GetRange(COleVariant(strf),COleVariant(strf));
value1 = range.GetValue2();
while(!value1.vt == VT_EMPTY)
{
i++;
_itoa(i,str1,10);
strcpy(strf,str);
strcat(strf,str1);
range = s.GetRange(COleVariant(strf),COleVariant(strf));
value1 = range.GetValue2();
}
range.SetValue2(COleVariant("Country"));
book.Save();
{
COleSafeArray saRet;
saRet.Detach();
}
app.SetVisible(TRUE);
app.SetUserControl(TRUE);
|
|
|
|
|
I can access all data from a single table.But If I want to access selected data from multiple tables then I get an error after executing.
ERROR: ORA-00903: invalid table name
DSN Name: om_ebridge.
Oracle User Name: SCOTT
Table Names: Transaction_Master,Transporter_Master,Supplier_Master,Product_Master.
CString CMyebridgeSet::GetDefaultConnect()
{
return _T("ODBC;DSN=om_ebridge");
}
CString CMyebridgeSet::GetDefaultSQL()
{
//return _T("[SCOTT].[TRANSACTION_MASTER]");(works to access data from single table.)
-------------------------
(But ERROR occurs if the below mentioned INNER JOIN is used to access selected data from multiple tables .Can you please help me access data).
return _T("SELECT TRANSACTION_MASTER.TRANSACTION_CODE,TRANSACTION_MASTER.VEHICLE_NO,TRANSACTION_MASTER.OPERATING_MODE,")
_T("TRANSPORTER_MASTER.transporter_name,SUPPLIER_MASTER.SUPPLIER_NAME,")
_T("PRODUCT_MASTER.PRODUCT_NAME,TRANSACTION_MASTER.unit,TRANSACTION_MASTER.Gross_Wt,TRANSACTION_MASTER.Gross_WtTime,")
_T("TRANSACTION_MASTER.Tare_Wt,TRANSACTION_MASTER.Tare_WtTime,TRANSACTION_MASTER.CONTAINER1_TAREWT,")
_T("TRANSACTION_MASTER.CONTAINER2_TAREWT ,TRANSACTION_MASTER.net_Wt,TRANSACTION_MASTER.Challan_no,TRANSACTION_MASTER.Challan_Wt,")
_T("TRANSACTION_MASTER.No_Of_Units,TRANSACTION_MASTER.Calculated_Wt,TRANSACTION_MASTER.Formula1,")
_T("TRANSACTION_MASTER.Formula2,TRANSACTION_MASTER.Formula3,TRANSACTION_MASTER.Formula4,")
_T(" TRANSACTION_MASTER.location_code,TRANSACTION_MASTER.field1,TRANSACTION_MASTER.field2,TRANSACTION_MASTER.field3 ")
_T("from PRODUCT_MASTER INNER JOIN SUPPLIER_MASTER INNER JOIN TRANSACTION_MASTER")
_T("ON SUPPLIER_MASTER.SUPPLIER_CODE =TRANSACTION_MASTER.SUPPLIER_CODE")
_T("ON PRODUCT_MASTER.PRODUCT_CODE=TRANSACTION_MASTER.PRODUCT_CODE")
_T("INNER JOIN TRANSPORTER_MASTER ON TRANSPORTER_MASTER.TRANSPORTER_CODE=TRANSACTION_MASTER.TRANSPORTER_CODE ");
}
|
|
|
|
|
Divya Lalwani wrote: ERROR: ORA-00903: invalid table name
So what do you not understand about this? Look at each table you are referencing. At least one of them is invalid.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
|
hi,
maybe you can override "preTh...." function of dialog's parent windows, and send message to this dialog!
|
|
|
|
|
your means is this:
BOOL CDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_MOUSEMOVE)
{
SendMessage(WM_USERMOVE,0,0);
}
return CDialog::PreTranslateMessage(pMsg);
}
-------------
LRESULT CMap::OnUserMove(WPARAM wp, LPARAM lp)
{
m_tooltip.RelayEvent(pMsg);
return TRUE;
}
|
|
|
|
|
You can use the GetCurrentMessage function.
If you vote me down, my score will only get lower
|
|
|
|
|
hi,
thanku for your reply,can i do like this?
LRESULT CMap::OnUserMove(WPARAM wp, LPARAM lp)
{
MSG* pMsg = GetCur...; // is this your meanings?
m_tooltip.RelayEvent(pMsg);
return TRUE;
}
thanku again!
|
|
|
|
|
hi,
is your question how to get the information of "pMsg"?
there are two method, maybe answer your request.
1. refer to 'sendmessage' function, it can take information of msg to receiptor like that:
" sendmessage(WM_xxx, wp,lp);"
then , in function "OnusrMove(wp,lp)", you use the parameter of 'wp/lp' to do something.
2. in ' pretranslatemessage' function, call the process 'mousemove' straight.
|
|
|
|
|