Click here to Skip to main content
15,929,597 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralReturning collection class Pin
parag19-Jun-01 20:31
parag19-Jun-01 20:31 
GeneralRe: Returning collection class Pin
markkuk19-Jun-01 22:50
markkuk19-Jun-01 22:50 
GeneralRe: Returning collection class Pin
Tomasz Sowinski19-Jun-01 22:55
Tomasz Sowinski19-Jun-01 22:55 
QuestionWhat is,for goodness' the problem in this cute code ??? Pin
19-Jun-01 19:50
suss19-Jun-01 19:50 
AnswerRe: What is,for goodness' the problem in this cute code ??? Pin
Michael Dunn19-Jun-01 19:58
sitebuilderMichael Dunn19-Jun-01 19:58 
AnswerRe: What is,for goodness' the problem in this cute code ??? Pin
Christian Graus19-Jun-01 20:02
protectorChristian Graus19-Jun-01 20:02 
Generalok, you are right and What is the problem now Pin
19-Jun-01 21:01
suss19-Jun-01 21:01 
AnswerRe: What is,for goodness' the problem in this cute code ??? Pin
markkuk19-Jun-01 20:39
markkuk19-Jun-01 20:39 
void CFilesDlg::OnButton1()
{
    // TODO: Add your control notification handler code here
    CString str(50);
    str = "22223333333333222";
There's no such constructor for CString. Use
CString str("22223333333333222");
instead
CFile file;
if(file.Open("string.data",file.modeWrite|file.modeNoTruncate|file.modeCreate))
    file.Write(&str,sizeof(str));
&str doesn't return a pointer to the characters contained in the CString, and sizeof(str) isn't the string length. To write the contents of the CString instead of pointers, reference counts and other useless information:
file.Write(str, str.GetLength());
}
void CFilesDlg::OnButton2()
{
    // TODO: Add your control notification handler code here
    CString str(50);
Same error as before, use
CString str;
CFile file;
if(file.Open("string.data",file.modeRead))
    file.Read(&str,sizeof(str));
What you need here is:
{
int len = file.Read(str.GetBuffer(50), 50);
str.ReleaseBuffer(len);
}
    MessageBox(str);
}

Generalwell done! markkuk !!! Pin
19-Jun-01 21:32
suss19-Jun-01 21:32 
AnswerRe: What is,for goodness' the problem in this cute code ??? Pin
Jason Hihn20-Jun-01 3:54
Jason Hihn20-Jun-01 3:54 
GeneralDisplaying JPG and gif dynamically Pin
19-Jun-01 18:34
suss19-Jun-01 18:34 
GeneralRe: Displaying JPG and gif dynamically Pin
Christian Graus19-Jun-01 18:42
protectorChristian Graus19-Jun-01 18:42 
GeneralRe: Displaying JPG and gif dynamically Pin
Chris Losinger20-Jun-01 7:43
professionalChris Losinger20-Jun-01 7:43 
GeneralHelp needed for xemacs code! Pin
mvworld19-Jun-01 17:38
mvworld19-Jun-01 17:38 
GeneralWhy dialogbar covered by AfxControlBar when docked Pin
sunny279119-Jun-01 16:37
sunny279119-Jun-01 16:37 
GeneralCreateFiber on Win2K Pin
cH@RLIe19-Jun-01 14:55
cH@RLIe19-Jun-01 14:55 
GeneralRe: CreateFiber on Win2K Pin
19-Jun-01 15:05
suss19-Jun-01 15:05 
GeneralRe: CreateFiber on Win2K Pin
19-Jun-01 15:05
suss19-Jun-01 15:05 
GeneralRe: CreateFiber on Win2K Pin
cH@RLIe20-Jun-01 6:20
cH@RLIe20-Jun-01 6:20 
GeneralRe: CreateFiber on Win2K Pin
Erik Funkenbusch19-Jun-01 19:49
Erik Funkenbusch19-Jun-01 19:49 
GeneralRe: CreateFiber on Win2K Pin
cH@RLIe20-Jun-01 6:18
cH@RLIe20-Jun-01 6:18 
Generalreading mpeg header Pin
Vikash Dubey19-Jun-01 10:31
Vikash Dubey19-Jun-01 10:31 
GeneralRe: reading mpeg header Pin
Ryan Baillargeon19-Jun-01 17:32
Ryan Baillargeon19-Jun-01 17:32 
GeneralRe: reading mpeg header Pin
markkuk19-Jun-01 20:50
markkuk19-Jun-01 20:50 
GeneralRe: reading mpeg header Pin
Vikash Dubey20-Jun-01 8:19
Vikash Dubey20-Jun-01 8:19 

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.