|
-
Dec 11th, 2001, 05:44 PM
#1
Thread Starter
Hyperactive Member
sendMessage--> char[260] to long
What im trying to do is send a string from the find file structure to a listbox. heres the code I am using
Code:
SendMessage(listbox,LB_ADDSTRING,NULL, fd.cFileName);
the error I get is:
cannot convert parameter 4 from 'char [260]' to 'long'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Any help is greatly appreciated! Thanks
Matt 
-
Dec 12th, 2001, 07:13 AM
#2
It needs an address. Not sure what cd.cFileName is, assuming a LPCSTR
like:
Code:
LPCSTR tmp;
//copy the fd.cFileName to tmp pointer
SendMessage(listbox,LB_ADDSTRING,NULL,(LPARAM) tmp);
-
Dec 12th, 2001, 12:45 PM
#3
You don't need the tmp:
SendMessage(listbox,LB_ADDSTRING,NULL, (LPARAM)fd.cFileName);
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|