|
Trimming usually implies removing from the ends, not the middle.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Ya, that's true. I'm looking that it's possible to trim middle spaces.
And also, I have a similar question. How can I trim a standard string in C++ for the end spaces.
Like this.
"One " trim to "One"
I appreciate your help all the time...
CodingLover
|
|
|
|
|
CodingLover wrote: How can I trim a standard string in C++ for the end spaces.
See here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i want to know the method to work with internet explorer event .i.e when user change url address in address bar then some functionality of my application do the work accordingly in application.If any one have idea about the method for capturing the internet explorer6,7,8 then pls. share your idea.
Thanks.
|
|
|
|
|
How do I add the popup button like MapEditor of Company of Heroes.
Like as below:
http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/wb1.JPG
http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/wb2.JPG
|
|
|
|
|
The error I'm getting:
1>c:\users\john\documents\visual studio 2008\projects\torch\torch\main.cpp(18) : error C2065: 'lpBuffer' : undeclared identifier
I've seen plenty of examples where ReadConsoleInput is setup to read only 1 INPUT_RECORD and then return, but I'm trying to set it up so that if multiple events occur at once, so they will be placed into a vector array instead. The trouble is that everything stops once ReadConsoleInput starts and I have no easy way of referencing the variable to be stored. Here is my code:
#include "includeall.h"
using namespace std;
int main(int argc, char **argv)
{
HANDLE hIn = GetStdHandle(STD_INPUT_HANDLE);
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD NumRead;
BOOL eventloop = FALSE;
vector<INPUT_RECORD>InputRecs;
printf("Welcome to Bloodhound 1.0a (torch).\n");
printf("Press the ESC key at any time to exit.\n");
do
{
X| if(ReadConsoleInput(hIn, InputRecs.push_back(lpBuffer), (DWORD)InputRecs.capacity(), &NumRead) != 0)
{
}
else
{
printf("Unable to read from console error number (%d)", GetLastError());
printf(".\n");
eventloop = FALSE;
}
InputRecs.clear();
}while(eventloop == TRUE);
return 0;
}
Ideas?
|
|
|
|
|
CoffeeAddict19 wrote: Ideas?
Yes. You need to declare lpBuffer .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Im writing a program that is going to store A LOT! of parameters in a temporary ODBC database when running. My question is whenever I start the program or load a new document I need to completely delete the entire database to have a clean slate. Is there an easy way to do this, or do I need to just write a function to go delete everything through row by row. Im still new to MFC and the recordset class and have had problems deleting.
Thanks everyone has really helped me learn a lot on here.
|
|
|
|
|
Cozmo23 wrote: Is there an easy way to do this...
You mean easier than deleting the database file(s)?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You will be using AddNew() method to add the records.which will create huge temp files.
You have to use Insert() function to avoid temp files.
|
|
|
|
|
In my application, in browse dialog box i was doing all sort of random
things.
eg: Create file.
rename file.
visit network folders.
show by list,details,icons.
open unrecognised files etc.
and somewhere my application crashes I am not what is the specific reason
that causes this.
The Report of Process dump is a below.
Report for notepad2696.dmp
Type of Analysis Performed Crash Analysis
Machine Name XYZ
Operating System Windows XP Service Pack 2
Number Of Processors 2
Process ID 2692
Process Image D:\myproj\notepad\nodepad.exe
System Up-Time 01:30:05
Process Up-Time 01:27:36
Thread 0 - System ID 2696
Entry point nodepad+134e56
Create time 2008-07-22 3:01:31 PM
Time spent in user mode 0 Days 0 :4.796
Time spent in kernel mode 0 Days 0 :15.140
Function Arg 1 Arg 2 Arg 3 Source
ole32!CoSetErrorInfo+54 00000000 00000000 001a11c0
ole32!wCoUninitialize+134 0012d9fc 00000000 00163990
ole32!CoUninitialize+5b 001a11c0 0012dac0 00000000
comdlg32!NewGetFileName+24f 00000001 00000001 0012da70
comdlg32!NewGetOpenFileName+f 0012dac0 00000000 001a11c0
comdlg32!GetFileName+35d 0012dac0 763c7705 00000001
comdlg32!GenericGetFileNameA+475 0012ebe4 763c7705 7e41be71
comdlg32!GetOpenFileNameA+23 0012ebe4 00000001 0012f36c
mfc42!CFileDialog::DoModal+96 00547820 00354c50 73dd25e8
Broker+233b9 0012f36c 00000234 00000000
mfc42!CCmdTarget::OnCmdMsg+10a 00000234 00000000 00000000
mfc42!CPropertySheet::OnCmdMsg+1d 00000234 00000000 00000000
mfc42!CWnd::OnCommand+53 00000000 00030446 0012f36c
mfc42!CWnd::OnWndMsg+2f 00000111 00000234 00030446
mfc42!CWnd::WindowProc+24 00000111 00000234 00030446
mfc42!AfxCallWndProc+91 0012f36c 00000000 00000111
mfc42!AfxWndProc+36 0005040e 00000111 00000234
mfc42!AfxWndProcBase+39 0005040e 00000111 00000234
user32!InternalCallWinProc+28 73e68444 0005040e 00000111
user32!UserCallWinProcCheckWow+150 00000000 73e68444 0005040e
user32!SendMessageWorker+4a5 00816a30 007b0960 00000234
user32!SendMessageW+7f 0005040e 00000111 00000234
user32!xxxButtonNotifyParent+41 00816fd8 00000000 00816fd8
user32!xxxBNReleaseCapture+f8 00193b98 00000001 00000000
user32!ButtonWndProcWorker+6d5 00816fd8 00000202 00000000
user32!ButtonWndProcA+5d 00030446 00000202 00000000
user32!InternalCallWinProc+28 7e43affe 00030446 00000202
user32!UserCallWinProcCheckWow+150 00000000 7e43affe 00030446
user32!DispatchMessageWorker+306 0058decc 00000000 0012f278
user32!DispatchMessageW+f 0058decc 0058decc 0058ded4
user32!IsDialogMessageW+572 0005040e 00816fd8 0058decc
user32!IsDialogMessageA+fd 0005040e 0058decc 0012f36c
mfc42!CWnd::IsDialogMessageA+31 0058decc 73de675a 0058decc
mfc42!CWnd::PreTranslateInput+29 0058decc 0058decc 0005040e
mfc42!CDialog::PreTranslateMessage+96 0058decc 0058decc 00c70ed0
mfc42!CWnd::WalkPreTranslateTree+21 000301ba 0058decc 0058de98
mfc42!CWinThread::PreTranslateMessage+31 0058decc 00000000
0012f36c
mfc42!CWinThread::PumpMessage+2a 00000004 0012f36c 0012f354
mfc42!CWnd::RunModalLoop+d9 00000004 7e41b72f 00c7c970
mfc42!CDialog::DoModal+e8 0012f45c 00c7c970 00547340
Broker+1ef11 00000000 00000001 00020466
user32!NtUserCallOneParam+c 00000000 0000bd11 00000000
mfc42!CCmdTarget::OnCmdMsg+df 00000000 00000000 00000000
mfc42!CWnd::ReflectChildNotify+6f 00537c21 00000002 73dd24c0
0x0012f574 0012f5c8 7e440457 7e418830
mfc42!AfxUnlockGlobals+1e 00000000 00020466 00c7c970
mfc42!CWnd::OnWndMsg+2f 00000111 00000193 00020466
mfc42!CWnd::WindowProc+24 00000111 00000193 00020466
mfc42!AfxCallWndProc+91 00c7c970 00000000 00000111
mfc42!AfxWndProc+36 00080426 00000111 00000193
mfc42!AfxWndProcBase+39 00080426 00000111 00000193
user32!InternalCallWinProc+28 73e68444 00080426 00000111
user32!UserCallWinProcCheckWow+150 00000000 73e68444 00080426
user32!SendMessageWorker+4a5 008160f0 007b0960 00000193
user32!SendMessageW+7f 00080426 00000111 00000193
user32!xxxButtonNotifyParent+41 00816358 00000000 00816358
user32!xxxBNReleaseCapture+f8 00161bc0 00000001 00000000
user32!ButtonWndProcWorker+6d5 00816358 00000202 00000000
user32!ButtonWndProcA+5d 00020466 00000202 00000000
user32!InternalCallWinProc+28 7e43affe 00020466 00000202
user32!UserCallWinProcCheckWow+150 00000000 7e43affe 00020466
user32!CallWindowProcAorW+98 7e43affe 00020466 00000202
user32!CallWindowProcA+1b 7e43affe 00020466 00000202
mfc42!CWnd::DefWindowProcA+44 00000202 00000000 000b0041
mfc42!CWnd::WindowProc+3b 00000202 00000000 000b0041
mfc42!AfxCallWndProc+91 00c7cad8 00000000 00000202
mfc42!AfxWndProc+36 00020466 00000202 00000000
mfc42!AfxWndProcBase+39 00020466 00000202 00000000
user32!InternalCallWinProc+28 73e68444 00020466 00000202
user32!UserCallWinProcCheckWow+150 00000000 73e68444 00020466
user32!DispatchMessageWorker+306 0058decc 00000000 0012fb08
user32!DispatchMessageW+f 0058decc 0058decc 0058ded4
user32!IsDialogMessageW+572 00080426 00816358 0058decc
user32!IsDialogMessageA+fd 00080426 0058decc 00c7c970
mfc42!CWnd::IsDialogMessageA+31 0058decc 73de675a 0058decc
mfc42!CWnd::PreTranslateInput+29 0058decc 0058decc 00c7c970
mfc42!CDialog::PreTranslateMessage+96 0058decc 0058decc 00080426
Broker+1f398 0058decc 0058decc 00c70ed0
mfc42!CWnd::WalkPreTranslateTree+21 000301ba 0058decc 0058de98
mfc42!CWinThread::PreTranslateMessage+31 0058decc 00000000
00c77060
mfc42!CWinThread::PumpMessage+2a 00000004 00c77060 0012fbf4
mfc42!CWnd::RunModalLoop+d9 00000004 00c70ed0 0058de98
mfc42!CDialog::DoModal+e8 00000000 00c77060 0012fc84
Broker+185f 0000193b 00000000 00545f10
mfc42!CWnd::WindowProc+24 0000193b 00000000 00000000
mfc42!AfxCallWndProc+91 00c70ed0 00000000 0000193b
mfc42!AfxWndProc+36 000301ba 0000193b 00000000
mfc42!AfxWndProcBase+39 000301ba 0000193b 00000000
user32!InternalCallWinProc+28 73e68444 000301ba 0000193b
user32!UserCallWinProcCheckWow+150 00000000 73e68444 000301ba
user32!DispatchMessageWorker+306 0058decc 00000001 0058decc
user32!DispatchMessageA+f 0058decc 00000000 00c70ed0
mfc42!CWinThread::PumpMessage+3c 00000004 00c70ed0 0012fed0
mfc42!CWnd::RunModalLoop+d9 00000004 00c910d0 0058de98
mfc42!CDialog::DoModal+e8 0058de98 0058de98 0012ffc0
Broker+177c 0035f9cc 00c3d76c 00c3d6ac
0x00c3da14 00c3d76c 00c3d6ac 00c7e9e8
0x0035f9cc 00c3d6ac 00c7e9e8 00c67c24
0x00c3d76c 0008013d 0035f9c8 1001cc10
0x00020003 00000000 00000000 1009676c
OLE32!COSETERRORINFO+54In notepad2696.dmp the assembly instruction at
ole32!CoSetErrorInfo+54 in C:\WINDOWS\system32\ole32.dll from Microsoft
Corporation has caused an access violation exception (0xC0000005) when
trying to read from memory location 0x01c92a58 on thread 0
Module Information
Image Name: C:\WINDOWS\system32\ole32.dll Symbol Type: PDB
Base address: 0x774e0000 Time Stamp: Tue Jul 26 10:09:47 2005
Checksum: 0x0013dc6b Comments:
COM DLL: True Company Name: Microsoft Corporation
ISAPIExtension: False File Description: Microsoft OLE for Windows
ISAPIFilter: False File Version: 5.1.2600.2726 (xpsp_sp2_gdr.050725-1528)
Managed DLL: False Internal Name: OLE32.DLL
VB DLL: False Legal Copyright: C Microsoft Corporation. All rights
reserved.
Loaded Image Name: ole32.dll Legal Trademarks:
Mapped Image Name: Original filename: OLE32.DLL
Module name: ole32 Private Build:
Single Threaded: False Product Name: MicrosoftR WindowsR Operating
System
Module Size: 1.24 MBytes Product Version: 5.1.2600.2726
Symbol File Name:
c:\symcache\ole32.pdb\683B65B246F4418796D2EE6D4C55EB112\ole32.pdb Special
Build: &
Can anyone suggest why this would have happened and how to solve the
problem.
Thanks in advance
|
|
|
|
|
How are you creating the "browse dialog?" Does the "crash" happen while that dialog is open, or after it is dismissed?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
This is how i create the browse dialog box.
void CBrowseDlg::OnBrowse[]
[
CFileDialog objFileDlg[TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, NULL];
if(IDOK == objFileDlg.DoModal[]]
[
//update the filename and pass phrase
m_csPvtKeyFile = objFileDlg.GetPathName[];
UpdateData[FALSE];
]
]
The Crash had happened while dialog box was open. I am unable to simulate this type of crash again. fortunately i had the process dump running.
Does this way of creating file dialog inherently has some problem.
or the Error is related to type of operation I do which is similar to browsing in My Computer, which i cannot do anything about.
Apparently I had seen some discussion on similar kind of problem which was solved by window hotfix
http://www.bokebb.com/dev/english/1960/posts/196055272.shtml
While trying to replicate the problem I had come across another crash in the browse dialog box.
which seems to be related to the winzip.dll
Analysis Summary
Type:
Error
Description :
WARNING - DebugDiag was not able to locate debug symbols for WZSHLEX1.DLL, so the information below may be incomplete.
In notepad2912.dmp the assembly instruction at WZSHLEX1+1028 in C:\Program Files\WinZip\WZSHLEX1.DLL from WinZip Computing, Inc. has caused an access violation exception (0xC0000005) when trying to read from memory location 0x01c906cb on thread 0
Please follow up with the vendor WinZip Computing, Inc. for C:\Program Files\WinZip\WZSHLEX1.DLL
Recommendation :
Information DebugDiag determined that this dump file (notepad2912.dmp) is a crash dump and did not perform any hang analysis. If you wish to enable combined crash and hang analysis for crash dumps, edit the CrashHangAnalysis.asp script (located in the DebugDiag\Scripts folder) and set the g_DoCombinedAnalysis constant to True.
Analysis Details
Table Of Contents
notepad2912.dmp
Faulting Thread
Faulting Module Information
Report for notepad2912.dmp
Report for notepad2912.dmp
Type of Analysis Performed Crash Analysis
Machine Name XYZ
Operating System Windows XP Service Pack 2
Number Of Processors 2
Process ID 2908
Process Image E:\myproj\notepad.exe
System Up-Time 00:50:44
Process Up-Time 00:37:15
Thread 0 - System ID 2912
Entry point notepad!WinMainCRTStartup
Create time 2008-07-23 10:49:36 AM
Time spent in user mode 0 Days 0 :4.843
Time spent in kernel mode 0 Days 0 :15.15
Function Arg 1 Arg 2 Arg 3 Source
WZSHLEX1+1028 001522a8 0019c788 00000003
shell32!HDXA_AppendMenuItems+44 001522a8 0019c788 00000003
shell32!CFSDropTarget::_DragDropMenu+9c 001522a8 001e76e8 001e7660
shell32!CFSDropTarget::Drop+119 001d8fb0 0019c788 00000000
shell32!CDVDropTarget::Drop+f4 0019c788 00000000 00000178
shell32!CDefView::Drop+1f 001e7670 0019c788 00000000
ole32!CInterfaceFromWindowProp::PrivDragDrop+cd 0018ae08 00000000 00000000
ole32!PrivDragDrop+97 003409ba 00000004 028093d0
ole32!CDropTarget::Drop+4e 028162f8 0019c788 00000000
ole32!CDragOperation::CompleteDrop+3e 0019c788 028093d0 00190aa8
ole32!DoDragDrop+ab 0019c788 00190aa8 00000007
shell32!SHDoDragDrop+7e 001803b4 0019c788 00190aa8
shell32!CDefView::_OnBeginDrag+f1 0019c788 0012d10c 001e7660
shell32!CDefView::_OnLVNotify+5e8 0012d10c 001e7660 001e7660
shell32!CDefView::_OnNotify+7c 0012d10c 00000000 001e7660
shell32!CDefView::WndProc+860 00520a18 0000004e 00000001
shell32!CDefView::s_WndProc+72 00520a18 0000004e 00000001
user32!InternalCallWinProc+28 7c9f1f2f 00520a18 0000004e
user32!UserCallWinProcCheckWow+150 0015a308 7c9f1f2f 00520a18
user32!SendMessageWorker+4a5 008f17a8 008cd870 00000001
user32!SendMessageW+7f 00520a18 0000004e 00000001
comctl32_773d0000!CCSendNotify+c20 001864c0 ffffff93 0012d10c
comctl32_773d0000!ListView_HandleMouse+2d8 003409ba 00000000 0000002c
comctl32_773d0000!ListView_OnButtonDown+1b 001864c0 00000000 0000002c
comctl32_773d0000!ListView_WndProc+857 003409ba 00000201 00000001
user32!InternalCallWinProc+28 77420c82 003409ba 00000201
user32!UserCallWinProcCheckWow+150 0015a308 77420c82 003409ba
user32!DispatchMessageWorker+306 0012d43c 00000000 0012d420
user32!DispatchMessageW+f 0012d43c 00000000 0087c3f8
user32!IsDialogMessageW+572 001803b4 008ec930 00040a06
user32!DialogBox2+144 001803b4 00040a06 00000010
user32!InternalDialogBox+d0 763b0000 001a8a58 00040a06
user32!DialogBoxIndirectParamAorW+37 763b0000 001a8a58 00040a06
user32!DialogBoxIndirectParamW+1b 763b0000 001a8a58 00040a06
comdlg32!NewGetFileName+240 00000000 00000001 0012d548
comdlg32!NewGetOpenFileName+f 0012d598 00000000 001b9ee8
comdlg32!GetFileName+35d 0012d598 763c7705 0012e878
comdlg32!GenericGetFileNameA+475 0012e6dc 763c7705 0012e65c
comdlg32!GetOpenFileNameA+23 0012e6dc 0012e878 00158ee0
MFC42D!CFileDialog::DoModal+1ac 0012eb24 cccccccc cccccccc
notepad!CConfigProfKey::OnBrowse+8b 0012eb24 00158ee0 00000000
MFC42D!_AfxDispatchCmdMsg+a2 0012f014 00000234 00000000
MFC42D!CCmdTarget::OnCmdMsg+274 00000234 00000000 00000000
MFC42D!CDialog::OnCmdMsg+24 00000234 00000000 00000000
MFC42D!CWnd::OnCommand+138 00000234 000909a2 0012eb24
MFC42D!CWnd::OnWndMsg+53 00000111 00000234 000909a2
MFC42D!CWnd::WindowProc+2e 00000111 00000234 000909a2
MFC42D!AfxCallWndProc+ed 0012f014 00040a06 00000111
MFC42D!AfxWndProc+81 00040a06 00000111 00000234
MFC42D!AfxWndProcBase+4a 00040a06 00000111 00000234
user32!InternalCallWinProc+28 5f490453 00040a06 00000111
user32!UserCallWinProcCheckWow+150 00000000 5f490453 00040a06
user32!SendMessageWorker+4a5 008f0ae0 008c6540 00000234
user32!SendMessageW+7f 00040a06 00000111 00000234
user32!xxxButtonNotifyParent+41 008f0458 00000000 008f0458
user32!xxxBNReleaseCapture+f8 00180fd8 00000001 00000000
user32!ButtonWndProcWorker+6d5 008f0458 00000202 00000000
user32!ButtonWndProcA+5d 000909a2 00000202 00000000
user32!InternalCallWinProc+28 7e43affe 000909a2 00000202
user32!UserCallWinProcCheckWow+150 00000000 7e43affe 000909a2
user32!DispatchMessageWorker+306 0060d000 00000000 0012ee84
user32!DispatchMessageW+f 0060d000 0060d000 0060d008
user32!IsDialogMessageW+572 00040a06 008f0458 0012f0f4
user32!IsDialogMessageA+fd 00040a06 0060d000 0012f0f4
MFC42D!CWnd::IsDialogMessageA+7b 0060d000 0012f0f4 00158ee0
MFC42D!CWnd::PreTranslateInput+75 0060d000 0012f0f4 00158ee0
MFC42D!CDialog::PreTranslateMessage+f8 0060d000 0012f0f4 00158ee0
MFC42D!CWnd::WalkPreTranslateTree+98 0001077c 0060d000 0060cfc8
MFC42D!CWinThread::PreTranslateMessage+55 0060d000 0012f0f4 00158ee0
MFC42D!CWinThread::PumpMessage+e2 0012f0f4 00158ee0 00000000
MFC42D!CWnd::RunModalLoop+202 00000004 0012f0f4 00158ee0
MFC42D!CDialog::DoModal+191 0012f3a0 00158ee0 cccccccc
notepad!CConfigProfAuthDlg::OnUnsave+1fb 0012f3a0 00158ee0 00000000
MFC42D!_AfxDispatchCmdMsg+a2 00bd5dc0 00000193 00000000
MFC42D!CCmdTarget::OnCmdMsg+274 00000193 00000000 00000000
MFC42D!CDialog::OnCmdMsg+24 00000193 00000000 00000000
MFC42D!CWnd::OnCommand+138 00000193 000509e2 0012f3a0
MFC42D!CWnd::OnWndMsg+53 00000111 00000193 000509e2
MFC42D!CWnd::WindowProc+2e 00000111 00000193 000509e2
MFC42D!AfxCallWndProc+ed 00bd5dc0 000b0984 00000111
MFC42D!AfxWndProc+81 000b0984 00000111 00000193
MFC42D!AfxWndProcBase+4a 000b0984 00000111 00000193
user32!InternalCallWinProc+28 5f490453 000b0984 00000111
user32!UserCallWinProcCheckWow+150 00000000 5f490453 000b0984
user32!SendMessageWorker+4a5 008eaf28 008c6540 00000193
user32!SendMessageW+7f 000b0984 00000111 00000193
user32!xxxButtonNotifyParent+41 008f0c68 00000000 008f0c68
user32!xxxBNReleaseCapture+f8 00163f80 00000001 00000000
user32!ButtonWndProcWorker+6d5 008f0c68 00000202 00000000
user32!ButtonWndProcA+5d 000509e2 00000202 00000000
user32!InternalCallWinProc+28 7e43affe 000509e2 00000202
user32!UserCallWinProcCheckWow+150 00000000 7e43affe 000509e2
user32!CallWindowProcAorW+98 7e43affe 000509e2 00000202
user32!CallWindowProcA+1b 7e43affe 000509e2 00000202
MFC42D!CWnd::DefWindowProcA+32 00000202 00000000 00100005
MFC42D!CWnd::WindowProc+4c 00000202 00000000 00100005
MFC42D!AfxCallWndProc+ed 00bd5f28 000509e2 00000202
MFC42D!AfxWndProc+81 000509e2 00000202 00000000
MFC42D!AfxWndProcBase+4a 000509e2 00000202 00000000
user32!InternalCallWinProc+28 5f490453 000509e2 00000202
user32!UserCallWinProcCheckWow+150 00000000 5f490453 000509e2
user32!DispatchMessageWorker+306 0060d000 00000000 0012f8f4
user32!DispatchMessageW+f 0060d000 0060d000 0060d008
user32!IsDialogMessageW+572 000b0984 008f0c68 0012fa78
user32!IsDialogMessageA+fd 000b0984 0060d000 0012fa78
MFC42D!CWnd::IsDialogMessageA+7b 0060d000 0012fa78 0012fa84
MFC42D!CWnd::PreTranslateInput+75 0060d000 0012fa78 0012fa84
MFC42D!CDialog::PreTranslateMessage+f8 0060d000 00bd5dc0 0012f9a8
notepad!CConfigProfAuthDlg::PreTranslateMessage+56 0060d000 0012fa78 0012fa84
MFC42D!CWnd::WalkPreTranslateTree+98 0001077c 0060d000 0060cfc8
MFC42D!CWinThread::PreTranslateMessage+55 0060d000 0012fa78 0012fa84
MFC42D!CWinThread::PumpMessage+e2 0012fa78 0012fa84 00000000
MFC42D!CWnd::RunModalLoop+202 00000004 0012fa78 0012fa84
MFC42D!CDialog::DoModal+191 0012fc40 00158ee0 cccccccc
notepad!CnotepadApp::OnAppConfiguration+fa 00bcdd10 0012fbc0 5f42f2ac
notepad!CBlockerDlg::OpenCnotepadDlg+18 00000000 00000000 0012fc40
MFC42D!CWnd::OnWndMsg+69a 0000193b 00000000 00000000
MFC42D!CWnd::WindowProc+2e 0000193b 00000000 00000000
MFC42D!AfxCallWndProc+ed 00bcdd10 0001077c 0000193b
MFC42D!AfxWndProc+81 0001077c 0000193b 00000000
MFC42D!AfxWndProcBase+4a 0001077c 0000193b 00000000
user32!InternalCallWinProc+28 5f490453 0001077c 0000193b
user32!UserCallWinProcCheckWow+150 00000000 5f490453 0001077c
user32!DispatchMessageWorker+306 0060d000 00000001 0012fdd0
user32!DispatchMessageA+f 0060d000 0012fedc 0012fe74
MFC42D!CWinThread::PumpMessage+100 0012fedc 0012fe74 7ffd5000
MFC42D!CWnd::RunModalLoop+202 00000004 0012fedc 0012fe74
MFC42D!CDialog::DoModal+191 00000000 7c91d496 00bcdd10
notepad!CnotepadApp::InitInstance+419 00000000 7c91d496 7ffd5000
MFC42D!AfxWinMain+83 00400000 00000000 001523af
notepad!WinMain+18 00400000 00000000 001523af
notepad!WinMainCRTStartup+1b3 00000000 7c91d496 7ffd5000
kernel32!BaseProcessStart+23 005a4440 00000000 00905a4d
WZSHLEX1+1028WARNING - DebugDiag was not able to locate debug symbols for WZSHLEX1.DLL, so the information below may be incomplete.
In notepad2912.dmp the assembly instruction at WZSHLEX1+1028 in C:\Program Files\WinZip\WZSHLEX1.DLL from WinZip Computing, Inc. has caused an access violation exception (0xC0000005) when trying to read from memory location 0x01c906cb on thread 0
Module Information
Image Name: C:\Program Files\WinZip\WZSHLEX1.DLL Symbol Type: Export
Base address: 0x16250000 Time Stamp: Wed Apr 19 23:03:41 2000
Checksum: 0x00000000 Comments: StringFileInfo: U.S. English
COM DLL: True Company Name: WinZip Computing, Inc.
ISAPIExtension: False File Description: WinZip Shell Extension DLL
ISAPIFilter: False File Version: 3.0 (32-bit)
Managed DLL: False Internal Name: WZSHLEXT.DLL
VB DLL: False Legal Copyright: Copyright (c) WinZip Computing, Inc. 1991-2000 - All Rights Reserved
Loaded Image Name: WZSHLEX1.DLL Legal Trademarks: WinZip is a registered trademark of WinZip Computing, Inc
Mapped Image Name: C:\Program Files\WinZip\WZSHLEX1.DLL Original filename: WZSHLEXT.DLL
Module name: WZSHLEX1 Private Build:
Single Threaded: False Product Name: WinZip
Module Size: 152.00 KBytes Product Version: 8.0 (3081)
Symbol File Name: WZSHLEX1.DLL Special Build: &
|
|
|
|
|
Why are you using [] instead of () and {}? Other than that, your code snippet worked fine for me.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The problem is solved after patching the OS with microsoft hotfixes
|
|
|
|
|
Hello all,
I got debug assertion error in afxwin2.inl line no. 197. When I inspect this I found that the error occur after I use SetTimer(1,100,NULL);. I have correct message map for Timer and proper function for timer event but I dont know what is the problem is, please help me.
SetTimer(1,100,NULL);
ON_WM_TIMER()
afx_msg void OnTimer(UINT nIDEvent);
void Test::OnTimer(UINT nIDEvent)
{
if(nIDEvent==1)
{
if(flag41==1)
{
Disconnect();
}
}
}
|
|
|
|
|
What is line 197 of afxwin2.inl asserting?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'm guessing you're calling SetTimer() before your window's HWND is created.
Where do you call SetTimer() from?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Dear Mark,
I call SetTimer from a function a function defined by me (user defined). The Window is created before calling the SetTimer().
Please advice.
|
|
|
|
|
bhanu_8509 wrote: I got debug assertion error in afxwin2.inl line no. 197
There's no guarantee that line 197 of "afxwin2.inl" is the same in two different versions of MFC. Always look at the assert, as in general there'll be a comment near the assertion that explains what's going wrong. If that fails to help post some of the code around the actual assert.
Steve
|
|
|
|
|
Dear friends,
> mfc80d.dll!CWnd::SetTimer(unsigned int nIDEvent=1, unsigned int nElapse=100, void (HWND__ *, unsigned int, unsigned int, unsigned long)* lpfnTimer=0x00000000) Line 197 + 0x2b bytes C++
The above is the info when I access the SetTimer function. The info is obtained from STACK. The line in afxwin2.inl is below:
{ ASSERT(::IsWindow(m_hWnd)); return ::SetTimer(m_hWnd, nIDEvent, nElapse,
lpfnTimer); }
Please advice and help me.
|
|
|
|
|
Looks like Mark was on the right path when he said, "I'm guessing you're calling SetTimer() before your window's HWND is created."
The ASSERT fires because IsWindow returned FALSE . This indicates that the HWND isn't valid. What is the value of the m_hWnd member?
Steve
|
|
|
|
|
Dear Steve and Mark,
For the m_hWnd ,the value is NULL. When I inspect the variable, I have the following value.
CXX0030: Error: expression cannot be evaluated
Please advice.
|
|
|
|
|
Looks like you haven't created the window yet (as Mark said). See the CWnd::Create[^] function and its friends.
Steve
|
|
|
|
|
Dear Steve,
I am creating a Window from my own class like below. The window is created properly. I can see the window also. Please advice.
m_pWnd1 = new CMywnd1;
if(!m_pWnd1->CreateEx(NULL,
AfxRegisterWndClass(NULL,0,
(HBRUSH)::GetStockObject(BLACK_BRUSH),0),
LPCTSTR(""), WS_POPUP | WS_VISIBLE | WS_SYSMENU ,
115,51,600,405,my_hWnd1,NULL,NULL))
return;
my_hWnd1 = m_pWnd1->GetSafeHwnd();
|
|
|
|