|
A breakpoint is reported to the debugger by raising a STATUS_BREAKPOINT exception, code 0x80000003. If the debugger is not expecting it (i.e. there is no breakpoint on that instruction), it will report the exception to the user.
The system's heap manager will generate such an exception if it discovers, on freeing a block, that the block has become corrupted. I suggest using the gflags utility to enable page granularity heap allocations, where the heap manager allocates two pages per heap allocation. The first page contains your allocated block (allocated at the end of the page), and the second page is marked no access. When you overflow a heap buffer, you get an immediate access violation at that point.
IIRC, the heap manager by default only does heap checking if the executable image has the DEBUG flag in the header. VC's linker adds the DEBUG flag for a debug build.
To set up gflags , run it as an administrator, enter the name of your executable in the 'Image File Name' box, then choose the 'Image File Options' radio button. Check the 'Enable page heap' box and click OK.
|
|
|
|
|
Ok I did that and it gave me an access violation. Doesn't really help me though. First off I'm not real good at debugging, so unless its an obvious problem, doing something like you suggested doesn't help me much.
It's still the same thing that's causing it. When I try disconnecting from a database from my dll. It really doesn't make any sense to me. It worked before when I opened and closed the database from within an exported function. Then I decided it was a waste of resources to open and close each time I wanted to access it. So I declared a global instance of a CDatabase class.
I connect once at program initialization and then call disconnect at close. Seemed pretty simple to me, but now its throwing an exception for no apparent reason. The only solution I can think of is to go back to the old way of opening and closing the DB each time I access it.
Mike
|
|
|
|
|
I found a simple bug in VS.NET 2003 for C++...
the following cout statement
cout << "tetete??(tete";
would print
tetete[tete
It appears that it translates ??( as a square bracket....
My regional settings are English (US) .Just wanted to share this.
take care
|
|
|
|
|
That's not a bug. There are certain three character combinations (or trigraphs), all of which begin '??' which then map to a single character during a compile.
This is so you can write C (or C++) code even if your character set doesn't have # [ \ ] ^ { | } or ~
Steve S
|
|
|
|
|
I use the HTMLHelp API to display the compiled HTML help file (.chm) in VC++ 6.0. It works fine. But when I try to run the same source code under .net environment, the compiler complains that the HTMLHelp does not take four argument. I thought that the VS .net 2003 converts my VC++ 6.0 project to VC++ .net automatally. But it seems not the case. Basically I want to display my help.chm file in my VC++ application in .net. Thanks for the help.
Hei Lam
|
|
|
|
|
It's me again! May I know how I can change the size of the console window using VC++ 6.0? I understand I can change it manually at the console window, but is it possible to do such coding? Thank you!
|
|
|
|
|
My program calls AsfCut.exe using the CConsolePipe class available here. But, asfcut is returning an error, and when my error-handling code starts (in the app's main thread, called using SendMessage from the asfcut-calling thread) it does "char *tmp = new char[350];", which returns this exception:
Unhandled exception at 0x77e73887 in IGCProcessor.exe: Microsoft C++ exception: std::bad_alloc @ 0x00116b04.
I have plenty of memory available, and my program is only using about 3mb according to Task Manager, so what in the world could be causing that exception?
|
|
|
|
|
I've found out that even calling "char *tmp = new char[xxx];" right after calling "myConsole->Execute(cmdLine);" crashes, though with a access violation at 0x000000 in strlen. Weird
|
|
|
|
|
Nevermind, there was a buffer overrun on a char array in Execute() . Not sure why it didn't give me a more informative error message, though
|
|
|
|
|
If anyone has experience using InstallShield Developer, I've posted a request for information on my forum here[^]. Thanks for your help.
Software Zen: delete this;
|
|
|
|
|
Hey I need help I am going to make a program in Visual C++ V6. I am ok at dialog based programs but I need this one to have the look, or layout of the well, like front page, or more or less the way microsoft visual c++ is laid out. One split panel on the left. One split panel on the bottom, and a place for documents in the middle. I want to be able to refrence a data base and I want to use dlls as much as posible for add ons and upgrades. I am not sure when starting the New MFC project, which one I should select. I know to go for a multiple document thing, but as far as the rest of the choices are concerened I am not sure. I want to make sure I am starting in the right place though, so can someone help me here?
Thanks
LOSTTWARE.com
|
|
|
|
|
Just go with an MFC exe file and select MDI. Use full database support when prompted.
BTW - Your site was asking about how to to better promote itself. I would suggest posting programming questions to hi-traffic programming sites and using your domain name as your username.
BTW2 - The technique of sending yourself a letter via certified mail to prove that you thought of an idea first doesn't work because you can send yourself an unsealed envelope that can be filled with whatever idea you want to rip-off and seal it long after you sign for it.
BTW3 - You don't even have Code Project listed as a programming resource on your link list.
|
|
|
|
|
RE to BTW2:
I have used it, and it did work, on a copyright.
RE to BTW3:
I have not added them, because I just found them.
LOSTTWARE.com
|
|
|
|
|
LOSTTWARE.com wrote:
RE to BTW2:
I have used it, and it did work, on a copyright.
Seems strange. I mean, I could send myself an empty envelope now and next year fill it with whatever new idea just popped up, seal it, and then say I thought of it first.
|
|
|
|
|
Hi,
I want to add bitmap to resources of win32 dll file. I know, that I can use UpdateResource function to do it, but I don't know in what format should the passed data be. Whole .bmp file or something else ?
Thanks
|
|
|
|
|
|
Hi,
Anybody know how to develop MSN Addins using VC++, I want to develop an addin for MSN 6.0, I need basic understandig of MSN Addins.
Thanks in Advance
Waqar.
|
|
|
|
|
I have a VC++ Dialog App and
1. want the Dialog not be be moved . ie i want to disable moving the window !
2. If i make the main window movable how should I position the PropertySheet contained within .
Assuming I have code like this
void CCamProgrammerDlg::OnMove(int x, int y)
{
CDialog::OnMove(x, y);
if(propertySheetCreated){
CRect r ;
this->GetWindowRect(&r);
mainSheet.SetWindowPos(0,r.left,r.top+30,r.Width(),r.Height()-75,0);
}
What I am asking is
I hate to hardcode the offsets .
I want the PropertySheet right below the Title bar of the mainWindow even after the main window moves
____________________________________________________
|__Main Window Title Bar __________________________|
|__PropertySheet Title bar___________________________|
|_Tab1_|Tab2__| |
| |
| |
| PROPERTYSHEET + MAIN WND AREA |
| |
| |
| |
|____________________________________________________| | |
| |
| |
| |
| |
| MAIN WINDOW AREA |
| |
| |
| |
|____________________________________________________|
3. IS it possible to create a PropertySheet without a Title Bar but not as a Child !
Engineering is the effort !
|
|
|
|
|
I will answer 1.
Handle OnNcHitTest and tell the system the mouse click was on the client area when it is actual
hit on the caption. Here is the code
<br />
UINT CMyDlg::OnNcHitTest(CPoint point) <br />
{<br />
UINT ret = CDialog::OnNcHitTest(point);<br />
if(ret == HTCAPTION ) return HTCLIENT;<br />
else return ret;<br />
<br />
}<br />
|
|
|
|
|
I would like to export mfc derived classes such as CDialogs in a regular DLL statically linked to MFC) to a plain Win32 application. Or to rephrase this question, if I have an app that uses MFC, instead of dynamically linking to a MFC lib, can I dynamically link to a DLL, that is already statically linked to MFC?
Because of redist issues, I need to statically link to MFC. I presently have several apps, whose overlapping functionality I'd like to consolidate into a single DLL. I understand that there are Extension DLLs, but this doesn't help me because it seems to require dynamic linking to MFC for both DLL and app.
TIA
Francis
|
|
|
|
|
francona wrote:
instead of dynamically linking to a MFC lib, can I dynamically link to a DLL, that is already statically linked to MFC?
Its been a long time since I have touched MFC, but if I recall correctly, the answer is no.
|
|
|
|
|
Hello,
Is there a way to generate an ASP page from an ISAPI dll ?
I want to protect my ASP pages without having to develop in C++ all the stuff again.
Thanks.
|
|
|
|
|
I posted a question earlier asking how I can read all files in an user specified directory. Thanks for all the answers.
However, I'm wondering if it's possible to read or check the file type (eg. .txt, .doc, or a folder) as well?? Thanks for any help.
|
|
|
|
|
Well, a file's type and its extension are not necessarily indictive of the other. In other words, I can create a .DOC file with Word, and change the extension to .XYZ. Now what do I have?
You can determine if a given entity is a folder or not by looking at the attrib member of the _finddata_t structure mentioned earlier. You can also look at the dwFileAttributes member of the WIN32_FIND_DATA structure.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Yeah, that's true. The extension can be changed. So, I guess I will have to write a function to check that, assuming the file extensions are correct.
I am using the attrib member of the _finddata_t structure. It turns out that a folder is 16 whereas a .txt is 32 or 33.
Can you please tell me what those numbers represent?!
Thanks.
|
|
|
|