Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
V

VinayCool

@VinayCool
About
Posts
133
Topics
24
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Package
    V VinayCool

    Hi All, I want to make package for my project, can anyone help me with this..so that i can install in other system. Regards, Vinay Charan.

    C / C++ / MFC help

  • File writeing [modified]
    V VinayCool

    Hi whitesky, I have used CFile but i am nt getting how to save in the file can u plz c the code. Regards, Vinay Charan.

    C / C++ / MFC

  • File writeing [modified]
    V VinayCool

    Hi All, I want to write the contents of the edit box to file i have used this code but its not working can u tell me the cause.. i want to remove the old contetns and add the contetns of the edit box. str holds the file name. CStdioFile file(str, CFile::modeWrite); file.Open(str); char *pBuffer = new char[dwSize + 1]; m_FCONT.GetWindowText(*pBuffer); UINT uWrite = file.Write(pBuffer, dwSize); delete [] pBuffer; Regards, Vinay Charan.

    C / C++ / MFC

  • how to convert CString to const WCHAR *
    V VinayCool

    Hi Noname, this will help u http://www.codeproject.com/cpp/data\_conversions.asp Regards, Vinay Charan.

    C / C++ / MFC tutorial

  • Makeing Package [modified]
    V VinayCool

    Thanks WhiteSky....:) Regards, Vinay Charan.

    C / C++ / MFC tutorial

  • Makeing Package [modified]
    V VinayCool

    Hi All, I want to know how to make installation file for my project, so it will be helpful for me to give a demo. Regards, Vinay Charan.

    C / C++ / MFC tutorial

  • RichEdit Errors
    V VinayCool

    Cool :) Regards, Vinay Charan.

    C / C++ / MFC c++ debugging help question workspace

  • RichEdit Errors
    V VinayCool

    Thanks Steve... I will do the research on CHARFORMAT ... Thanks a lot :) Regards, Vinay Charan.

    C / C++ / MFC c++ debugging help question workspace

  • RichEdit Errors
    V VinayCool

    Hi Steve Echols, Thanks for helping....Now its working... Since my semester is of 4 months I did not get time to attend VC++ classes outside, I just started learning on my own with help of Code Project and with help of masters like u and started working on my academic project. Since VC++ different from C++ I am finding it more difficult to understand the syntax and procedure… Can u please also tell how to increase the font(size) of the selected word,it will be helpfull if u can provide some links. Regards, Vinay Charan.

    C / C++ / MFC c++ debugging help question workspace

  • RichEdit Errors
    V VinayCool

    Hi whiteSky,, Error lines are m_FCONT.SetSel(foundPos, foundPos + textLen); //Error 1 m_FCONT.SetSelectionCharFormat(&cf); //Error 2 Regards, Vinay Charan.

    C / C++ / MFC c++ debugging help question workspace

  • RichEdit Errors
    V VinayCool

    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.",M

    C / C++ / MFC c++ debugging help question workspace

  • CRichEditCtrl word highlighting
    V VinayCool

    Hi WhiteSky, i want to highlight the word during text tranfer from file to rich edit box,i have no options of using another dialog for finding the text.. can u please tell me how to find the word and highlight it.. Regards, Vinay Charan.

    C / C++ / MFC help

  • CRichEditCtrl word highlighting
    V VinayCool

    Hi All, Sorry I am back…. With help of Steve Echols I have finished displaying text file in the Rich Edit box, Now I want to search a particular word in the edit box and I want to high light them Can u please help me with this…. word to be highlighted is stored in the variable w // set the window text m_FCONT.SetWindowText(text); delete [] text; fclose(fp); -- ----- CHARFORMAT cf; memset(&cf, 0, sizeof(CHARFORMAT)); cf.cbSize = sizeof(CHARFORMAT); cf.dwMask = CFM_BOLD; cf.dwEffects = CFE_BOLD; UpdateData(TRUE); CString w; w = m_WORD; int len = strlen(word); char word_position[50]; char word_length[50]; // **** pseudo-code **** for (int p = 0; p < len ; p++) { m_FCONT.SetSel(word_position[p], word_length[p]); m_FCONT.SetSelectionCharFormat(cf); } Regards, Vinay Charan.

    C / C++ / MFC help

  • CRichEditCtrl
    V VinayCool

    Hi Steve Echols, Thank for helping me for completing my project. Code is working i declared these vaiables char word_position[50]; char word_length[50]; Steve how to pass the word ??? where i ahve to pass the word which has to be highlighted ?? I have stored the word here which has to be hightlighted w = m_WORD; ---------------------------------- CHARFORMAT cf; memset(&cf, 0, sizeof(CHARFORMAT)); cf.cbSize = sizeof(CHARFORMAT); cf.dwMask = CFM_BOLD; cf.dwEffects = CFE_BOLD; UpdateData(TRUE); CString w; w = m_WORD; int len = strlen(word); char word_position[50]; char word_length[50]; // **** pseudo-code **** for (int p = 0; p < len ; p++) { m_FCONT.SetSel(word_position[p], word_length[p]); m_FCONT.SetSelectionCharFormat(cf); } Regards, Vinay Charan.

    C / C++ / MFC help c++ tutorial question

  • CRichEditCtrl
    V VinayCool

    Hi Appu, Thanks for the information,it will be usefull for me. Regards, Vinay Charan.

    C / C++ / MFC help c++ tutorial question

  • CRichEditCtrl
    V VinayCool

    Hi Anil, Thanks for the link... Regards, Vinay Charan.

    C / C++ / MFC help c++ tutorial question

  • CRichEditCtrl
    V VinayCool

    Hi Steve Echols, Thank you very much, code is 100% working. But at the end of edit of edit box i am getting some junk values as shown below. ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍýýýýÝÝÝÝÝÝÝÝÝ Can u please also tell me how to highlight a particular word in the Rich edit box. if want to high light a word america in the rich edit box ,the word may apper more then once.. can u please give me some inforamtion... Regards, Vinay Charan.

    C / C++ / MFC help c++ tutorial question

  • CRichEditCtrl
    V VinayCool

    Hi, I need your help very urgently.... I have only 2days left to complete my MCA Academic project can u please help me with the CRichEditCtrl control.. I am totaly new to VC++ and i have no idea how to work with CRichEditCtrl .. Can u please tell how work with CRichEditCtrl ? i want to pass the entire text file to CRichEditCtrl and i want to highlight some words after passing the text file to CRichEditCtrl i have created rich edit control IDC_FCONT m_FCONT of type CRichEditCtrl char ch; FILE *fp; fp=fopen(str,"r"); if(fp==NULL) { MessageBox("error opening file.",MB_OK | MB_ICONINFORMATION); return; } ch=getc(fp); while(!feof(fp)) { //putch(ch); ch=getc(fp); } // m_FCONT.SetWindowText(); fclose(fp); } can u please help me..... Thanking you .... i will be waiting... :doh: Regards, Vinay Charan.

    C / C++ / MFC help c++ tutorial question

  • CRichEditCtrl
    V VinayCool

    Hi Sarath, Thanks for the reply. I have created m_FCONT of CRichEditCtrl, for reading the contents is this function enough ?? char ch; FILE *fp; fp=fopen(str,"r"); ch=getc(fp); while(!feof(fp)) { ch=getc(fp); }

    C / C++ / MFC help tutorial question

  • CRichEditCtrl
    V VinayCool

    Hi, Can anyone help with adding file contents to Rich Edit Box?? I have a text file i want to add the contents to rich Edit box,how to do that?

    C / C++ / MFC help tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups