Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Multiple Selection in a ListBox Control

Posted on 1997-08-09
4
Medium Priority
?
612 Views
Last Modified: 2013-11-19
I have a list box control in a dialog box, which is associated with  CPropertyPage class.I have selected "Multiple Selection".I have associated a CString variable for the listbox through class wizard.Now the prblem is, when ever I click the tab of the next property page (i.e On killing this property page), I see a crash.When I go through the debugger I come to know that the "LB_GETTEXTLEN" message is sent(in MFC's Source DLGDATA.CPP) an the return value is -1.Can any one help me to resolve the crash?
0
Comment
Question by:Amaresh080997
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Expert Comment

by:mbhakta
ID: 1303455
What version of VC++ are you using ?
0
 

Author Comment

by:Amaresh080997
ID: 1303456
Thanks for replying mbhakta! I am using MFC 4.2.Can u suggest me something?
0
 
LVL 1

Accepted Solution

by:
cnasarre earned 0 total points
ID: 1303457
I'm almost sure that you can't handle a multi-select listbox
with a CString. The data exchange process is not implemented.
You have to do it yourself either in DoDataExchange() or
in OnKillActive()/OnSetActive() of your property page.

You have to use GetSelCount() and GetSelItem() to get each
selected item and store them in a list or whatever you need

0
 

Author Comment

by:Amaresh080997
ID: 1303458
Thanks for the reply cnasarre! Your answer is certainly acceptable.It is the same thing even I thought of.But I was not sure.
By the way, I still leave the question open for answering so that some one who is doubly sure can give it a shot.
Once again thanks a lot for replying cnasarre!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Suggested Courses

618 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