home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!cs.utexas.edu!ut-emx!ccwf.cc.utexas.edu!fly
- From: fly@ccwf.cc.utexas.edu (Neil)
- Newsgroups: comp.os.os2.programmer
- Subject: listbox problem.
- Message-ID: <76293@ut-emx.uucp>
- Date: 21 Jul 92 13:02:35 GMT
- Sender: root@ut-emx.uucp
- Reply-To: fly@ccwf.cc.utexas.edu (Neil)
- Organization: The University of Texas at Austin, Austin TX
- I am having trouble pulling all of the selected items from a multiple selection listbox.
- Lines: 50
- Originator: fly@thumper.cc.utexas.edu
-
- the following code for some reason only pulls the first selected item from the listbox,and
- I cannot figure out why it does not do all of them...
-
- Any suggestions are appreciated.
- Thank you.
-
- Here is the code:
-
- void Move()
- { int selNum;
- int index;
- char text[256];
- PSZ selection,
- newp,
- oldp;
- char newst[256];
- char oldst[256];
-
- text[0]=NULL;
- newst[0]=NULL;
- oldst[0]=NULL;
- selection = (PSZ) text;
-
- selNum = SHORT1FROMMR( WinSendMsg(hwndList,
- LM_QUERYSELECTION,
- MPFROMSHORT( LIT_FIRST ),
- NULL ));
-
- while ( selNum != LIT_NONE)
- { WinSendMsg(hwndList,
- LM_QUERYITEMTEXT,
- MPFROM2SHORT( selNum,sizeof(text)),
- MPFROMP( selection ));
- strcat( newst, p2);
- if (newst[strlen(newst) -1] != '\\' )
- strcat( newst, "\\" );
- strcat( newst, selection);
- strcpy( oldst, p1);
- if (oldst[strlen(oldst) -1] != '\\' )
- strcat( oldst, "\\" );
- strcat( oldst, selection);
- newp = (PSZ) newst;
- oldp = (PSZ) oldst;
- DosMove(oldp, newp, 0L);
- selNum=SHORT1FROMMR(WinSendMsg(hwndList,
- LM_QUERYSELECTION,
- MPFROMSHORT(selNum),
- 0L));
- };
- };
-