Click here to Skip to main content
15,903,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: what the heck is __stdcall about? Pin
Nibu babu thomas25-May-06 19:41
Nibu babu thomas25-May-06 19:41 
GeneralRe: what the heck is __stdcall about? Pin
Smith#25-May-06 21:49
Smith#25-May-06 21:49 
GeneralRe: what the heck is __stdcall about? Pin
Steve S25-May-06 22:09
Steve S25-May-06 22:09 
GeneralRe: what the heck is __stdcall about? Pin
Smith#25-May-06 22:13
Smith#25-May-06 22:13 
GeneralRe: what the heck is __stdcall about? Pin
Nibu babu thomas25-May-06 22:15
Nibu babu thomas25-May-06 22:15 
GeneralRe: what the heck is __stdcall about? Pin
Member 303984326-May-06 19:08
Member 303984326-May-06 19:08 
AnswerRe: what the heck is __stdcall about? Pin
Hamid_RT25-May-06 20:19
Hamid_RT25-May-06 20:19 
QuestionRichEdit Errors Pin
VinayCool25-May-06 19:26
VinayCool25-May-06 19:26 
Hi All,

Sorry i am back again.

Steve i am getting below errors can please tell me what is cause.

--------------------Errors--------------------

--------------------Configuration: DesktopSearch - Win32 Debug--------------------
Compiling...
SearchDlg.cpp
SearchDlg.cpp(641) : error C2065: 'textLen' : undeclared identifier
SearchDlg.cpp(642) : error C2664: 'SetSelectionCharFormat' : cannot convert parameter 1 from 'struct _charformat *' to 'struct _charformat &'
A reference that is not to 'const' cannot be bound to a non-lvalue
Error executing cl.exe.

2 error(s), 0 warning(s)

-----------Code--------------------------
void CSearchDlg::HilightWords(char* word)

{
CHARFORMAT cf;
memset(&cf, 0, sizeof(CHARFORMAT));
cf.cbSize = sizeof(CHARFORMAT);
cf.dwMask = CFM_BOLD;
cf.dwEffects = CFE_BOLD;

FINDTEXTEX findText;
int foundCount = 0;
int foundPos = 0;

int wordLen = lstrlen(word);

findText.chrg.cpMin = 0;
findText.chrg.cpMax = -1;

findText.lpstrText = word;

foundPos = m_FCONT.FindText(FR_WHOLEWORD, &findText);

while (foundPos != -1)
{
m_FCONT.SetSel(foundPos, foundPos + textLen); //Error 1
m_FCONT.SetSelectionCharFormat(&cf); //Error 2


findText.chrg.cpMin = foundPos + textLen;

foundPos = m_FCONT.FindText(FR_WHOLEWORD, &findText);
}
}


void CSearchDlg::OnDblclkSout()
{ -----------
-------------------------
----------------------------------------


FILE *fp = fopen(str,"r");
if (fp)
{
// goto the end of file
fseek(fp, 0L, SEEK_END);
// get the length of the file
long fileLen = ftell(fp);
// go back to the start of the file
rewind(fp);

// allocate buffer for file contents
char* text = new char[fileLen + 1];

// read the file into the buffer
fread(text, 1, fileLen, fp);

// null terminate the string
text[fileLen] = 0;

// set the window text
m_FCONT.SetWindowText(text);

delete [] text;
fclose(fp);
}

else
{
MessageBox("Select only file name to open.",MB_OK | MB_ICONINFORMATION);
return;
}
HilightWords(word);

}


Regards,
Vinay Charan.
AnswerRe: RichEdit Errors Pin
Hamid_RT25-May-06 19:31
Hamid_RT25-May-06 19:31 
GeneralRe: RichEdit Errors Pin
VinayCool25-May-06 19:37
VinayCool25-May-06 19:37 
AnswerRe: RichEdit Errors Pin
Hamid_RT25-May-06 19:39
Hamid_RT25-May-06 19:39 
AnswerRe: RichEdit Errors [modified] Pin
Steve Echols25-May-06 19:41
Steve Echols25-May-06 19:41 
GeneralRe: RichEdit Errors [modified] Pin
VinayCool25-May-06 20:01
VinayCool25-May-06 20:01 
GeneralRe: RichEdit Errors Pin
Steve Echols25-May-06 20:17
Steve Echols25-May-06 20:17 
GeneralRe: RichEdit Errors Pin
VinayCool25-May-06 20:21
VinayCool25-May-06 20:21 
GeneralRe: RichEdit Errors [modified] Pin
Nibu babu thomas25-May-06 20:06
Nibu babu thomas25-May-06 20:06 
GeneralRe: RichEdit Errors Pin
Steve Echols25-May-06 20:29
Steve Echols25-May-06 20:29 
GeneralRe: RichEdit Errors Pin
Nibu babu thomas25-May-06 20:34
Nibu babu thomas25-May-06 20:34 
GeneralRe: RichEdit Errors Pin
Steve Echols25-May-06 20:42
Steve Echols25-May-06 20:42 
GeneralRe: RichEdit Errors Pin
Hamid_RT25-May-06 20:40
Hamid_RT25-May-06 20:40 
GeneralRe: RichEdit Errors Pin
VinayCool25-May-06 21:09
VinayCool25-May-06 21:09 
QuestionC++ Certification Pin
Sarath C25-May-06 19:06
Sarath C25-May-06 19:06 
AnswerRe: C++ Certification Pin
anwer_skk25-May-06 19:48
anwer_skk25-May-06 19:48 
GeneralRe: C++ Certification Pin
Renjith Ramachandran26-May-06 2:12
Renjith Ramachandran26-May-06 2:12 
GeneralRe: C++ Certification Pin
anwer_skk26-May-06 2:50
anwer_skk26-May-06 2: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.