Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to get the items in the view before window is created?

Posted on 2008-11-06
7
Medium Priority
?
237 Views
Last Modified: 2013-11-20
Hi,
i have some item in the list before starting the application.where i need to write the code to get the items in the list just after creation.
0
Comment
Question by:srikadi
  • 4
  • 3
7 Comments
 
LVL 31

Expert Comment

by:Zoppo
ID: 22895050
Hi srikadi,

please explain you problem more detailed: What kind of view/items/list? Where/what are they before the application starts?

ZOPPO
0
 

Author Comment

by:srikadi
ID: 22902118
Hi ZOOPO,
i have CListView,CformView.if CListView contain any task  i need to enable one button in CFromView.
first iam disabling the button after that i am checking getItemcount of Clistview.if getItemcount>1 iam enabling..its working fine if the list doesnot contain any tasks in Listview before creation of the application.
but i want to test before creation of the application.if it contains ant task then it should enable ie on creation time..
iam very poor in english..sorry if i did any mistakes.
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 22903037
Hm - I still don't really understand this: '... in Listview before creation of the application' - how can there be items (tasks?) in the listview before the application runs?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:srikadi
ID: 22903357
sometime i directly close the application..so when i open the application the nexttime the listview contains the previous items..so i want to enable button if the list contain items.
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 22903374
I still don't see the problem. When you start the application there can't be items in the list, the list has to be filled by the application. There must be some code in the application which adds and removes items to the list - that's where you can enable/disable the button.
0
 

Author Comment

by:srikadi
ID: 22903433
sorry if i can't expalin properly..
1)my list has some items..
2) i closed the application with out deleting the items in the list.
3)next tiem when i opened the list contain same item which were there before.
so
now initially i disbled the button in OnInitialUpdate() funtion..after that i am rading getcount()..if it contains items then i am enabling the button..
but i want..
to check just after appearing of the window..where i need to write the code..
0
 
LVL 31

Accepted Solution

by:
Zoppo earned 1500 total points
ID: 22903477
Ok, so you don't 'close' and 'start' the application, you 'minimize' it and 'restore' it, right?

Then I still would suggest to enable/disable the button in the code where the list items are added/deleted. Another possibility would be to implement a WM_ACTIVATE message handler. In there you can (in case of activation) count the number of items and enable/disable the button.

ZOPPO
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question