|
If you mean in the main client area, check out CFormView. When you run Appwizard, on the page towards the end (last or last but one) where it lists the classes that will be created, select your view class and select CFormView as the base class.
If you want to add a dialog as a toolbar, see the documentation for CDialogBar.
Hope this help!
|
|
|
|
|
Yep,in the client area. You mean with the class-wizard? I can't find the option there to change the base class.. ?
Thanks, Mark
|
|
|
|
|
No, in the App Wizard, when you first create the application. If you are doing it retrospectively, the best thing to do is to create a new project and then work out the differences in the generated code (changes will be mainly to the view and resources, but also possibly to the doc), merging the code into your existing project.
|
|
|
|
|
I habe a splitter Window with an Edit View and a CListView.
hello !!!
Now I have a shared sroll bar making with :
m_wndSplitter.SetScrollStyle(WS_VSCROLL);
Now the Edit View is reacting on the shared scroll-bar, but the ListView
has its own scroll-bar and is not reacting on the shared scroll bar.
So, what can I do, that the ListView has no scroll bar and that it is reacting on the shared scroll-bar???
Both Views must synchronous scroll with the shared scroll-bar.
Thank you for helping me,
cu
schoni
|
|
|
|
|
I'm using a technique I found here on code project to embed a combo box in a toolbar. Because my toolbar uses large 32x32 buttons, the toolbar spacer line (the "placeholder") behind the combo box is visible.
Any ideas on how not draw the line? (making it hidden eliminates it from the toolbar)
|
|
|
|
|
|
Hi,
I have a problem, I have an installation set for DAO36, and it tries to self register DAO2535.TLB... after that I get an error message...
Does make sense install a TLB ??? ( I think not as far as it don't have any registry information, I'm right ?).
Greetings
Braulio
|
|
|
|
|
Hi world,
What's the best solution to find the pointer which caused a memory leak?
I don't use MFC (and doesn't want to use it)!!! Is smart pointer a good solution?
Thanks for any advice...
Hello World!!!
from Raphaël
|
|
|
|
|
You can use the CRT Heap check functions:
#include "crtdbg.h"
#if defined(WIN32) && defined(_DEBUG)
const int _CrtDbgFlags =_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
_CrtSetDbgFlag(_CrtDbgFlags|_CRTDBG_LEAK_CHECK_DF);
#endif
I think there is a recent article here on CP about overiding new and delete to locate memory problems as well.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Hi,
http://www.codeproject.com/script/comments/forums.asp?msg=491851&forumid=1647&mode=all&userid=161454#xx491851xx
-----------------------------------------------------------
Hi,
Regarding the technique of dumping in-memory statistics, is
given below
Note: memstate1 takes snapshot of pre-memory leak and
memstate2 takes snapshot of post-memory leak. finally,
memstate3 makes the statistics based on both the snapshots.
CMemoryState memState1, memState2, memState3;
void CHello::MakeMemoryLeak()
{
memState1.Checkpoint();
LPCTSTR strMemoryLeak = new char[50];
memState2.Checkpoint();
memState3.Difference(memState1, memState2);
memState3.DumpStatistics();
}
Hope this Helps
Regards
~Hari~
|
|
|
|
|
And without MFC...???
Hello World!!!
from Raphaël
|
|
|
|
|
Hi,
Its not MFC. Basically, it uses _CRT... Functions/Flags only.
But the thing is, CMemoryState is declared & defined AFX.H/AFXMEM.cpp respectively. Just have a look at the code, if possible write your own.
Hope this helps.
|
|
|
|
|
I use macros as a wrapper to the malloc, realloc and free functions. This way I can log all my memory allocations to a file, the following is a bit complicated, but works:
#define realloc(PTR, SIZE) \
logReallocPtr(PTR, realloc(PTR, SIZE), ck_memsize(PTR), SIZE, __FILE__, #PTR, __LINE__, NULL)
#define malloc(SIZE) \
logReallocPtr(NULL, malloc(SIZE), 0, SIZE, __FILE__, #SIZE, __LINE__, NULL)
#define free(PTR) \
logReallocPtr(PTR, NULL, ck_memsize(PTR), 0, __FILE__, #PTR, __LINE__, free)
// This function gets called for every malloc, realloc and free
void *logReallocPtr(void *oldPtr, void *newPtr, size_t oldSize, size_t newSize, const char *file, const char *func, size_t line, void(*_free)(void*)){
char modFile[MAX_PATH];
int i=strlen(file)-1;
FILE *out=NULL;
if(!oldPtr && !newPtr) return NULL;
while(out==NULL) out=fopen("\\debug_alloc.txt", "ab");
strcpy(modFile, file);
while(i>=0){ if(modFile[i]==':') modFile[i] = '_'; i--; }
if(out){
fprintf(out, "%d:%s:%s:%d:%d:%.8x:%.8x:%d:%d:\r\n", (int)time(NULL), modFile, func, line, getpid(), (size_t)oldPtr, (size_t)newPtr, oldSize, newSize);
fclose(out);
}else{
fprintf(stderr, "%d:%s:%s:%d:%d:%.8x:%.8x:%d:%d:\r\n", (int)time(NULL), modFile, func, line, getpid(), (size_t)oldPtr, (size_t)newPtr, oldSize, newSize);
}
if(_free && oldPtr) _free(oldPtr);
return newPtr;
}
|
|
|
|
|
Oh, and ck_memsize(PTR) should be replaced with _msize(PTR).
|
|
|
|
|
Anybody knows about GDI system calls hooking?
vikramvs
|
|
|
|
|
hi all !
when i compile the "programing windows" example.it is no problem but link it , then it appear such error:
"LINK : fatal error LNK1104: cannot open file "Debug/IconDemo.exe"
and all example are like this . why ??
just for free
|
|
|
|
|
hard to say what is your reason, there could be many:
f.e. read only file (by copy from cd) or program is actualy running
what do you can do with that file using any file manager?
t!
|
|
|
|
|
You are running or debugging the exe
|
|
|
|
|
Hi
I want to get the subitem rect by doing this:
GetSubItemRect(nItem, nSubItem, LVIR_BOUNDS, rect);
This works on VC6, but not on VC5.
Does anyone know how to achieve the same by sendinging message ('LVM_GETSUBITEMRECT')? I tried alot, but didn't work.
Greetings
Jens
|
|
|
|
|
I have Visual Studio 6 with SP5. Everything was working fine, till in order to solve some debug release problems I made a lot of project setting changes (the main project includes some 9 other projects) and checked in the .dsp and .dsw files into CVS for the benefit of others.
What is happening is that everytime I (or someone else) tries to open the project in VC, it takes an inordinately long time (about 5 mins) during which the CPU usage jumps up to 100%.
Whats happening? Any ideas... I can furnish the project files if required.
Life is a b****, so f*** it in the arse
|
|
|
|
|
Hello, can anyone point me to an article or a website that discusses all pitfalls associated with floating point calculations, rounding errors and such? I was reading a book on math for geometric computing yesterday and it said 'the pitfalls when using floating point calculations are well known...' without explaining those pitfalls further; now I know about some problems but I'd like to make sure that I know about all cases, even the obscure ones... Thanks.
|
|
|
|
|
Hi,
recently I did setup a project/workspace for working with Visual C++ IDE. All runs fine and I can edit and start my application, but the build script makes troubles: When I call the build line from IDE all I get is somthing like this:
Building...
Error executing c:\windows\system32\cmd.exe.
There should be much more text displayed, and the build line (calling my Python script) runs perfect when I call it manually at command line.
So I played around and did place the build line into a batch-file. Same result when called from VC6 (yes, it works well when I call the batch-file manually).
Anyone has an idea what's going wrong? Is it a Python problem?
Thanks,
Moak
|
|
|
|
|
Well, it seams to be a Python problem. If you explicitely call python as interpreter it works in any combination (called from VC or manually at command line)
working:
python C:\Development\buildmystuff.py -debug
<br>
NOT working with VC:
C:\Development\buildmystuff.py -debug
Strange, I never mentioned a problem with Perl. However it works.
Moak
|
|
|
|
|
Ok, I know this is really a back to basics question, but I would really appreciate some help.
I am developing a MFC application (mainly to teach myself the whole thing) and I am trying to show a modal dialog box when I click a toolbar button. (SDI program). I get response when I click the button, but the dialog show various errors when I try diffrent approaches I found in source codes on the net. Sometimes it hangs, sometimes it just doesn't show up, but hangs the rest of the app (because it's modal, yes I know). I haven't gotten to the point where I can actually interact with the dialog, as in pushing the command buttons, writing in the edit boxes and such.
The dialog box is a dialog resource template with it's own class CDataEditor, derived from CDialog. In my code, I am mostly trying DoModal() but as you understand, it's not going very well.
Hope you can get me out of this....
|
|
|
|
|
OldViking wrote:
Hope you can get me out of this....
How? You did not show what you were doing when your call to DoModal() gave errors.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|