|
Hi all,
I am creating an MDI Application which is using CRichEditView as one of its view. i am doing some processing and have to displaying a set of values in the RichEditView. but what is the way in which i can display the text in the CRichEditView. It is compulsory that i have to use the RichEditView since my data size is huge. can anybody send me a sample or help me in sorting out this. Plz tryin respond fast. I need it very fast.
Sreeramachandra G
|
|
|
|
|
Hi,
use CString to show data in RichEditView. Use Format() Function. "/r/n" as new line feeder. Set appropriate properties of CRichEditCtrl.
The chosen One
|
|
|
|
|
If I have a dialog window, I can dynamically disable a button like this...
GetDlgItem(IDC_BWHATEVER)->EnableWindow(FALSE);
But how do I dynamically disable the buttons in the system menu at the top of the dialog?
|
|
|
|
|
Use CWnd::GetSystemMenu to get a pointer to the system menu of your dialog, then CMenu::EnableMenuItem to enable/disable the items. Use SC_CLOSE, SC_MOVE, or SC_SIZE as menu ID's (see in winuser.h)
|
|
|
|
|
Hi, everybody,
How to create a project template from an existing project (in VC++ .NET2003)?
Thank you
|
|
|
|
|
Does someone knows what function to use to retrieve the standard width of a vertical scrollbar (or height of an horizontal one) ? Damned, I can't find back in MSDN!
Thanks in advance.
Regards
|
|
|
|
|
I have found!
GetSystemMetrics(SM_CXVSCROLL)<br />
GetSystemMetrics(SM_CYVSCROLL)
|
|
|
|
|
I've got a rookie question. In an SDI or MDI app, in the View Class I can get a pointer to the current instance of the Document class and I don't have to create a new instance of CDocument.
So ... If I have two independent classes, what is the procedure, what do I have to do so the classes see eachother without declaring new instances of them ?????
Thank you!
|
|
|
|
|
As you said, in your view-class, you have a CDocument-pointer.
You can then call functions on the pointer, just as if it were a local variable:
CDocument* pDoc [needs to hold the pointer to the current Document]
pDoc->ADocumentFunction();
But this way you can only access functions of the MFC-CDocument-class, not any extension you made in a derived class CMyDocument.
For this, you need to cast. But for that, you need to be sure that you are working with an instance of CMyDocument. But that is easy, unless in very special circumstances where your application can open different type of documents and you have made different classes derived from CDocument.
Here is how to cast:
CMyDocument* pMyDoc = static_cast<CMyDocument*>(pDoc);
This line tells the compiler to treat your CDocument-pointer as the CMyDocument-pointer that it really is and assign it to the variable pMyDoc . Subsequently, CMyDoc points to the same object as pDoc, but treats it as a CMyDocument instead as a CDocument (as pDoc does).
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
What I meant is communication between two generic classes, not necessarely the Document and the View class.
|
|
|
|
|
Ok, it works just the same.
The hardest part is to get a valid pointer of the class you want to access.
I typical use an extra constructor parameter, e.g. for access to the Document in dialogs, or special Set-functions (but I then normally make my pointer a const pointer to a const object and carefully test for non-nullness).
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Assuming that you know ahead of time which classes need access to each other, you can hardwire it in. Write a function in each class to receive a pointer to the other class (the one it has to communicate with), and in that other class write a function that will send a pointer to itself to the first class. Do this as often as you need to, depending on the number of the classes that need to interact and the required directions of the interaction (i.e, one-way or two-way).
Ed
|
|
|
|
|
I need to be able to open a .pdf file (by launching acrobat reader or writer) and show a specific page.
This should be a simple thing, but I googled the whole freaking internet + news groups and could not find any usefull information. It seems the only way to find out how to do this is to buy the adobe SDK, but I don't have the funds to do that. Besides, I don't want to incorporate the whole freaking reader in my own application, I just want to open a file on a certain page!
So is there anyone out there that can solve my problems and frustrations ?
|
|
|
|
|
Use ShellExecute[^]. You will, of course, have to have Acrobat Reader installed on any PC that it runs on.
|
|
|
|
|
jdunlap wrote:
Use ShellExecute[^]. You will, of course, have to have Acrobat Reader installed on any PC that it runs on.
I thought about that, but then I still can only open the document, and not display a specific page of that document.
|
|
|
|
|
Should have paid closer attention to what you said in your post! I wonder if there's a command line option that will let you specify the page.
|
|
|
|
|
i always thought that the Adobe Reader installs an ActiveX Control. With this this should be possible. (the only thing.. you have to make a dialog with the Control on it)
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
I've read that you can use an ActiveX control, but this control seems to be very poorly documented. Besides, this is not really what I want, I just want to launch the acrobat reader or writer.
Thanx anyway.
|
|
|
|
|
[RANT]
it is documented like 99.9% of all the ActiveX Controls.. NOT AT ALL
[/RANT]
and i've quickly watched the functions of the interfaces.. it doesn't look like it has a "goto page" - function.. but you can call the "goto next page" function in a loop
yaya.. the joys of programming
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
I am developing a small windows XP application that iterates over a set of files in a folder and extracts information from the files properties (right-click, select properties and then the summary tab) like title, summary etc.
The article Microsoft Knowledge Base Article - 186898 shows how to do this for compund docuemnts like Word documents and so on, using IPropertyStorage.
However, In my application, I access non-compound documents (jpeg-files mostly). They can also have attributes like the office files, but IPropertyStorage doesn't seem to be the right choice for finding the information. Does anyone have any excpreience with this?
Regards // Jonas Pettersson
Regards // Jonas
|
|
|
|
|
It does work for JPG files, assuming they have information to show. You will, however, need to use StgOpenStorageEx() instead.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Can anybody provide me a sample code in c++ for creating classes using absrtact factory design patterns.
Only a layout will work (one bacse class with 1 -2 methods, and one derived class).
|
|
|
|
|
C++ Programmers needed at our site at www.losttware.com for new project.
|
|
|
|
|
Try in this forum[^] instead.
HTH,
K.
New, what do you own the world?
How do you own disorder?
|
|
|
|
|
Unlike a global variable that can be misused, does a global 'typedef' pose any such danger?
Are there any special constraint where I place a 'typedef'?
Thanks for any insight into this matter.
William
Fortes in fide et opere!
|
|
|
|