|
You need to give us more information. The code you are doing looks fine, but it all depends on
when you are "calling" it.
If it is before the framework loads the resource string, then you are too early.
If it is after CMainFrame calls its SetWindowText, then you are too late...
Iain.
|
|
|
|
|
See my reply to Chris L's post. Thanks!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hey Folks,
I have a customer who has one of our applications crashing on his PC, but unfortuantely, I'm unable to replicate here. I managed to get my hands on his DR.WATSON .log which gives plenty of information, but how I do make head/tails of what exactly crashed in my program? I'm able to verify that it is our FTS.EXE that is crashing on his PC, but am I able to pin point it any futher as to maybe a function/line of where the problem occurs?
Any tips you can send would be greatly appreciated... HO HO HO...
Mike.
Here is a snippit of the log <can you="" read="" german?="" ="">:
Anwendungsausnahme aufgetreten:
Anwendung: (pid=288)
Wann: 12/17/2002 @ 17:52:26.609
Ausnahmenummer: c0000005 (Zugriffsverletzung)
*----> Task-Liste <----*
0 Idle.exe
2 System.exe
20 SMSS.exe
24 CSRSS.exe
34 WINLOGON.exe
40 SERVICES.exe
43 LSASS.exe
63 SPOOLSS.exe
71 avsynmgr.exe
94 RPCSS.exe
97 trcboot.exe
114 NMSSvc.exe
119 PSTORES.exe
112 pcs_agnt.exe
131 vsstat.exe
134 mstask.exe
138 vshwin32.exe
135 avconsol.exe
143 webscanx.exe
149 mcshield.exe
190 NDDEAGNT.exe
188 Clntrust.exe
203 NALNTSRV.exe
199 EXPLORER.exe
44 systray.exe
77 PROMon.exe
196 dpmw32.exe
206 nwtray.exe
217 LOADWC.exe
214 NALDESK.exe
219 STARTEAK.exe
197 EM_EXEC.exe
230 wcescomm.exe
236 OSA.exe
194 Printkey2000.ex.exe
99 CLOCK.exe
233 DDHELP.exe
245 CpqEAKSystemTra.exe
247 CPQEADM.exe
249 rundll32.exe
226 BttnServ.exe
211 OUTLOOK.exe
183 MAPISP32.exe
293 oclient.exe
279 inv.exe
288 fts.exe
340 DRWTSN32.exe
0 _Total.exe
(00400000 - 00400000)
(77f70000 - 77fd0000) dll\ntdll.dbg
(77f00000 - 77f62000) dll\kernel32.dbg
(77e70000 - 77ec5000) dll\user32.dbg
(77ed0000 - 77efc000) dll\gdi32.dbg
(77dc0000 - 77dff000) dll\advapi32.dbg
(77e10000 - 77e67000) dll\rpcrt4.dbg
(10000000 - 10000000)
(73060000 - 73078000) drv\winspool.dbg
(77d80000 - 77db3000) dll\comdlg32.dbg
(77c40000 - 77d80000) dll\shell32.dbg
(71700000 - 7178a000) COMCTL32.dbg
(78000000 - 78046000)
(00230000 - 00230000)
(77710000 - 77721000) dll\mpr.dbg
(52180000 - 5218b000) dll\version.dbg
(779b0000 - 779b8000) dll\lz32.dbg
(00270000 - 00270000)
(009b0000 - 009b0000)
(009d0000 - 00a8e000)
(70bd0000 - 70c1c000) SHLWAPI.dbg
(731b0000 - 731ba000) dll\psapi.dbg
(76ae0000 - 76afd000) dll\imagehlp.dbg
(77b80000 - 77c37000) dll\ole32.dbg
(5f300000 - 5f329000) olepro32.dbg
(65340000 - 653d5000) oleaut32.dbg
(77170000 - 77196000) dll\ddraw.dbg
(77fd0000 - 77ffb000) dll\winmm.dbg
(6bc00000 - 6bc10000) ..\..\bin\i386\free\SMNT40.dll
(69f00000 - 69fba000) ..\bin\i386\free\adisynth.dll
(01590000 - 01590000)
(015c0000 - 015c0000)
(11c00000 - 11c00000)
(016e0000 - 016e0000)
(71190000 - 71197000) dll\msidle.dbg
Statusabbild für Thread-ID 0xdc
eax=00000000 ebx=00000001 ecx=0012ffb0 edx=00000001 esi=08098005 edi=00000000
eip=009f3d84 esp=0012f21c ebp=00000001 iopl=0 nv up ei pl zr na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000246
Funktion: <nosymbols>
009f3d5e 745a jz 009f3dba
009f3d60 8b9424300a0000 mov edx,[esp+0xa30] ss:0012fc4c=001f0308
009f3d67 52 push edx
009f3d68 e813600000 call 009f9d80
009f3d6d 8b8424380a0000 mov eax,[esp+0xa38] ss:0012fc54=0012fcc4
009f3d74 83c404 add esp,0x4
009f3d77 3bc5 cmp eax,ebp
009f3d79 753f jnz 009f3dba
009f3d7b 8b84243c0a0000 mov eax,[esp+0xa3c] ss:0012fc58=0012fcc0
009f3d82 8b00 mov eax,[eax] ds:00000000=????????
FEHLER ->009f3d84 39780c cmp [eax+0xc],edi ds:01c7ea06=????????
009f3d87 7531 jnz 009f3dba
009f3d89 8b4820 mov ecx,[eax+0x20] ds:01c7ea06=????????
009f3d8c 81e10000c000 and ecx,0xc00000
009f3d92 81f90000c000 cmp ecx,0xc00000
009f3d98 7520 jnz 009f3dba
009f3d9a f6402c08 test byte ptr [eax+0x2c],0x8 ds:01c7ea06=??
009f3d9e 741a jz 009f3dba
009f3da0 8b9424300a0000 mov edx,[esp+0xa30] ss:0012fc4c=001f0308
009f3da7 8b0d1800a400 mov ecx,[00a40018] ds:00a40018=01660004
009f3dad 55 push ebp
009f3dae 52 push edx
*----> Stack Back Trace <----*
FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
00000001 00000000 00000000 00000000 00000000 00000000 !<nosymbols>
*----> Raw Stack Dump <----*
0012f21c c4 fc 12 00 c0 fc 12 00 - a8 fc 12 00 00 00 00 00 ................
0012f22c 00 00 00 00 00 00 00 00 - 11 00 00 00 00 00 ca 16 ................
0012f23c 00 00 00 00 b0 ff 23 0e - f6 1c e7 77 c1 45 f0 77 ......#....w.E.w
0012f24c 07 04 00 00 00 00 00 00 - 08 f3 12 00 00 00 00 00 ................
0012f25c 04 43 a3 00 ff ff ff ff - 00 00 ca 16 3d 1b e7 77 .C..........=..w
0012f26c 6c 76 9f 00 08 f3 12 00 - 04 43 a3 00 c4 fc 12 00 lv.......C......
0012f27c c0 fc 12 00 a8 fc 12 00 - 00 00 00 00 05 80 09 08 ................
0012f28c 00 00 00 00 00 00 ca 16 - 01 03 00 00 0d 00 00 00 ................
0012f29c ff 00 00 00 78 f3 12 00 - 01 00 00 00 58 f3 12 00 ....x.......X...
0012f2ac 3f 63 00 10 08 03 1f 00 - 00 00 00 00 01 00 00 00 ?c..............
0012f2bc 00 00 00 00 01 00 00 00 - 00 00 00 00 00 00 00 00 ................
0012f2cc 48 f3 12 00 44 f3 12 00 - eb 00 00 00 cf 00 00 00 H...D...........
0012f2dc eb 00 00 00 cf 00 00 00 - 13 04 00 00 2f 03 00 00 ............/...
0012f2ec 95 00 01 00 00 00 00 00 - 00 00 00 00 44 f3 12 00 ............D...
0012f2fc 00 00 00 00 46 00 69 00 - 62 00 65 00 46 00 69 00 ....F.i.b.e.F.i.
0012f30c 62 00 65 00 72 00 20 00 - 54 00 72 00 61 00 6e 00 b.e.r. .T.r.a.n.
0012f31c 73 00 70 00 6f 00 72 00 - 74 00 20 00 53 00 79 00 s.p.o.r.t. .S.y.
0012f32c 73 00 74 00 65 00 6d 00 - 00 00 0c 00 00 00 00 00 s.t.e.m.........
0012f33c 44 f3 12 00 f0 ae 9f 00 - 1a 00 00 00 78 f3 12 00 D...........x...
0012f34c ff 00 00 00 0d 00 00 00 - 08 03 1f 00 84 fb 12 00 ................
|
|
|
|
|
First thing to do: make a release build with debug symbols enabled. Then run it in your debugger and set a breakpoint at address 009f3d68 (significant call) and then step through the next few bytes. Then you know exactly where in your source it crashes. It might not reveal the reason but the location.
Make sure your app relocates to 0x009d0000 by setting the relocation address in the linker settings. (Or just calculate the offset: your app's loadaddress + (0x009f3d68-0x009d0000) = breakpoint)
Also note the NULL return address on the stack. Your stack is gone at this point.
I don't think this is a serious possesion, and the evil most likely comes from your hand. Colin J Davies, The Lounge
|
|
|
|
|
Hi --
I have a simple question about dynamic memory and vectors:
Consider the vector class:
class vector
{
private:
int rows ;
double *vec ;
public:
vector(void) { rows=0 ; vec=0; } // default constructor
vector(int rows) // constructor
{
vec = new double[rows] ;
}
~vector(void) {} ; // destructor
} ;
when i use the class in MAIN() like:
vector* A ;
A = new vector(15) ;
I get an error. It's giving a "null reference error" and saying that the object has not been instantiated..
I don't get what I'm doing wrong?
Thanks
KBL
|
|
|
|
|
I'm confused, are you using the vector class which comes with C++, or writing your own ? A vector is a dynamic array.
You're also not deleting your double * in your destructor.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
i'm writing my own vector class, but using dynamic arrays to do it. as you say, a vector is just a dynamic array, but i thought it was nice to wrap it up in a class so i can do stuff like this in main():
vector* a = new vector(10) ;
a->sort() ;
a->rank() ;
etc..
|
|
|
|
|
KBL wrote:
but i thought it was nice to wrap it up in a class so i can do stuff like this in main():
?How disturbing. I would not do it this way, if you really want to do this I would do two things.
1. I would call it something else, so that the two never clash
2. I would contain a vector and expose the methods to do what I wanted. Then you can use the algorithms that come with the STL instead of writing your own.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
in this case i have some reasons for writing my own. i'm a mathematician/statistician trying to learn c++ (over c and fortran like languages), and i just don't know enough about the efficiency of all the stl functions. i already wrote my functions but now i wanted to wrap the whole thing up in a class.
|
|
|
|
|
The efficiency of STL functions is documented in the standard, plus you have the source code for vector, so you can look for yourself. I certainly respect the desire to write your own as a way to learn. You should make your container expose iterators so you can use the standard algorithms all the same, and you should most certainly not call it 'vector'.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
thanks, that makes alot of sense. i'll take a look at the stl functions.
do you think it's the name clash that gives me problems, or is it the second contructor. should the constructor look like this rather than what i had before (i changed the name to myvector):
myvector(int n)
{ rows=n ;
vec = new double[rows] ;
}
|
|
|
|
|
I doubt the name is the problem, it's more a potential problem. The constructor is a safer bet, the new one looks much better.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
i'll definitely rename it and change my destructor.
|
|
|
|
|
1. Where is the error occurring -- what line?
2. Did you notice that in your second constructor you don't initialize your "rows" member?
3. I recommend that you declare and initialize A in the same line: vector* A = new vector(15) ;. It's less code and it's safer.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
It's occuring the constructor. That is, in the line:
vec = new double[15] ;
|
|
|
|
|
do i need to intialize it in the second constructor when i have it as a member variable in the class?
|
|
|
|
|
so my class should be something like this
class vector
{
private:
int rows ;
double *vec ;
public:
vector(void) { rows=0 ; vec=0; } // default constructor
vector(int n) // constructor
{
rows=n ;
vec = new double[rows] ;
}
~vector(void) {delete vec} ; // destructor
} ;
|
|
|
|
|
is this how you would initialize it:
vector(int n) ;
{
rows=n ;
vec = new double[rows] ;
}
|
|
|
|
|
Other than not setting rows in you second constructor and not deleting vec in your destructor, there is nothing wrong with your code.
I created a simple console app and cut and pasted your code...no errors.
#include "stdafx.h"<br />
<br />
class vector<br />
{ <br />
<br />
private:<br />
int rows ; <br />
double *vec ; <br />
<br />
public: <br />
vector(void) { rows=0 ; vec=0; }
<br />
vector(int rows)
{ <br />
vec = new double[rows] ;<br />
}<br />
<br />
~vector(void) {} ;
<br />
} ;<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
vector* A ; <br />
A = new vector(15) ;<br />
<br />
return 0;<br />
}
just a memory leak
There has to be something else...Is this your entire code?
I think this is a good learning exercise...I would advise you to persue it and not spin your wheels over in STL land;)
Gary Kirkham
A working Program is one that has only unobserved bugs
|
|
|
|
|
Hi --
I have a simple question about dynamic memory and vectors:
Consider the vector class:
class vector
{
private:
rows ;
double *vec ;
public:
vector(void) { rows=0 ; vec=0; } // default constructor
vector(int rows) // constructor
{
vec = new double[rows] ;
}
~vector(void) {} ; // destructor
} ;
when i use the class in MAIN() like:
vector* A ;
A = new vector(15) ;
I get an error. It's giving a "null reference error" and saying that the object has not been instantiated..
I don't get what I'm doing wrong?
Thanks
KBL
|
|
|
|
|
how can one Move to a specific row on a database and not the position like if i want to Move to the data with the primarykey 10 and not the possition 10?i used:
nRow=m_pSet->primarykey;//where primarykey is =10
m_pSet->Move(nRow,SQL_FETCH_BOOKMARK)
but this does not work and SQL_FETCH_ABSOLUTE DOSENT EITHER
would apprecite any suggetions cos am stucked up here
|
|
|
|
|
Hello
I'm not shore on what you want to to but first you hav to make sure on that you can use the bookmark. with function CanBookmark(). To make the bookmark function avalible you must set the CRecordset::useBookmarks option in the dwOptions parameter of the Open member function.
If you are about to update certain fields in the database it is sometimes just as good to launch SQL to the CDatabase object with db.ExecuteSQL(SQL)
Cheers
Henrik
|
|
|
|
|
Hi
i am begginer in Visual C++ and i have a quiestion.
assume that we have an Window. in this Window we have some objects . for example we have 3 ICON in the window. how can i simply Drag one ICON(object) and move it everywhere i want and Drop it.
i don't want to use CImageList because using this Class we can't Drag 2 object altogher and we can Drag 1 image on each Drag-n-Drop operation.
if u want to underStand what i want to do See this Amazing applet :
http://www.seanet.com/users/arsen/avltree.html
in this AMAZING AVL Tree(that uses in DataStructure) u can Simply Drag a Node every where u want and Drop it. u can see that When u Drag a Node all of the Nodes are move altogether.
how can i do that ? Plzzz helpp meeee
Regards
|
|
|
|
|
Hi.
-=Ehsan-de-Burge=- wrote:
i am begginer in Visual C++ and i have a quiestion
How much of a beginner ? Are you experienced with C++ ? If not, you need to forget all this and learn C++ before you worry about this sort of stuff.
-=Ehsan-de-Burge=- wrote:
move it everywhere i want and Drop it.
You need to impiment a window ( to hold the icon ) that knows when it is clicked on and moves itself. Moving is easy, MoveWindow or SetWindowPos will do that.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
i learned C++ for 2 years. and i know Object Oriented Programming.
So u mean that i have to impiment a window for each Icon and place icon in it ?? and move this windows in the main Window ?
Sorry it seems that my knowlege is poor in Visual. but i am Guidable.
thanks anyway
|
|
|
|