|
Alok,
Ok, either I said it wrong in my OP or I just do not get it.
The doc clearly state the first parameter of Send/Post message is:
hWnd
[in] Handle to the window whose window procedure will receive the message.
You set the first parameter to SENDER_HWND but according to the doc it needs to be the receiver of the message and it works.
As of now I am not using the message WPARAM/LPARAM, just making sure I can get the message to the UI class.
I just need some clarification on this , please.
Thanks for you time.
Vaclav
|
|
|
|
|
I have a ClistView class, I am adding too many columns, 300+. At some point, the last few columns cannot be resized.
Is there a restriction on the number of columns or something to do with pixel sizes allowed?
Any help will be great.
Thanks,
Saleem
|
|
|
|
|
300+ columns? Who is ever going to be able to make head or tail of such a control?
Veni, vidi, abiit domum
|
|
|
|
|
Have you considered to use some grid control instead of list control ?
|
|
|
|
|
Md Saleem Navalur wrote: I have a ClistView class, I am adding too many columns, 300+. Rethink your design.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Try creating a simple CDialog based project with a CListCtrl, and then adding the same number of columns as in your example.
I often find that if I reduce the code to the simplest possible example then I can determine whether I've hit an internal Windows limit or some other part of my code is causing the problem.
|
|
|
|
|
Thanks for the reply.
I did. In the test sample too, same issue.
Created a standard MFC MDI app, with CListView as the view class.
And added this code in the OnInitialUpdate()
#define MAX_COL_COUNT 400
void CTestListViewView::OnInitialUpdate()
{
CListView::OnInitialUpdate();
GetListCtrl().ModifyStyle(0, LVS_REPORT | LVS_SINGLESEL);
GetListCtrl().SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0,
LVS_EX_FULLROWSELECT);
CString data;
for(int i =0; i < MAX_COL_COUNT; i++)
{
data.Format("ColumnText_%d", i);
GetListCtrl().InsertColumn(i, data);
GetListCtrl().SetColumnWidth(i, 100);
}
for(int j =0; j < 5; j++)
{
for(int i =0; i < MAX_COL_COUNT; i++)
{
data.Format("Text_%d", i);
AddData(j, i, data);
}
}
}
void CTestListViewView::AddData(int row, int col, const char *str)
{
LVITEM lv;
lv.iItem = row;
lv.iSubItem = col;
lv.pszText = (LPSTR) str;
lv.mask = LVIF_TEXT;
if(col == 0)
GetListCtrl().InsertItem(&lv);
else
GetListCtrl().SetItem(&lv);
)<pre lang="c++">
|
|
|
|
|
Quote: 1.
Write C Programs to
a) Find the reverse of an integer value recursively.
b) Print all prime numbers less than N, where N is an integer given by the user.
Define and use a function prime(x) that checks if a number is prime or not.
c) Search for a Key in a 2D array. If the key is in the array, return its position also.
d) Read two unsorted list of numbers. Sort the lists individually and finally merge the two lists to form a single sorted list. Define and use function readlist(l) to read list l and sort(l) to sort the list l.
e) To read two square matrices and check whether multiplication of these matrices is commutative or not.
2. Write a menu driven C program to operate on Strings.
Menu:
Key
Action
**************************************************************
1 Print String Length
2 reverse string
3 convert all characters to lowercase
4 convert all characters to uppercase
Implement each action using User defined functions.
|
|
|
|
|
Short answer: No.
Longer answer: These forums are for people who want assistance with the code that they have written. They are not here for someone else to do your work or homework for you.
Veni, vidi, abiit domum
|
|
|
|
|
|
he/she is not alone.
Veni, vidi, abiit domum
|
|
|
|
|
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Pick yourself up and write it! A degree in software engineering without background knowledge is less valuable then a roll of toilet paper. Such a degree helps you to get only positions like "seller in McDonalds"... Think about it and either start learning programming quickly or in case of disinterest towards software engineering find something else and change your profession/course.
|
|
|
|
|
Given a month and year, I want to write C++ code to determine what day of the week the month starts at. For example, for 2/2013, I want the code to return Friday (or an integer representing Friday) because February 1, 2013 was a Friday. The code needs to be portable. What is the best way to do this?
Thanks
Bob
|
|
|
|
|
Something like the following, with maybe a tweak or three:
struct tm time_in = { 0, 0, 0, 1, 7, 2013 - 1900 };
time_t time_out = mktime(&time_in);
struct tm *time_local = localtime(&time_out);
_tprintf(_T("%u\n"), time_local->tm_wday);
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
|
Nice idea, but the OP was looking for something portable.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I would suggest converting the date to a Julian Day Number. Here is a function we use to convert day, month and year to such a number. The input values (D, M, Y) are all unsigned int.
unsigned int yh = Y;
unsigned long c, ya, j;
if (M > 2)
{
M -= 3; }else{
M += 9;
Y--;
}
c = Y / 100;
ya = Y - 100*c;
j = ((146097*c)>>2) + ((1461*ya)>>2) + (153*M + 2)/5 + D;
Using that you just need the Julian Day Number corresponding to a date for which you know the day of week as a reference. You can then subtract the numbers to get the days in between.
Please note that the function is only valid from 14th September 1752 (when the Gregorian calendar started).
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
Question 1. Read two unsorted list of numbers. Sort the lists individually and finally merge the two lists to form a single sorted list. Define and use function readlist(l) to read list l and sort(l) to sort the list l.
Question 2. To read two square matrices and check whether multiplication of these matrices is commutative or not.
|
|
|
|
|
Answer (1,2) : Write some code !
|
|
|
|
|
You are knocking on the wrong door. This is not a site that writes the homework of students. These questions are far from being serious enough to waste the free time of a programmer. You should have enough free time for this as currently your full-time work is learning programming by completing these simple and boring tasks. Also please read my advice: here[^].
|
|
|
|
|
|
|
How can I get address of current page in Firefox?
|
|
|
|
|
Its address in memory? Is this a C/C++/MFC question?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|