Click here to Skip to main content
15,895,084 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to generate random number? Pin
Chunhua Liu6-Aug-03 11:31
Chunhua Liu6-Aug-03 11:31 
GeneralRe: How to generate random number? Pin
David Crow7-Aug-03 2:44
David Crow7-Aug-03 2:44 
Generalpassword Pin
rapace6-Aug-03 8:28
rapace6-Aug-03 8:28 
GeneralRe: password Pin
rapace6-Aug-03 8:30
rapace6-Aug-03 8:30 
GeneralRe: password Pin
Maximilien6-Aug-03 8:31
Maximilien6-Aug-03 8:31 
GeneralRe: password Pin
rapace6-Aug-03 9:22
rapace6-Aug-03 9:22 
GeneralRe: password Pin
Maximilien6-Aug-03 10:16
Maximilien6-Aug-03 10:16 
GeneralString Arrays Pin
Kayembi6-Aug-03 8:28
Kayembi6-Aug-03 8:28 
Hi,

Another very basic question... I am trying to save the contents of a listbox. I assume that the best way of doing this would be to add the contents list to a string array, something like the following:

void AddListBoxContentsToStringArray(HWND hWnd)
{
//get number of files in List Box:
int filecount = SendDlgItemMessage(hWnd,IDC_FILES,LB_GETCOUNT,0,0);

for(int currfile = 0; currfile < filecount; currfile++)
{
//(Somehow!) add filenames/paths to string array...
SendDlgItemMessage(hWnd,IDC_FILES,LB_GETTEXT,currfile,(LPARAM)(LPTSTR)szFileName[?]);
}
}

In the above example, szFileName[?] represents where I am guessing my string array should go...

My (very basic) question is, how do I define a string array that would work for this purpose and get something along the lines of the above code to work? (I'm using the Windows API with no MFC.) I'm a novice coder, and unfortunately I can't find anything about the basics string arrays in my Sam's and seem only to find very complex stuff when Googling...

All I actually need to do is save the contents of a listbox so that I can use it later.

Many thanks for any help,
KB
GeneralRe: String Arrays Pin
User 66586-Aug-03 10:13
User 66586-Aug-03 10:13 
GeneralRe: String Arrays Pin
David Crow6-Aug-03 10:27
David Crow6-Aug-03 10:27 
GeneralRe: String Arrays Pin
Kayembi6-Aug-03 14:20
Kayembi6-Aug-03 14:20 
Generaltest Pin
chq126-Aug-03 8:26
chq126-Aug-03 8:26 
GeneralRe: test Pin
Terry O'Nolley6-Aug-03 16:57
Terry O'Nolley6-Aug-03 16:57 
GeneralRe: test Pin
Ryan Binns6-Aug-03 18:47
Ryan Binns6-Aug-03 18:47 
QuestionHow to change background color on toolbar Pin
ElizabethC6-Aug-03 8:24
ElizabethC6-Aug-03 8:24 
GeneralMACROS. Pin
WREY6-Aug-03 8:12
WREY6-Aug-03 8:12 
GeneralRe: MACROS. Pin
Larry Antram6-Aug-03 8:19
Larry Antram6-Aug-03 8:19 
GeneralRe: MACROS. Pin
WREY6-Aug-03 9:02
WREY6-Aug-03 9:02 
GeneralRe: MACROS. Pin
Larry Antram6-Aug-03 9:24
Larry Antram6-Aug-03 9:24 
GeneralRe: MACROS. Pin
WREY6-Aug-03 10:19
WREY6-Aug-03 10:19 
GeneralRe: MACROS. Pin
Larry Antram6-Aug-03 10:40
Larry Antram6-Aug-03 10:40 
GeneralRe: MACROS. Pin
Larry Antram6-Aug-03 10:53
Larry Antram6-Aug-03 10:53 
GeneralRe: MACROS. Pin
WREY6-Aug-03 12:01
WREY6-Aug-03 12:01 
GeneralProblem with Passing ofstream to DLL Pin
DionChen6-Aug-03 8:04
DionChen6-Aug-03 8:04 
QuestionHow to use SetWindowSubclass Pin
krosswindz6-Aug-03 7:50
krosswindz6-Aug-03 7:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.