Hello, Can you tell me what CRichEditCtrl's limitations are? Thank you.
blongtq
Posts
-
What are CRichEditCtrl's limitations? -
StreamOut with large contentHello, I have followed your code, but I have a Debug Assertion Failed at line 102 of file filemem.cpp when it executes to line:
while(memFile.Read(szBuff, GETCONTENT_BUFFER) > 0)
Can you tell me what happens. Thank you very much for your help. -
StreamOut with large contentHello all, When I use StreamOut feature of RichEditCtrl, I have a problem with large content. My StreamOut function always gets 2050 characters although my RichTextCtrl contains up to 300000 characters. Please take a look on my code below and tell me why.
DWORD __stdcall MyStreamOutCallback(DWORD dwCookie,LPBYTE pbBuff,LONG cb,LONG *pcb) { USES_CONVERSION; LPWSTR lpUniText = T2W((LPTSTR)pbBuff); CString * psBuffer = (CString *)dwCookie; *psBuffer = CString(lpUniText); *pcb = wcslen(lpUniText); return 0; } CString GetSelText(CRichEditCtrl &rtf) { CString strOut; EDITSTREAM es; es.dwCookie = (DWORD)&strOut; es.pfnCallback = MyStreamOutCallback; rtf.StreamOut(SF_TEXT|SF_UNICODE,es); CHARRANGE cr; rtf.GetSel(cr); strOut = strOut.Mid(cr.cpMin,cr.cpMax-cr.cpMin-1); TRACE(_T("\ncpMax-cpMin-1 = %ld"),cr.cpMax-cr.cpMin-1); return strOut; } void CTestRTFView::OnButton1Click() { CRichEditCtrl &rtf = (CRichEditCtrl &)GetRichEditCtrl(); CHARRANGE cr; rtf.SetSel(0,-1); CString str = GetSelText(rtf); //str always contains 2050 characters. }
Is my StreamOut function correct? Please give me a way to use StreamOut with a large content. Thank you very much for your help. -
OpenDocumentFile(NULL) has problemHello all, I have a big problem and I don't know why. Here is my problem: I have a large project with unicode supported. When I build it as Debug configuration, everything is OK and my app runs correctly. When I build it as Release configuration, the linker complains: LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /INCREMENTAL:NO specification LINK : warning LNK4098: defaultlib "mfc42ud.lib" conflicts with use of other libs; use /NODEFAULTLIB:library LINK : warning LNK4098: defaultlib "mfcs42ud.lib" conflicts with use of other libs; use /NODEFAULTLIB:library LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library. I ignore these warnings and try to run my app. Then, my app hangs when calling OpenDocumentFile(NULL). I really don't know why the linker uses *d.lib during the linking process. After that I use /NODEFAULTLIB to ignore these lib and the linker complain again: LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /INCREMENTAL:NO specification LINK : warning LNK4098: defaultlib "mfc42u.lib" conflicts with use of other libs; use /NODEFAULTLIB:library LINK : warning LNK4098: defaultlib "mfcs42u.lib" conflicts with use of other libs; use /NODEFAULTLIB:library LINK : warning LNK4098: defaultlib "msvcrt.lib" conflicts with use of other libs; use /NODEFAULTLIB:library I ignore these warning and try to run my app. Then, my app cause a DEBUG ASSERTION. It is so STRANGE because I build my app under Release mode. Please give me some ideas. Thanks in advance.
-
How to embed MS Word into my app?Hello all, Suppose I want my application can edit a .doc file, so I decide to embed a MS Word ActiveX control into my app. Unfortunately, I can't find one. I only find SpreadSheet ActiveX control comes from Microsoft. Anyone can give me a way to embed a MS Word into my application? Thank you very much for your help. Long Truong
-
How to recognize which type of an incoming call?Hello all, I plan to develop an unified messaging system and I have a problem. Suppose that my system has been built and if user A wants to use my service, he/she must register. When he/she registers as member, he/she will be given an unique number (xxxxxx for example). From now on, his/her friend should contact him/her by using this number. And now, I have problem. When B (his/her friend) wants to send fax or phone to user A, B only use xxxxxx as a target number. So my server does not know what type of an incoming call for redirecting to appropriate gateway. Is there anyway to solve this problem? Thank you for viewing this post. Long Truong
-
How to access C++ Lib by using Java?Hello all, Is there anyway to access C++ Library by using Java (Pure Java)? If yes, please give me some instructions. Thank you very much. Long Truong
-
Is there any way to send/receive fax by using TAPI?Hello, Is there any way to send/receive fax by using TAPI? If yes, please send me some instructions. Thank you. Long Truong
-
How to get the printer's informationI only want the total of printed pages. Ex: My program will start automatically every time Windows loads. During the Windows session, when user print his/her documents, my program will show the total of printed pages and the total cost of them. Here is an output example: Print time: 12:22:00 Document: letter.doc Cost per page: 5 Total page(s): 3 Total cost: 15
-
How to get the printer's informationHello, First of all, I want to sorry about my terrible English. Next, please show me the way to get the information of the printer. Ex: When the user print his/her document (or anything else), my program catches this event and determining the total of printed pages for calculating cost. If applicable, please give me the VC++ source code. Thank you very much. :confused: