Click here to Skip to main content
15,893,790 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Can not Find Functions In Static Library Pin
AmbiguousName8-May-12 9:06
AmbiguousName8-May-12 9:06 
QuestionCRichEditCtrl interface question Pin
ForNow6-May-12 6:32
ForNow6-May-12 6:32 
AnswerRe: CRichEditCtrl interface question Pin
enhzflep6-May-12 7:21
enhzflep6-May-12 7:21 
GeneralRe: CRichEditCtrl interface question Pin
ForNow6-May-12 9:07
ForNow6-May-12 9:07 
GeneralRe: CRichEditCtrl interface question [modified] Pin
enhzflep6-May-12 10:14
enhzflep6-May-12 10:14 
GeneralRe: CRichEditCtrl interface question Pin
enhzflep6-May-12 11:01
enhzflep6-May-12 11:01 
GeneralRe: CRichEditCtrl interface question Pin
ForNow7-May-12 7:24
ForNow7-May-12 7:24 
QuestionCRichEditCtrl FindText problem Pin
ForNow5-May-12 20:24
ForNow5-May-12 20:24 
Hi,

I have a text file that at certain lines I insert a "_" as the first character

Here is a example

_ 000000 90EC D00C 0000C 34 STM R14,R12,12(R13)

This works fine ..

I would like to highlight the first such line in Bold Red to do this i use the FindText function however for some reason this return a -1
C++
CHARFORMAT cfm;


   SetSel(0,-1);                       // make the selection everything

   cfm.cbSize = sizeof(CHARFORMAT);
   cfm.dwMask = CFM_FACE | CFM_SIZE | CFM_BOLD |

   CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT | CFM_PROTECTED;
   cfm.dwEffects = 0;
   cfm.yHeight = 240;
   ::lstrcpy(cfm.szFaceName, "Times New Roman");

   SetDefaultCharFormat(cfm);



// LOOK for the first executable instruction
SetSel(0,0); // start at the beginig

FINDTEXTEX ft;
ft.chrg.cpMin = 0;
ft.chrg.cpMax = -1;
ft.lpstrText = (LPSTR) "_ ";

long n = FindText(FR_MATCHCASE|FR_WHOLEWORD, &ft);


C++
long l = LineLength(n);

   SetSel(n,l);

    cfm.cbSize = sizeof(CHARFORMAT);
    cf.dwMask = CFM_COLOR;
    cf.crTextColor  = RGB(255,0,0);

      SetDefaultCharFormat(cfm);

       SetSel(0,0);

AnswerRe: CRichEditCtrl FindText problem Pin
enhzflep5-May-12 21:44
enhzflep5-May-12 21:44 
GeneralRe: CRichEditCtrl FindText problem Pin
ForNow6-May-12 5:41
ForNow6-May-12 5:41 
GeneralRe: CRichEditCtrl FindText problem Pin
enhzflep6-May-12 5:54
enhzflep6-May-12 5:54 
QuestionLooping when you need user input Pin
abollmeyer5-May-12 19:25
abollmeyer5-May-12 19:25 
AnswerRe: Looping when you need user input Pin
Code-o-mat5-May-12 23:08
Code-o-mat5-May-12 23:08 
GeneralRe: Looping when you need user input Pin
abollmeyer6-May-12 3:37
abollmeyer6-May-12 3:37 
GeneralRe: Looping when you need user input Pin
enhzflep6-May-12 4:15
enhzflep6-May-12 4:15 
GeneralRe: Looping when you need user input Pin
abollmeyer6-May-12 7:32
abollmeyer6-May-12 7:32 
GeneralRe: Looping when you need user input Pin
enhzflep6-May-12 7:40
enhzflep6-May-12 7:40 
GeneralRe: Looping when you need user input Pin
Code-o-mat7-May-12 4:03
Code-o-mat7-May-12 4:03 
GeneralWelcome Pin
Code-o-mat5-May-12 23:11
Code-o-mat5-May-12 23:11 
Question64 bit problem Pin
appollosputnik4-May-12 4:41
appollosputnik4-May-12 4:41 
AnswerRe: 64 bit problem Pin
Albert Holguin4-May-12 9:58
professionalAlbert Holguin4-May-12 9:58 
AnswerRe: 64 bit problem Pin
«_Superman_»4-May-12 16:43
professional«_Superman_»4-May-12 16:43 
QuestionHelp for algorithm Pin
Falconapollo3-May-12 23:53
Falconapollo3-May-12 23:53 
QuestionRe: Help for algorithm Pin
Maximilien4-May-12 2:38
Maximilien4-May-12 2:38 
AnswerRe: Help for algorithm Pin
«_Superman_»4-May-12 3:15
professional«_Superman_»4-May-12 3:15 

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.