|
Handle WM_SIZE, the handler for WM_SIZE will have three parameters.
Use the first parameter 'nType' and handle accordingly
|
|
|
|
|
Parthi_appu wrote: WM_SIZE will have three parameters
I always overrided the cx value with a constant despite what nType is. It's not working. And WM_SIZE is called when the dialog has been fully maximized.
Maxwell Chen
|
|
|
|
|
See Here[^] maybe it is some helpful to you
whitesky
|
|
|
|
|
Thanks!
BTW, I did not get the email notification ...
Maxwell Chen
|
|
|
|
|
its not problem i have a same problem but now its fix and I can get notification i think that your problem is fix now.(I hope)
whitesky
|
|
|
|
|
WhiteSky wrote: get notification
Yes I got the notification this time.
Maxwell Chen
|
|
|
|
|
Hi,
How to create a new ChildFrame without menu bar ??
In the InitInstance in my App. I add this code for delete menu bar:
pMainFrame->SetMenu(NULL);
::DestroyMenu(pMainFrame->GetMenu()->GetSafeHmenu());
and this work fine.
But I create at runtime new windows attached to mainframe and when i create this windows the menu already appears.
I add the code over in many points of windows creation but the visual effect is not very good !!
Any idea ??
Thanks in advance
Too many plans make the health badly !!
|
|
|
|
|
AkiraOne wrote: But I create at runtime new windows attached to mainframe and when i create this windows the menu already appears.
I add the code over in many points of windows creation but the visual effect is not very good !!
Does WM_MDISETMENU or WM_MDIREFRESHMENU help.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
I have CListCtrl(REPORT) which uses the LVS_EDITLABELS style.
Have can I edit subitem of the list?
|
|
|
|
|
You have tried with:
BOOL SetItemText(
int nItem,
int nSubItem,
LPCTSTR lpszText
);
Too many plans make the health badly!!
|
|
|
|
|
I mean else...
i'd like to edit subitem text in controler
|
|
|
|
|
wrote smth like this.....
void CGraphDataEdtDlg::OnBeginlabeledit(NMHDR *pNMHDR, LRESULT *pResult)
{
NMLVDISPINFO *pDispInfo = reinterpret_cast<nmlvdispinfo*>(pNMHDR);
if (m_subitem)
{
CEdit *edit=m_list.GetEditControl();
if (edit!=NULL)
{
CRect rtSubItem;
m_list.GetSubItemRect(m_item,m_subitem,LVIR_BOUNDS ,rtSubItem);
edit->MoveWindow(rtSubItem);
CString str;
str.Format(_T("left top(%d,%d)\nright bot(%d,%d)"),rtSubItem.left,rtSubItem.top,rtSubItem.right,rtSubItem.bottom);
AfxMessageBox(str);
edit->SetWindowText(m_list.GetItemText(m_item,m_subitem));
}
}
*pResult = 0;
}
call this function with m_list.EditLabel(item);
as result my editcontroler always covers 0-subitem of item-raw....
|
|
|
|
|
Whats problem with LVN_ENDLABELEDIT
whitesky
|
|
|
|
|
Hi,
I've an MFC application uses USB-to-COM port to communicate with my device. It runs well, both in WinXP Professional Edition and Win2K.
But now, I just found out that, it fails to perform read at one point of stage.
I am reading from the port in chunk of 64 bytes. The ReadFile does not return any error. It just couldn't read anything when it tries to read the 2nd or 3rd chunk of 64 bytes.
Anyone know what's the problem? any solution?
Thanks.
|
|
|
|
|
Check GetLastError()
Maybe you have to mark data "as read".
Maybe there isnt anything to read. (Empty)
Greetings from Germany
|
|
|
|
|
Thanks for the reply.
The ReadFile does not return any error, but it read 0 byte. However, I am sure my device is sending something over, because in Win2K or WinXP Pro it works perferctly fine.
Any difference in USB-to-COM interface between WinXP Pro and Home edition?
I am worried that when I call ReadFile, the internal buffer has been erased or overwritten. Is there any way that I can check this internal buffer?
|
|
|
|
|
If u r running in DEBUG mode,Try in RELEASE mode.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
It is in RELEASE mode.
Thanks.
|
|
|
|
|
Hi,
I need create ActiveX control. I know to create ActiveX control from dialog, but
now I have dialog which use other ActiveX and I don't know how do it.
Please help me somebody. Thanks
|
|
|
|
|
majco333 wrote: I have dialog which use other ActiveX and I don't know how do it
First u need to register the OCX.
Follow these steps to register:
1.On the Taskbar, select Start > Run.
2.In the Open field, type regsvr32 "<path>\Strip.OCX", where <path> is the directory where the file is located on your computer and NameOfFile.extension is the name of the file. For example:
regsvr32 "C:\Windows\System32\Strip.OCX"
To insert the registered ActiveX into your current project:
1.Projects->Add to Project->Components and Controls->Registered ActiveX controsl and select that particular ActiveX control.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
I knew this.. By the create Dialog is error:
CDialog->Create(IDD_DIALOG,this);
this dialog own other ActiveX, I think that because is error by the create of dialog..
I don't know to solve this problem..
|
|
|
|
|
majco333 wrote: CDialog->Create(IDD_DIALOG,this);
this dialog own other ActiveX, I think that because is error by the create of dialog..
What does this mean ?? I do not understand.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
I make usage dialog for the ePad, which use ActiveX control for the ePad..
And now I need rebuild this dialog on the ActiveX control because it is necessary for the
adition to main application.. This application will be used this dialog..
|
|
|
|
|
Hi,
I am trying to run an embeded SQL code using C in the VC++ environment.
I wanted to knw how to bind the DSN with the IP addres so that i can get connected to a remote server.Following is the code: What value should i write for the Data Source?
#include<windows.h>
#include<sqlext.h>
#include<stdio.h>
#include<string.h>
int main(void)
{
HENV hEnv = NULL; // Env Handle from SQLAllocEnv()
HDBC hDBC = NULL; // Connection handle
HSTMT hStmt = NULL;// Statement handle
UCHAR szDSN[SQL_MAX_DSN_LENGTH] = "Provider=SQLOLEDB.1;Persist Security Info=False;Initial Catalog=Northwind;Data Source=10.11.50.15 ";// Data Source Name buffer
UCHAR szUID[10] = "sa";// User ID buffer
UCHAR szPasswd[10] = "mis";// Password buffer
UCHAR szModel[128];// Model buffer
SDWORD cbModel;// Model buffer bytes recieved
char buff[9] = "fgddg";
UCHAR szSqlStr[150]= "INSERT into JON(branch_name, balance)Values ('fgddg',3)" ;
RETCODE retcode;
//sprintf((char*)szSqlStr,"INSERT into (Tablename)(Columname) Values ('%s')",buff);
// Allocate memory for ODBC Environment handle
SQLAllocEnv (&hEnv);
// Allocate memory for the connection handle
SQLAllocConnect (hEnv, &hDBC);
// Connect to the data source "test" using userid and password.
retcode = SQLConnect (hDBC, szDSN, SQL_NTS, szUID, SQL_NTS, szPasswd, SQL_NTS);
if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
{
// Allocate memory for the statement handle
retcode = SQLAllocStmt (hDBC, &hStmt);
// Prepare the SQL statement by assigning it to the statement handle
retcode = SQLPrepare (hStmt, szSqlStr, sizeof (szSqlStr));
// Execute the SQL statement handle
retcode = SQLExecute (hStmt);
// Project only column 1 which is the models
SQLBindCol (hStmt, 1, SQL_C_CHAR, szModel, sizeof(szModel), &cbModel);
SQLBindCol (hStmt, 2, SQL_C_FLOAT, szModel, sizeof(szModel), &cbModel);
// Get row of data from the result set defined above in the statement
retcode = SQLFetch (hStmt);
// Free the allocated statement handle
SQLFreeStmt (hStmt, SQL_DROP);
// Disconnect from datasource
SQLDisconnect (hDBC);
}
printf("Done");
// Free the allocated connection handle
SQLFreeConnect (hDBC);
// Free the allocated ODBC environment handle
SQLFreeEnv (hEnv);
return 0;
}
Riz
-- modified at 3:53 Friday 14th July, 2006
|
|
|
|
|
The DSN is what contains the host name or IP address of the machine hosting the database. SQLConnect() should simply be referencing that DSN. It looks as though you might be mixing a DSN and a DSN-less connection.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|