|
I am little new to GUI programming and especially CRichEditCtrl class.
How can i implement the below using CRichEditCtrlView:
For example in Wordpad if i open a new text document and uses some rich editing feautres then while saving the file it asks me "saving the file in text format looses formatting features."
How do i really detect whether user has used any rich editing feautres in a text document of CRichEditCtrlView
|
|
|
|
|
First of all I don't know those classes.
But I think you need to update a m_bRichEditFeatureUsed flag.
Set it to 1 when such feature is used; Set it to 0 after you save.
|
|
|
|
|
Use the m_bRTF boolean of the CRichEditDoc class. You can set it to TRUE or FALSE depending whether you want to save as RTF or plain text respectively.
Best regards,
Alexandru Savescu
|
|
|
|
|
I think what he's asking about is weather the user has actually used any RTF in the document, not how to choose which format to save in.
Unfortunately I can't think of any simple ansawer to that question
|
|
|
|
|
When I selected the menu "build-start debug-attach", there is no processes shown in the "attach process" dialog box.
Whp know the reason?
Thanks
|
|
|
|
|
Are you running under an account that has debug privs?
|
|
|
|
|
anyone knows how do i find if some of the resources(ico,bmp,dlg) in my project are not in use without going check one by one ???
Casa.Sapo.pt
|
|
|
|
|
Could you just do a global search of your project source code for the resource ids to see if you call them anywhere?
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
yes
but the project is to big ,and go one by one to find those that are not in use is hell of a job
Casa.Sapo.pt
|
|
|
|
|
Choose Edit | Find in Files from the menu. THis will allow you to search a whole directory and it also allows you to specify the types of files to search.
I use the keyboard combination Alt + E, I. If the search is taking to long, then you can specify Alt + E, I again to stop it.
The results from the search will appear in your output window.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
yes, but try to imagine that you have a lot of resources created by outher programmers , and you whant to delete all of those that are not used, without do the search one by one
i think i have found one project do build on my free time
Casa.Sapo.pt
|
|
|
|
|
Max... Santos wrote:
i think i have found one project do build on my free time
When your finished, please post it on CP as an artical: I have exactly the same problem!
Dylan Kenneally
London, UK
|
|
|
|
|
From the View Menu you may choose Resourse Symbols or Resource Includes. It will try to tell you what resource ids are being used.
Best regards,
Alexandru Savescu
|
|
|
|
|
Hey Everyone
I was working on a Browser based ActiveX Control (MFC VC++ 6 SP5) for doing file transferring. I have an internal thread in the control that handles all the transferring and such. I would like to send messages back to the main dialog for display (logging). However, I'm unable to send a message from the thread that the Control catches. I can throw messages in the control and catch them.. I can throws messages in the thread and catch them in the thread, just unable to send a message from the thread to be caught by the control (COleControl class). I have done something similar in an App, but I used an AfxGetMainWnd()->PostMessage(...) when posting the message, since this is a control and there by being a dialog based app, How do I get the message back to the main control or main dialog class?
As a note, I used the "ON_REGISTERED_MESSAGE" macro to register a custom message mapping to a handler function. Is there any reason why this would cause a problem? It works in an .exe App.
Thanks for any help or suggestions
Rick Gavin
|
|
|
|
|
I am not quite sure that I follow your question, but I believe that you will want to look at the PostThreadMessage function.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I have tried PostThreadMessage with no luck.
I have an activex control, generated with the 'MFC ActiveX ControlWizard', which gives me an app class of type COleControlModule, the program is structerd as such.... The COleControl Creates the Dialog, which intern creates the Thread, which intern creates the Socket. The data from the socket needs to be displayed in the dialog.
COleControlModule (App)
- COleControl (Ctrl)
- - CDialog
- - - CWinThread
- - - - CAsyncSocket
How do I get a message from the CAsyncSocket derived class back to the COleControl or the CDialog? If this was an App and Not a Control, I could use AfxGetApp() or AfxGetMainWnd()->PostMessage(...) to get a handle back to the main thread. However, these reference doesn't seem to be working for me in a Control.
Thanks for any help.
|
|
|
|
|
When I add this to my stdafx.h:
#pragma once
#ifndef foo
#define foo
#pragma message( "************i should be seen once*****************" )
#elif
#pragma message( "************i should be seen a lot*****************" )
#end#pragma once
#ifndef foo
#define foo
#pragma message( "************i should be seen once*****************" )
#elif
#pragma message( "************i should be seen a lot*****************" )
#endif
if
all I see in the compiler is the first message? Shouldn't it print the top message once, then lots of copies of the second message?
What obvious mistake am I making /this/ time?
TIA,
Pete
|
|
|
|
|
sorry, that code should have read as follows:
#pragma once
#ifndef foo
#define foo
#pragma message( "************i should be seen once*****************" )
#elif
#pragma message( "************i should be seen a lot*****************" )
#endif
|
|
|
|
|
No, because stdafx.h is preprocessed only once. See the VC forum FAQ, I have a FAQ on how precompiled headers work.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Good Eyes
I first looked at that question and I could not see why it would be failing, then I see your response and realized he was doing it in the precompiled header.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Ok, I've just read the FAQ (thanks for that btw), but I'm still confused.
I selected "Not using pch" in the project settings, and created a new header file which contains the following:
#include "stdafx.h"
#include <streams.h>
#include <initguid.h>
#include <qedit.h>
#pragma once
#ifndef foo
#define foo
#pragma message( "************i should be seen once*****************" )
#elif
#pragma message( "************i should be seen a lot*****************" )
#endif
this file is <bold>#include'd by a few other headers.
But I'm still only seeing the first line
By my reasoning, the header should be (pre)processed at least twice, since I see the first line a few times. So what's going on? are the defines not persistent throughout the preprocessing?
I'm confused!
Thanks for any input,
Pete
|
|
|
|
|
I want to create a simple application that exists only as a dialog. Thats easy enough. But I want that dialog to be a tabbed dialog.
That seems like it should also be easy but I'm stuck. Does anyone have a hint on this should be done?
Ron
|
|
|
|
|
If ur using MFC, check out CPropertySheet and CPropertyPage ,
otherwise have a look at the PropertySheet and CreatePropertySheetPage function.
Cheers!
Marc
|
|
|
|
|
I should have indicated I knew how to use the property sheet but my problem is getting the property sheet into the dialog that you get when you create a dialog based application.
I can create a property sheet dialog on the fly but then my application shows that dialog, and when I dismiss it, the application dialog pops up. I want them to be one and the same.
Ron
|
|
|
|
|
Ron,
Create a modeless property sheet as a child of your dialog, and do this in the dialog's OnInitDialog() handler. I often use an invisible frame in my dialog's resource to position and size the property sheet. This lets me easily add other controls to the dialog, since I can see the exact location of the property sheet in the resource editor.
/ravi
Let's try putting "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|