|
I suspect that something is overrunning the end of the array. In debug mode the memory allocator adds padding bytes at the start and end of each memory block allocated. Here it looks like something has written to one of those blocks - while this may be safe in debug mode (apart from giving this warnings), it is likely to prove fatal in release mode. You should check each use of the dataArray, and make sure that none of them try and write more than 10 UINT8s to it.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
I've got an MFC based application that works well under Win9x, but when I try it on Win2000 I've got an Access Violation (0xC0000005) error opening a particular dialog (the application works until the dialog opens).
I've got this log created by DrWtsn32:
<br />
Microsoft (R) Windows 2000 (TM) versione 5.00 DrWtsn32<br />
Copyright (C) 1985-1999 Microsoft Corp. Tutti i diritti riservati.<br />
<br />
<br />
<br />
Exception dell'applicazione:<br />
App: (pid=1476)<br />
Ora: 01/07/2003 @ 23:17:44.968<br />
Numero exception: c0000005 (access violation)<br />
<br />
*----> System Information <----*<br />
Nome computer: ATHLON<br />
Nome utente: Administrator<br />
Numero processori: 1<br />
Tipo processore: x86 Family 6 Model 6 Stepping 2<br />
Versione di Windows 2000: 5.0<br />
Build corrente: 2195<br />
Service Pack: 3<br />
Tipo corrente: Uniprocessor Free<br />
Organizzazione registrata: HomeLAN<br />
Proprietario autorizzato: sg<br />
<br />
*----> Elenco Task <----*<br />
0 Idle.exe<br />
8 System.exe<br />
140 SMSS.exe<br />
168 CSRSS.exe<br />
188 WINLOGON.exe<br />
216 SERVICES.exe<br />
228 LSASS.exe<br />
404 svchost.exe<br />
436 spoolsv.exe<br />
472 svchost.exe<br />
496 mgabg.exe<br />
508 navapsvc.exe<br />
576 regsvc.exe<br />
620 mstask.exe<br />
648 stisvc.exe<br />
704 vsmon.exe<br />
824 explorer.exe<br />
840 WinMgmt.exe<br />
856 svchost.exe<br />
996 gsicon.exe<br />
1004 dslagent.exe<br />
984 pdesk.exe<br />
1040 hpgs2wnd.exe<br />
1044 navapw32.exe<br />
1048 CTHELPER.exe<br />
1060 hpgs2wnf.exe<br />
1152 zonealarm.exe<br />
1384 Paint Shop Pro..exe<br />
1336 Paint Shop Pro..exe<br />
368 IDMan.exe<br />
320 hh.exe<br />
1476 VHDrCoST05.exe<br />
424 DRWTSN32.exe<br />
0 _Total.exe<br />
<br />
(00400000 - 00461000) <br />
(78460000 - 784E0000) <br />
(77E80000 - 77F3D000) <br />
(77E10000 - 77E75000) <br />
(77F40000 - 77F7C000) <br />
(76B10000 - 76B4D000) <br />
(70BD0000 - 70C35000) <br />
(78000000 - 78046000) <br />
(77DB0000 - 77E0D000) <br />
(77120000 - 77191000) <br />
(71710000 - 71794000) <br />
(77590000 - 777DA000) <br />
(77800000 - 7781E000) <br />
(75040000 - 75050000) <br />
(752A0000 - 752C0000) <br />
(77A50000 - 77B45000) <br />
(694B0000 - 694D9000) <br />
(779B0000 - 77A4B000) <br />
(10000000 - 10011000) <br />
(51080000 - 510D6000) <br />
(77550000 - 77581000) <br />
(77820000 - 77827000) <br />
(75980000 - 75986000) <br />
(6BE00000 - 6BE0A000) <br />
(011E0000 - 0123A000) <br />
(6BD00000 - 6BD08000) <br />
(72C90000 - 72D15000) <br />
(77850000 - 7788E000) <br />
(770A0000 - 770C3000) <br />
(76F80000 - 76F8F000) <br />
(773C0000 - 773D5000) <br />
(75120000 - 7516F000) <br />
(77BE0000 - 77BEF000) <br />
(75170000 - 75176000) <br />
(75100000 - 75110000) <br />
(74FE0000 - 74FF3000) <br />
(74FD0000 - 74FD8000) <br />
(77950000 - 7797B000) <br />
(77980000 - 779A4000) <br />
(75000000 - 75009000) <br />
(01520000 - 01669000) <br />
<br />
Scarico dello stato per l'id del thread 0x340<br />
<br />
eax=0053bcd0 ebx=004043e0 ecx=000002a6 edx=00457901 esi=0053bd0c edi=00000000<br />
eip=77e13df3 esp=0012ecb4 ebp=0012ed68 iopl=0 nv up ei pl nz ac po nc<br />
cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000216<br />
<br />
<br />
funzione: GetWindowRect<br />
77e13dd4 c20800 ret 0x8<br />
77e13dd7 8b442404 mov eax,[esp+0x4] ss:010dc287=????????<br />
77e13ddb 0fb7482a movzx ecx,word ptr [eax+0x2a] ds:014e92a3=????<br />
77e13ddf 80e53f and ch,0x3f<br />
77e13de2 81f99d020000 cmp ecx,0x29d<br />
77e13de8 7412 jz LoadMenuIndirectA+0x116 (77e194fc)<br />
77e13dea 57 push edi<br />
77e13deb 8b7c240c mov edi,[esp+0xc] ss:010dc287=????????<br />
77e13def 56 push esi<br />
77e13df0 8d703c lea esi,[eax+0x3c] ds:014e92a2=????????<br />
FAULT ->77e13df3 a5 movsd ds:0053bd0c=000001a5 es:00000000=????????<br />
77e13df4 a5 movsd ds:0053bd0c=000001a5 es:00000000=????????<br />
77e13df5 a5 movsd ds:0053bd0c=000001a5 es:00000000=????????<br />
77e13df6 a5 movsd ds:0053bd0c=000001a5 es:00000000=????????<br />
77e13df7 5e pop esi<br />
77e13df8 5f pop edi<br />
77e13df9 c20800 ret 0x8<br />
77e13dfc 8b442408 mov eax,[esp+0x8] ss:010dc287=????????<br />
77e13e00 832000 and dword ptr [eax],0x0 ds:0053bcd0=00180216<br />
77e13e03 83600400 and dword ptr [eax+0x4],0x0 ds:014e92a2=????????<br />
77e13e07 8b0d0090e677 mov ecx,[77e69000] ds:77e69000=003b0650<br />
77e13e0d 8b899c050000 mov ecx,[ecx+0x59c] ds:00000842=????????<br />
<br />
*----> Back Trace dello stack <----*<br />
<br />
FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name<br />
0012ED68 004245AD 0000BC19 00000000 00442CF8 0012EDEC user32!GetWindowRect <br />
0012ED94 004244CC 00000138 AD0107A6 00180216 0012EDEC !<nosymbols> <br />
0012EDB0 004243CE 00000138 AD0107A6 00180216 0012EDEC !<nosymbols> <br />
0012EDE0 004220A0 0012EE4C 0012F588 00000006 00423719 !<nosymbols> <br />
0012EE70 0042348B 00000019 00000000 00443A60 0012EE8C !<nosymbols> <br />
0012EE90 0042333C 00000019 00000000 0012EEA8 00180216 !<nosymbols> <br />
0012EEB4 00423944 AD0107A6 00180216 0012F3B0 0012F3B0 !<nosymbols> <br />
0012EF30 0042348B 00000138 AD0107A6 00443C90 0012EF4C !<nosymbols> <br />
0012EF50 004224F2 00000138 AD0107A6 00180216 00180216 !<nosymbols> <br />
0012EFB0 004226FA 00000000 000901B0 00000138 AD0107A6 !<nosymbols> <br />
0012EFCC 77E11D0A 000901B0 00000138 AD0107A6 00180216 !<nosymbols> <br />
0012EFEC 77E12BCC 004226CF 000901B0 00000138 AD0107A6 user32!DispatchMessageW <br />
0012F008 77E12B84 004F1C40 00000138 AD0107A6 00180216 user32!MsgWaitForMultipleObjects <br />
0012F030 784802FF 0012F040 00000018 004F1C40 00000138 user32!MsgWaitForMultipleObjects <br />
0012F0EC 77E20F1C 0015A400 AD0107A6 00000001 0000000F ntdll!KiUserCallbackDispatcher <br />
0012F160 77E210FC 0015A478 0000000F 00000000 00000000 user32!DrawStateW <br />
0012F198 77E13D4B 77E210DB 00180216 0000000F 00000000 user32!DrawStateW <br />
0012F1BC 77E1734D 77E210DB 00180216 0000000F 00000000 user32!GetWindowThreadProcessId <br />
0012F1DC 00422EE1 77E210DB 00180216 0000000F 00000000 user32!CallWindowProcA <br />
0012F1FC 004234A2 0000000F 00000000 00000000 0000000F !<nosymbols> <br />
0012F218 004224F2 0000000F 00000000 00000000 00000000 !<nosymbols> <br />
0012F278 004226FA 00000000 00180216 0000000F 00000000 !<nosymbols> <br />
0012F294 77E11D0A 00180216 0000000F 00000000 00000000 !<nosymbols> <br />
0012F2B4 77E12BCC 004226CF 00180216 0000000F 00000000 user32!DispatchMessageW <br />
0012F2D0 77E12B84 0053BCD0 0000000F 00000000 00000000 user32!MsgWaitForMultipleObjects <br />
0012F2F8 784802FF 0012F308 00000018 0053BCD0 0000000F user32!MsgWaitForMultipleObjects <br />
00455958 00000005 00000000 00000000 0009E42A 00000146 ntdll!KiUserCallbackDispatcher <br />
<br />
*----> Scarico Raw Stack <----*<br />
0012ecb4 88 f5 12 00 88 f5 12 00 - d1 3d e1 77 d0 bc 53 00 .........=.w..S.<br />
0012ecc4 00 00 00 00 08 44 40 00 - 16 02 18 00 00 00 00 00 .....D@.........<br />
0012ecd4 88 f5 12 00 88 ed 12 00 - 01 00 03 00 e4 64 45 00 .............dE.<br />
0012ece4 5c ed 12 00 a0 fb 43 00 - ff ff ff ff 59 37 42 00 \.....C.....Y7B.<br />
0012ecf4 44 ed 12 00 06 00 00 00 - ec ed 12 00 00 00 00 00 D...............<br />
0012ed04 b0 f3 12 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................<br />
0012ed14 60 ed 12 00 00 00 00 00 - 0c 00 00 00 18 00 00 00 `...............<br />
0012ed24 00 00 00 00 0c 00 00 00 - ff ff 00 00 60 ed 12 00 ............`...<br />
0012ed34 01 00 00 00 b4 ef 12 00 - 94 1d e2 77 a6 07 01 ad ...........w....<br />
0012ed44 e0 50 44 00 a6 07 01 ad - 00 00 00 00 00 00 00 00 .PD.............<br />
0012ed54 f0 2c 44 00 00 00 00 00 - 64 ee 12 00 ec 05 44 00 .,D.....d.....D.<br />
0012ed64 02 00 00 00 94 ed 12 00 - ad 45 42 00 19 bc 00 00 .........EB.....<br />
0012ed74 00 00 00 00 f8 2c 44 00 - ec ed 12 00 88 f5 12 00 .....,D.........<br />
0012ed84 88 f5 12 00 00 00 00 00 - a6 07 01 ad 06 00 00 00 ................<br />
0012ed94 b0 ed 12 00 cc 44 42 00 - 38 01 00 00 a6 07 01 ad .....DB.8.......<br />
0012eda4 16 02 18 00 ec ed 12 00 - 88 f5 12 00 e0 ed 12 00 ................<br />
0012edb4 ce 43 42 00 38 01 00 00 - a6 07 01 ad 16 02 18 00 .CB.8...........<br />
0012edc4 ec ed 12 00 06 00 00 00 - a2 48 42 00 ec ed 12 00 .........HB.....<br />
0012edd4 b0 f3 12 00 06 00 00 00 - 8f 20 42 00 70 ee 12 00 ......... B.p...<br />
0012ede4 a0 20 42 00 4c ee 12 00 - 88 f5 12 00 06 00 00 00 . B.L...........<br />
<br />
Scarico dello stato per l'id del thread 0x5d0<br />
<br />
eax=771324c2 ebx=00163ae0 ecx=00163954 edx=00000000 esi=00163998 edi=00000100<br />
eip=78463bb8 esp=013cfe28 ebp=013cff74 iopl=0 nv up ei pl nz na po nc<br />
cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000206<br />
<br />
<br />
funzione: NtReplyWaitReceivePortEx<br />
78463bad b8ac000000 mov eax,0xac<br />
78463bb2 8d542404 lea edx,[esp+0x4] ss:0237d3fb=????????<br />
78463bb6 cd2e int 2e<br />
78463bb8 c21400 ret 0x14<br />
<br />
*----> Back Trace dello stack <----*<br />
<br />
FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name<br />
013CFF74 771320D9 77132528 00163998 00000000 40163494 ntdll!NtReplyWaitReceivePortEx <br />
013CFFA8 771324DA 001619E8 013CFFEC 77E887DD 00163AE0 rpcrt4!NdrConformantArrayMemorySize <br />
013CFFB4 77E887DD 00163AE0 00000000 40163494 00163AE0 rpcrt4!NdrConformantArrayMemorySize <br />
013CFFEC 00000000 00000000 00000000 00000000 00000000 kernel32!GetModuleFileNameA <br />
<br />
Scarico dello stato per l'id del thread 0x5a8<br />
<br />
eax=00000000 ebx=00000002 ecx=ffffffff edx=00000000 esi=784637a7 edi=00000002<br />
eip=784637b2 esp=014cfe5c ebp=014cfea8 iopl=0 nv up ei pl zr na po nc<br />
cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000246<br />
<br />
<br />
funzione: NtWaitForMultipleObjects<br />
784637a7 b8e9000000 mov eax,0xe9<br />
784637ac 8d542404 lea edx,[esp+0x4] ss:0247d42f=????????<br />
784637b0 cd2e int 2e<br />
784637b2 c21400 ret 0x14<br />
<br />
*----> Back Trace dello stack <----*<br />
<br />
FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name<br />
014CFEA8 77E12A00 014CFE80 00000001 00000000 014CFEA0 ntdll!NtWaitForMultipleObjects <br />
014CFF04 77E12A77 014CFED0 70C2BB38 0000EA60 00000041 user32!MsgWaitForMultipleObjectsEx <br />
014CFF20 70C1A793 00000001 70C2BB38 00000000 0000EA60 user32!MsgWaitForMultipleObjects <br />
014CFF74 70C1AB1B 014CFFA0 014CFFA4 014CFFA8 014CFF9C !Ordinal265 <br />
014CFFAC 70C1ACDF 00000000 77E887DD 00000000 00000000 !Ordinal293 <br />
014CFFEC 00000000 70C1ACAF 00000000 00000000 000000C8 !Ordinal293 <br />
<br />
*----> Scarico Raw Stack <----*<br />
014cfe5c b7 7a e8 77 02 00 00 00 - 80 fe 4c 01 01 00 00 00 .z.w......L.....<br />
014cfe6c 00 00 00 00 a0 fe 4c 01 - 00 00 00 00 00 00 00 00 ......L.........<br />
014cfe7c 02 00 00 00 5c 01 00 00 - 64 01 00 00 30 40 16 00 ....\...d...0@..<br />
014cfe8c f0 01 13 00 01 00 00 00 - 00 00 13 00 0f 00 00 00 ................<br />
014cfe9c 01 ff 4c 01 00 ba 3c dc - ff ff ff ff 04 ff 4c 01 ..L...<.......L.<br />
014cfeac 00 2a e1 77 80 fe 4c 01 - 01 00 00 00 00 00 00 00 .*.w..L.........<br />
014cfebc a0 fe 4c 01 00 00 00 00 - 60 ea 00 00 18 bb c2 70 ..L.....`......p<br />
014cfecc 00 00 00 00 5c 01 00 00 - 64 01 00 00 93 86 46 78 ....\...d.....Fx<br />
014cfedc 00 00 00 00 18 bb c2 70 - 00 00 16 71 10 ff 4c 01 .......p...q..L.<br />
014cfeec 00 c0 fd 7f 42 9e a7 77 - 00 00 00 00 cc c6 fd 7f ....B..w........<br />
014cfefc 00 00 00 00 64 01 00 00 - 20 ff 4c 01 77 2a e1 77 ....d... .L.w*.w<br />
014cff0c d0 fe 4c 01 38 bb c2 70 - 60 ea 00 00 41 00 00 00 ..L.8..p`...A...<br />
014cff1c 00 00 00 00 74 ff 4c 01 - 93 a7 c1 70 01 00 00 00 ....t.L....p....<br />
014cff2c 38 bb c2 70 00 00 00 00 - 60 ea 00 00 41 00 00 00 8..p....`...A...<br />
014cff3c 00 00 00 00 18 bb c2 70 - 00 00 00 00 6c 40 16 00 .......p....l@..<br />
014cff4c 6c 40 16 00 30 40 16 00 - b0 07 19 71 00 f0 fd 7f l@..0@.....q....<br />
014cff5c dc fe 4c 01 01 00 00 00 - fb e3 09 00 18 bb c2 70 ..L............p<br />
014cff6c 60 ea 00 00 01 00 00 00 - ac ff 4c 01 1b ab c1 70 `.........L....p<br />
014cff7c a0 ff 4c 01 a4 ff 4c 01 - a8 ff 4c 01 9c ff 4c 01 ..L...L...L...L.<br />
014cff8c 60 ea 00 00 00 00 00 00 - 00 00 bd 70 00 00 00 00 `..........p....<br />
<br />
Scarico dello stato per l'id del thread 0x5b8<br />
<br />
eax=00000001 ebx=00000002 ecx=001738e4 edx=00000000 esi=784637a7 edi=00000002<br />
eip=784637b2 esp=0176fe5c ebp=0176fea8 iopl=0 nv up ei pl zr na po nc<br />
cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000246<br />
<br />
<br />
funzione: NtWaitForMultipleObjects<br />
784637a7 b8e9000000 mov eax,0xe9<br />
784637ac 8d542404 lea edx,[esp+0x4] ss:0271d42f=????????<br />
784637b0 cd2e int 2e<br />
784637b2 c21400 ret 0x14<br />
<br />
*----> Back Trace dello stack <----*<br />
<br />
FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name<br />
0176FEA8 77E12A00 0176FE80 00000001 00000000 0176FEA0 ntdll!NtWaitForMultipleObjects <br />
0176FF04 77E12A77 0176FED0 70C2BB38 0000EA60 00000041 user32!MsgWaitForMultipleObjectsEx <br />
0176FF20 70C1A793 00000001 70C2BB38 00000000 0000EA60 user32!MsgWaitForMultipleObjects <br />
0176FF74 70C1AB1B 0176FFA0 0176FFA4 0176FFA8 0176FF9C !Ordinal265 <br />
0176FFAC 70C1ACDF 00000000 77E887DD 00000000 00000000 !Ordinal293 <br />
0176FFEC 00000000 70C1ACAF 00000000 00000000 00000008 !Ordinal293 <br />
<br />
*----> Scarico Raw Stack <----*<br />
0176fe5c b7 7a e8 77 02 00 00 00 - 80 fe 76 01 01 00 00 00 .z.w......v.....<br />
0176fe6c 00 00 00 00 a0 fe 76 01 - 00 00 00 00 00 00 00 00 ......v.........<br />
0176fe7c 02 00 00 00 5c 01 00 00 - 18 00 00 00 cc fe 76 01 ....\.........v.<br />
0176fe8c 7c 82 46 78 00 00 00 00 - cc fe 76 01 98 82 46 78 |.Fx......v...Fx<br />
0176fe9c 40 25 13 00 00 ba 3c dc - ff ff ff ff 04 ff 76 01 @%....<.......v.<br />
0176feac 00 2a e1 77 80 fe 76 01 - 01 00 00 00 00 00 00 00 .*.w..v.........<br />
0176febc a0 fe 76 01 00 00 00 00 - 60 ea 00 00 18 bb c2 70 ..v.....`......p<br />
0176fecc 00 00 00 00 5c 01 00 00 - 18 00 00 00 93 86 46 78 ....\.........Fx<br />
0176fedc 00 00 00 00 18 bb c2 70 - 00 00 16 71 00 00 00 00 .......p...q....<br />
0176feec 00 b0 fd 7f 98 4a 17 00 - 00 00 00 00 cc b6 fd 7f .....J..........<br />
0176fefc 00 00 00 00 18 00 00 00 - 20 ff 76 01 77 2a e1 77 ........ .v.w*.w<br />
0176ff0c d0 fe 76 01 38 bb c2 70 - 60 ea 00 00 41 00 00 00 ..v.8..p`...A...<br />
0176ff1c 00 00 00 00 74 ff 76 01 - 93 a7 c1 70 01 00 00 00 ....t.v....p....<br />
0176ff2c 38 bb c2 70 00 00 00 00 - 60 ea 00 00 41 00 00 00 8..p....`...A...<br />
0176ff3c 00 00 00 00 18 bb c2 70 - 00 00 00 00 48 ff 76 01 .......p....H.v.<br />
0176ff4c 48 ff 76 01 38 1f 13 00 - 16 00 18 00 00 f0 fd 7f H.v.8...........<br />
0176ff5c dc fe 76 01 01 00 00 00 - 61 e0 09 00 18 bb c2 70 ..v.....a......p<br />
0176ff6c 60 ea 00 00 00 00 00 00 - ac ff 76 01 1b ab c1 70 `.........v....p<br />
0176ff7c a0 ff 76 01 a4 ff 76 01 - a8 ff 76 01 9c ff 76 01 ..v...v...v...v.<br />
0176ff8c 60 ea 00 00 00 00 00 00 - 00 00 bd 70 00 00 00 00 `..........p....<br />
As I can see from stack back-trace, I suppose I've got some problem with the GetWindowRect function.
Are there some portability issue I don't know?
PS: I'm downloading Visual Studio 6.0 service pack 5 and I'm going to install latest Platform SDK update.
May this solve the problem?
|
|
|
|
|
I didn't really look at all your data because it is too much to go through but installing Service Pack 5 is the best advice that I can give you at the moment. I have had serious problems before I installed it and this topic has been discussed here before. Everyone has had weird problems that were fixed by installing SP5.
Spero che SP5 solvera il tuo problemo! Buona fortuna!
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
I have an application with about 20 toolbar buttons. Normally, all buttons are showing in one screen. But if I change the Windows font to a much larger font, the buttons to the right are cut off. Is there a way I can scroll to the left and right on the tollbar to see all the buttons?
Eilzabeth
|
|
|
|
|
The little-used pager control will do this. If you remember IE 4, it used a pager control on its toolbars, instead of the current method of showing a chevron.
--Mike--
"So where does that leave us? Well, it leaves us right back where we started, only more confused than before." -- Matt Gullett
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
Michael, can you be more specific? I don't get your hint.
Eilzabeth
|
|
|
|
|
|
Now I have initialized the control at the InitInstance event:
-------------------------
BOOL CMyApp::InitInstance()
{
//initialize page control object
LPINITCOMMONCONTROLSEX lpInitCtrls = new INITCOMMONCONTROLSEX;
lpInitCtrls->dwICC =ICC_PAGESCROLLER_CLASS;
InitCommonControlsEx(lpInitCtrls);
-------------------------
I have also created the pager control:
------------------------------
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
//create the pager control
if (!CreateWindow(WC_PAGESCROLLER,NULL,PGS_HORZ|WS_CHILD, CW_USEDEFAULT, NULL, CW_USEDEFAULT, NULL, NULL,NULL,NULL,NULL))
return -1;
-----------------------------
Now how do I assigned the pager control to the application toolbar m_wndToolBar?
Eilzabeth
|
|
|
|
|
is there any way to use the Cwnd timer in dll withaout creating
new window ? if there is no way than how can i use the timer in thread in
dll
|
|
|
|
|
One solution is a timer queue timer.
Kuphryn
|
|
|
|
|
The ::SetTimer() function can be used to force a callback to a specified function rather than sending a message to a window. For example:
void CALLBACK MyTimerProc(HWND hWnd, UINT nMsg, UINT_PTR idEvent, DWORD dwTime)
{
// Do something
}
UINT nID = ::SetTimer( NULL, 0, 1000, MyTimerProc );
This will call MyTimerProc after 1000ms. The first parameter is NULL, meaning that no window is associated with this timer.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
hello @all,
i have to write a program which generates randomized letters, e.g. from A to D (variable letters and with a variable length). the string could look like:
CString str="AAACCDDDDDBBBBCDABBBDDDD....";
can anybody help me?
thank you very much!!!
sunny
|
|
|
|
|
char GetRandomLetter( void )
{
char cLetter;
cLetter = (rand() % 26) + 'A';
return cLetter;
}
CString str;
for (int x = 0; x < some_length; x++)
{
char c = GetRandomLetter();
str += c;
}
|
|
|
|
|
thanks for reply.
the program works, but i don't know why!
DavidCrow wrote:
cLetter = (rand() % 26) + 'A';
why does this works?
thank you very much!
sunny
|
|
|
|
|
rand() gives you a number between 0 and RAND_MAX. Modulo that with 26 gives you a number between 0 and 25. Add 'A' to that gives you one of the 26 letters of the alphabet. Make sense?
|
|
|
|
|
One solution is to generate a number and then convert it to a char.
string text;
unsigned int randNum = 0;
for (unsigned int i = 0; i < nTextSize; ++i)
{
randNum = static_cast<unsigned int="">((((static_cast<double>(rand())) / (static_cast<double>(RAND_MAX + 1))) * 94 + 33));
sName += static_cast<char>(randNum);
}
Kuphryn
|
|
|
|
|
Hi! I'm not exactly new to MFC but i haven't really dealt with internet programming. I was wondering how i could create an internet chat program. I found stuff on network chat programs but nothing on internet chat programs. Could i use a web server?
-- Steve
|
|
|
|
|
One solution is winsock.
Kuphryn
|
|
|
|
|
What's the scope of your quest?
Is this a "for fun" kinda "i want to talk to my friends" thing?
If you're doing a "for fun" programming, the easiest way to do this, is to create a peer-to-peer application. Where each client speaks directly to the other client via the net -- TCP or UDP (winsock). This involves writing one piece of software, the software is a UI, and a networking endpoint.
If you want to write a serious chat program, that ya gotta go the "client/server" route. Where you actually end up writing 2 different pieces of software: a client(UI and winsock connection to server) and a server which manages the chat, and makes sure text is routed to each connected client.
Client/Server is by far the better route. Peer-to-Peer seems simple until you want to do something fancy -- like create a chat room with more than one other person in it. Or for more advanced -- sending video to more than one other person....
Good luck in your chat adventure.
I've seen source code out there for simple peer-to-peer chat programs based in java....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
i don't have the ability to do a client/server chat, so i'm going to try peer-to-peer. What i don't get is how to connect the 2 computers though the internet. i can't find anything on it.
-- Steve
|
|
|
|
|
In VC6 Have a look at the ChatSrvr and Chatter sample programs.
Alternatively you could look at an internet article on CodeProject [^]
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Hi Folks!
I want to write a program that should be able to determine how many instances of the (same) program are currently running and what are they doing. Based upon this, it should decide whether to work immediately or to pause until the other instances are finished and continue after that.
How would you do that?
Best Regards,
Christian Richardt
Those who know don't talk.
Those who talk don't know.
|
|
|
|
|
Maybe CSemaphore can be what you're looking for.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi! I am really confused!
I am using the DHTML edit control and it is making some kind of newline in the html code which I dont want because I want to put infront of and after each line some chars and with that mysterious newline it puts the chars to be placed at the end of the line after a newline ! Are there any other newlines than '\n' and '\r\n' ???
Thank you for your answers in advance!
|
|
|
|
|
Scolinks wrote:
Are there any other newlines than '\n' and '\r\n' ???
No, that's it.
|
|
|
|