|
for some reason, when i access classwizard, wizardbar, or classview menu items, VC++ seems to stall for about 2 seconds and then delete some of the files... this is obviously terrible, especially when not all my projects are on SourceSafe (VSS gets annoying and is useless for small projects)
so basically, how do i fix this? i called Tech.Supp. but they said they "couldn't reproduce the problem", meaning they're not smart enough to fix it.
anyway, im using Win2K w/ VC++ 6.0, service pack 5 or whatever the latest one is
thanks
-tekno117@optonline.net
|
|
|
|
|
There was an issue like that with the classwizard deleting files.. but is supossed to be fixed in one of the service pack's.
Make sure you have que lastest one.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
Is is possible to use a CRichEditCtrl without placing it on a dialog. I see that the create method takes some parameters that must be non-null, but all I want is the CRichEditCtrl's printing functionality. I have an RTF file to be printed, but don't know of a better way than this. Can anyone make some suggestions here?
Thanks.
-Matt
|
|
|
|
|
I think there shouldn't be an issue with you creating the window anywhere. Just don't specify WS_VISIBLE as a creation flag. Then it will never be visible.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
This is a non-GUI application. I don't even have a resource file. Can I still get away with this without a resource file? If so, what do I do with the last parameter of the Create function (nID)?
Here's what I'd like to do:
m_richEdit.Create( ES_MULTILINE ,
rect ,
CDialog(),
-1);
Can something like this be done?
Thanks.
-Matt
|
|
|
|
|
That last parameter can be anything. Set it to 9999 and you should be fine.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I get all kinds of ASSERT failures about the parent wnd. Here's what I'm doing:
CRect rect;
CDialog dlg;
CRichEditCtrl richEdit;
richEdit.Create( /*.. STYLES ETC */, rect, &dlg, 9999);
// Use the rich edit
It seems as though since the CDialog is not attached to resource, it is failing.
Any ideas?
-Matt
|
|
|
|
|
I am attempting to use memory mapped files to access rather large files for manipulation purposes.
Mapping a view of the file returns an LPVOID pointer that I (LPTSTR) cast to a CString for easier string manipulation. I am able to work with the contents quickly as expected. I am not, however, able to successfully save the newly modified contents back to the file. Unmapping returns successfully, but the file contents are never updated. Printing the contents of the CString var shows that the changes have been made.
I was told that, due to reference counting in the CString class, I would be unable to use the returned pointer in this fashion. So I tried to create the LPVOID, copy the pointer to the CString var, make changes, then copy the pointer back to the original LPVOID. The contents of the LPVOID var changes, but once again the file does not.
Currently I am using PJ Naughter's MemMappedFile class, which is a wrapper for the MMF API. Here is the code I am using:
<tt><font color=#990000><br>LPVOID pMsgPtr;<br>CString strMsgPtr;<br><font color=#009900>
Is there any way that I can use the CString manipulation functions while maintaining the pointer?
Thanks, Chris
|
|
|
|
|
When you assign the strMsgPtr variable with pMsgPtr, you are creating a copy of the string. So, as you make changes to strMsgPtr, you are making changes to the copy.
To copy the string back to the memory mapped file, you could add this line of code and remove your last two lines.
_tcscpy ((LPTSTR) pMsgPtr, strMsgPtr);
This will copy the contents of the string back into the memory mapped file section.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I want to build an application, which looks pretty much like MS Excel, or the window, which displays the find results in VC++ 6.0. Basically a tabbed view.
I found a few tabbed views on the project, but I would like to have one exactly like Excel. Any ideas how this control is called so i can search for it? Maybe someone can even tell me where to get it?
Thank You,
XP
|
|
|
|
|
Is this the thing you want?
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Take a look at the VisualFX library at CodeGuru. Either you can use it directly or take the parts you want.
Here's the link
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Maybe Paul DiLascia can help you:
MSDN - Periodicals 1999 - MSJ - April - Q & A C++
|
|
|
|
|
Hi All,
I'm trying to put together an application that will alow the user to have a bunch of screens open at the same time. Most of these will be some sort of form view, but all related, ie these are all tied to the same document. One screen, let's say would ask the user for their address and phone number, and the next maybe some other information.
Navigation from one entry screen to another will be directed by a tree control on a dialog bar docked on the left side of the main frame, where each of the leaves of the tree represents a distinct screen the user would need to visit.
So, what's the way to have one document, and several views, any one of which could be open or not at a given time?
Thanks,
Aaron
|
|
|
|
|
If you want to know how to have one doc with several view check this
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
There are several ways to do this, but here's mine:
Create a spitter with the tree view in the left pane and a CView derivative (CYourView : public CView) in the right one. When the CYourView window is created (CYourView::OnCreate()) you create as many child views as you have different types of form views. Each child view is of course derived from CFormView. Create the child views invisible (either with a zero size or without the WS_VISIBLE style). Now, each time you make a selection in the tree view you send a message to CYourView, which in turn hides the current displayed child view and shows the new one, filling it with the relevant data. If you set up a CCreateContext structure and pass it to the child view on creation they will behave exactly like ordinary views.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Hi,
I create a MFC Application with the wizard, SDI / MDI. After I compile, some dialog boxes and the print preview are in french??? I know that I have french software on my computer but my XP is in English as is my VS6. I would like to compile my apps in english please. If you want me to send you a file, ask me.
Boxes in french (the one I found):
-Open
-Save
-Save As
-New
-Print
-Print Preview (everything in there)
-... etc.
// JS Paquet
cout << "Thank you all" << endl;
|
|
|
|
|
I'm having problems getting rid of a memory leak in my application. It has the potential to be a huge problem in the application but I don't know what I can do to get rid of it. I've tried everything I know. Here's the code where the leak is coming from:
for(i = 0; i < FormationSize; i++)
{
ar >> PositionID;
((CText*)PositionID)->SetTextFont(&lf);
(*FormationPositions)[i]->PositionIdentifier = AdjustPositionLocation(PositionID, OpenViewBottomRight);
ar >> (*FormationPositions)[i]->PositionType;
}
FormationPositions is a parameter that is passed by reference to the function containing this code and it is a pointer to a vector where each element in the vector is composed of two parts--a pointer to a Text element and a CString. What I'm doing is reading in information from a saved off file and storing each element in the vector. I'm not sure what I'm doing wrong, but when the application closes, each element of the vector is listed in the memory leak. This code is executed each time a file name is selected from a dropdown box so for each instance of a file being selected from the dropdown box, there are that many sets of vector elements listed in the memory leak. Sorry if this is a bit convoluted. It's hard for me to explain it with any degree of competency. As you can see, I'm not that smart.
Any ideas? Need more info?
|
|
|
|
|
When the vector goes out of scope, it does not call delete on these pointers. You need to do that yourself, probably with for_each.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
If I'm understanding you correctly, the vector is storing a struct/class that contains a pointer to a Text element and a CString. The main question is, are you destroying the memory pointed to by each Text element pointer when the program closes? This would be done in the destructor for each struct/class.
CodeGuy
The WTL newsgroup: over 1200 members! Be a part of it. http://groups.yahoo.com/group/wtl
|
|
|
|
|
Maybe I can try to explain it a little more clearly. What's happening is I'm passing in the vector containing 11 struct elements, each of which is comprised of a pointer to a Text element and a CString. What I'm trying to do is replace the 11 elements in the vector with 11 new elements each time a file is selected by the user from the dropdown box. My problem is that I'm coming up with 11 new elements that are causing the memory leak.
For example, the program starts and the user selects a new file, then he selects another new file later during program execution. When the application exists, there are 22 elements listed in the memory leak information. On the other hand, if the user just fires up the application and uses any/all of the functionality except for using the dropdown box, when the program exists, everything is fine...no memory leak. The elements are destroyed in the destructor.
Any new thoughts?
|
|
|
|
|
No new thoughts, just the same ones.
You have a pointer to a Text element in the struct. What it sounds like you're doing is calling 'new' to allocate memory for each Text element every time the file is selected from the combo box.
What you have to do is 'delete' the memory used by the Text elements each time you reselect a file. The vector only manages memory for the struct; it doesn't manage memory for elements inside the struct like the Text element.
The CString of course is not a problem because it manages its own memory.
CodeGuy
The WTL newsgroup: over 1200 members! Be a part of it. http://groups.yahoo.com/group/wtl
|
|
|
|
|
Arg.. I am having the hardest time with writing a CPropertySheet program. I am working with 3 different classes which are derived from CPropertyPage. I am trying to figure out how to make it so when you click OK on any of the pages it causes data validation on all of the pages.
I thought that I could override the OnOK() function of page1 such that it will call UpdateData() for page2 and page3, however an assertion error occurs if you call UpdateData on a PropertyPage that doesn't have focus. And I can't write a function for each page that sets itself as the active page as the (CPropertySheet*)GetParent() wont work since its called from another page and not the sheet.
So then I thought that on the OnInitDialog() of page1 I would set member variables(pointers) which point to the PropertySheet and each of the pages, such that each page would have member variables (pointers) to both the PropertySheet and each of the pages. But when I try to compile I get tons of errors in my headers where I define the pointers:
public:
CPropertySheet *pSheet;
CPropPage1 *pPage1;
CPropPage2 *pPage2;
CPropPage3 *pPage3;
It doesnt mind the CPropertySheet pointer member variable, but it gives the error "error C2143: syntax error : missing ';' before '*'" for each of the other pointer declarations even though right above i have the includes:
#include "PropPage1.h"
#include "PropPage2.h"
#include "PropPage3.h"
Why is it that it wont let me create member variables which are pointers to my user defined classes? Why is it such a pain in the butt to make is so that the OK button on a CPropertySheet does validation on each of its pages instead of just the one that is being displayed? And why have I wasted the last 3 hours on something that seems like it would be so easy!
Thanks for any help you can provide this newbie.
-dz
|
|
|
|
|
If you want to look at my sample download the project at:
www.dzgraphics.com/PropSheetTest.zip
Use the 'test 2' button on the toolbar
-dz
|
|
|
|
|
How can I create splitter windows using SDK.
|
|
|
|