|
Please can you tell me the code. i am doing it but its not working correctly.
|
|
|
|
|
Hi,
I remember I suggested solution for the same problem just before 2 or 3 days. Could you please post what you have done to resize.
Best regards
Raj
|
|
|
|
|
void CYourFormView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
// Size the tree control according to size of bar
if( m_LstCtrl.GetSafeHwnd() != NULL ){
// Get the current control position
CRect rcListSize;
m_LstCtrl.GetWindowRect( rcListSize );
// Change to screen cordinate
ScreenToClient( rcListSize );
// Change the size of the tree control
m_LstCtrl.MoveWindow( rcListSize.left, rcListSize.top, cx - rcListSize.left, cy - rcListSize.top);
}
}
if u r not able to do then as Rajkumar said I also like to know which way u r trying. so post some code too.
Regards
Anil
|
|
|
|
|
Hello every one..
my question is how i can split my dialog window ..
help me..
vikram.
|
|
|
|
|
How do you mean split a dialog window? As in slice a window in half to create two windows with a splitter bar in the middle?
--PerspX
|
|
|
|
|
|
Hi
Can anyone plz tell me how to declare a string array in heap? I also dont want to specify its size at the time of declaration.
Thanks
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
std::vector<std::string> string_array;
At least that is how it is done in C++.
Of course that is not really a heap only version, because for that you would have to know the size of the array and the maximum length of any string placed in the array. But for your question it is close enough to qualify as a resonable answer.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Of course it depends on what you choose as a suitable string. For instance C-like strings are simply (NULL-terminated) character arrays, hence you can do something like:
char ** myStringArray;
myStringArray = new char * [3];
myStringArray[0] = "hello world";
myStringArray[1] = new char[10];
memset(myStringArray[1], '*',9);
myStringArray[1][9]='\0';
myStringArray[2] = strdup("Hi");
delete [] myStringArray[1];
free (myStringArray[2]);
delete [] myStringArray;
On the other hand, MFC CString or std::string are objects controlling themselves the inner character buffer, therefore you can do, for instance:
CString * myStringArray;
myStringArray = new CString[2];
myStringArray[0]="Hello World";
myStringArray[0] += "!";
myStringArray[1]=CString('*',9);
delete [] myStringArray;
Hope that helps
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.
|
|
|
|
|
Working with this for a couple days, I wish I were smarter about this stuff. Please help:
double x;
TCHAR TcharTestString[50];
GetDlgItemText(hDlg,IDC_STATIC_A, &TcharTestString, 8 );
x = wcstod(&TcharTestString, &stopstring);
printf("strtod = %f\n", x ); //everything okay so far
swprintf(&TcharTestString, "%f", x); // just won't work
Thanks
|
|
|
|
|
An array of TCHAR is already a string, don't use & when passing that variable to a function.
|
|
|
|
|
frqftgbdafr wrote: double x;
TCHAR TcharTestString[50];
GetDlgItemText(hDlg,IDC_STATIC_A, &TcharTestString, 8 );
x = wcstod(&TcharTestString, &stopstring);
printf("strtod = %f\n", x ); //everything okay so far
swprintf(&TcharTestString, "%f", x); // just won't work
Just a suggestion.
When using TCHAR always use functions defined for TCHAR's .
For eg: _tcstod for wcstod , _stprintf for swprintf , _tprintf for printf etc.
Or if you are sure that you want a wide char type then instead of TCHAR directly use wchar_t .
Once again, use TCHAR with functions defined for TCHAR's .
|
|
|
|
|
Each list view is associated with a list control which we can access by calling GetListCtrl().
How to set this list control to use LVS_OWNERDATA style ?
I've tried to put these in OnCreate or OnInitialUpdate but it didn't work. The list is still not of OWNERDATA style.
CListCtrl &ctlTmp = this->GetListCtrl();
ctlTmp.ModifyStyle(NULL, LVS_REPORT | LVS_OWNERDATA);
how could I do this ?
|
|
|
|
|
You can't dynamically set this style - it has to be set when the control is created.
You can pass it with the dwStyle parameter to Create()/CreateEx() or set it in the resource editor
properties if it's a control on a dialog resource.
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Mark Salsbery wrote: You can pass it with the dwStyle parameter to Create()/CreateEx() or set it in the resource editor
properties if it's a control on a dialog resource.
yeah, if it was a list control in a normal dialog then it would be easy.
But for a list view and its associated list control, I dont' know where and when the list control is created to set its style.
GP
|
|
|
|
|
In a CListView derived class, override PreCreateWindow()...
BOOL CMyListView::PreCreateWindow(CREATESTRUCT& cs)
{
if (CListView::PreCreateWindow(cs))
{
cs.style |= LVS_OWNERDATA;
return TRUE;
}
return FALSE;
}
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Thanks Mark, it works so charming now
I give u a 5-star vote
|
|
|
|
|
I want to handle the close button click of a Dialog based application.
How to do this and how message map should look like.
Best Regards,
Suman
|
|
|
|
|
You can override CDialog::OnCancel().
or
ON_WM_SYSCOMMAND()
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
void CMyDialog::OnSysCommand(UINT nID, LPARAM lParam)
{
if (nID == SC_CLOSE)
{
}
CDialog::OnSysCommand(nID, lParam);
}
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Hi Mark, It is working. Thank you very much for your fast and great help.
Best Regards,
Suman
|
|
|
|
|
i need to know all the key words when searching for Temporary Internet Files. i know "cookie:" and "visited:" i know i could use *.* but i need to be able to search for each type by its self. i tryed "temporary:" but its the same as "*.*" so if you know any or a link that shows more please post it.
|
|
|
|
|
|
Why is it necessary to have a constructor with no arguements if we have the DECLARE_SERIAL macro defined for serialible classes.
|
|
|
|
|
A default constructor is necessary because when un-serializing (loading a serialized object), MFC
needs to be able to create an object of the type serialized (see CArchive::ReadObject()).
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
How can i access PS/2 ,for ex capturing datas of mouse : will it require upper-level filters to PS/2 mouse device drivers or can i do it via user-mode with IOCTLs or perhaps ReadFile/WriteFile ?
Thank you very much
|
|
|
|