|
The problem here is that you aren't zeroing out the recipient array correctly. Here's the correct way to do it:
int nRecips = 2;
MapiRecipDesc *recipient=new MapiRecipDesc[nRecips];
::ZeroMemory(recipient,sizeof(*recipient) * nRecips);
This worked fine for me. One more note: Make SURE you call MAPILogoff after you are done sending the email:
MAPILogoff( session, 0, 0, 0 );
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|
|
Working great, Chris!
How could I thank you?
This has been a massive help for me!
F
|
|
|
|
|
I need to change the color and Font of Objects of CButton and CStatic . How can i do this ?
|
|
|
|
|
Objects derived from CWnd have a SetFont method to do just this (after the HWND is valid, i.e. created).
|
|
|
|
|
Thanks for the info .
The Font can now be effortlessly changed . I was still unable to change teh Forecolor and backcolor of the Static text window .
|
|
|
|
|
Either the parent window of the static text window needs to handle the WM_CTLCOLORSTATIC message, or if you're using MFC, your static window itself should handle the reflected message.
Hint: In either case, the HBRUSH that you use to control the back colour should persist longer than the lifetime of the handler function, or it will likely have no effect.
Steve S
[This signature space available for rent]
|
|
|
|
|
Does anyone know where keyboard macro information is stored? I don't mean where are the macros stored, but where the key/macro mapping is stored. I would like to be able to quickly configure someone else's computer to have the same key combination to macro mapping mine does.
Thanks,
Lee
|
|
|
|
|
Extra->customize->keyboard (or shortcuts -- I'm translating from the german ).
Then choose the category "Macro" and there you are
~RaGE();
|
|
|
|
|
For VC6, it's under the following keys:
HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Keyboard
HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Keyboard\Aut
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|
|
I have VC++6 ,SP3 on WinNT.
When creating a right-aligned combo-box in WinNT it looks fine.
However, in Win98 the control is not right-aligned.
Do you have any idea how to solve this problem?
|
|
|
|
|
I have an application and it must support language choice and change at runtime.
Is there someone can help me?
Sorry for my English,
Margaria Ivano
|
|
|
|
|
|
Can anyone give me a good link for building a dynamic data exchange between a Matlab.exe and a VisualC++.exe?
Is this possible and where can I find some good information?
Thanx, kind regards,
Geert
|
|
|
|
|
I have find a function on codeguru, DDBToDIB and i get a HANDLE to DIB bitmap. and now how do this :
MAAK wrote:
<code>
HBITMAP hbmp1 = NULL, hbmp2 = NULL;
BITMAP bmp1, bmp2;
..
..
GetObject(hbmp1, sizeof(BITMAP), &bmp1);
GetObject(hbmp2, sizeof(BITMAP), &bmp2);
if(bmp1.bmBitsPixel != bmp2.bmBitsPixel || bmp1.bmHeight != bmp2.bmHeight || bmp1.bmWidth != bmp2.bmWidth)
return 0;
else
{
LPBYTE data1 = (LPBYTE)bmp1.bmBits,data2 = (LPBYTE)bmp2.bmBits;
DWORD bmWidth = bmp1.bmWidth * (bmp1.bmBitsPixel / 8);
DWORD bmWidthBytes = bmWidth + (4 - bmWidth % 4) * bool(bmWidth % 4);
DWORD bytesize = bmp1.bmHeight * bmWidthBytes;
if(memcmp(data1, data2, bytesize) == 0)
return 1;
}</code>
when i have two HANDLE on DIB ?
(sorry for stupid questions but i'm beginer)
|
|
|
|
|
well...
now I do directly :
if (memcmp(m_hDIB,hDIB,m_DIBSize)==0)
AfxMessageBox("gooood");
m_hDIB is the HANDLE on DIB of the first Bitmap;
hDIB is the HANDLE on DIB of the second Bitmap;
m_DIBSize is the size of the second DIB Bitmap;
Bitmaps are same height, same width and so same numbers of pixels.
But i want to detect if pixels are differents.
memcmp always return 0 !
You know why ?
|
|
|
|
|
Sorry but I can't understand exactly what you want.
1.Does memcmp return 0 even if the bitmaps are different? If there is any difference in pixels it should return a non-zero value, doesn't it do that?
2.The handles of the bitmaps should not be passed to memcmp, what should be passed is their bytes array did you just miss-typed the message?
|
|
|
|
|
thx for your answer but i have solved the problem, it was a problem with the size of bitmap.
now it will works fine (i hope )
Thx MAAK for your help
|
|
|
|
|
You are welcome
|
|
|
|
|
Dear Sirs,
I develop a mediaplayer (mPlayer.exe), which uses the runtime argument to pass in the file name that refers to the movie to be played back in the player.
Instead of entering the file name each time when I run the mPlayer.exe, is there any way I can develop a wrapper, which will make use of the mPlayer.exe and the file name as input and generate a new mediaplayer inside which the file name had been hardcoded. Thus a stand alone executable could be run instead of a mPlayer.exe and a file name.
I tried to do like this because only the new wrapper and the excutable mediaplayer (mPlayer.exe) could be released under my current development plan.
Thanks
DJ
|
|
|
|
|
i have the SOCKET that i use to send/recv data, now i want to know the IP adres of the connected client. how can i do this?
greetz
[]D [] []D []
|
|
|
|
|
Try this:
int namelen=sizeof(sockaddr_in);
sockaddr_in name;
getpeername(sock, (sockaddr *)&name, &namelen);
char *sz=inet_ntoa(name.sin_addr);
rechi
|
|
|
|
|
Hi Guys,
I have a release version of an application out in the field. Seems some of my customers are having problems with the application just dying. It's a release version, and this is all I have to go on:
State Dump for Thread Id 0x2a8
eax=00000000 ebx=00407ca7 ecx=00982548 edx=6c440220 esi=00000000 edi=00982548
eip=00407cad esp=0012fcd0 ebp=0012fcd0 iopl=0 nv up ei ng nz na pe cy
cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000283
function: <nosymbols>
00407c9e 5f pop edi
00407c9f 5e pop esi
00407ca0 5d pop ebp
00407ca1 5b pop ebx
00407ca2 59 pop ecx
00407ca3 c3 ret
00407ca4 c20400 ret 0x4
00407ca7 55 push ebp
00407ca8 8bec mov ebp,esp
00407caa 8b450c mov eax,[ebp+0xc] ss:00cbd2a6=????????
FAULT ->00407cad 83780402 cmp dword ptr [eax+0x4],0x2 ds:00b8d5d6=????????
00407cb1 751d jnz 004172d0
00407cb3 f6401001 test byte ptr [eax+0x10],0x1 ds:00b8d5d6=??
00407cb7 7417 jz 004107d0
00407cb9 8b400c mov eax,[eax+0xc] ds:00b8d5d6=????????
00407cbc 33c9 xor ecx,ecx
00407cbe a801 test al,0x1
00407cc0 7508 jnz 00414dca
00407cc2 d1e8 shr eax,1
00407cc4 41 inc ecx
00407cc5 83f91a cmp ecx,0x1a
00407cc8 7cf4 jl 0040fdbe
*----> Stack Back Trace <----*
FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
0012FCD0 6C371ED5 00000007 00000000 00982548 00982548 !<nosymbols>
0012FD50 6C371CEA 00000219 00000007 0040B268 0012FD6C !Ordinal5163
0012FD70 6C371C73 00000219 00000007 00000000 0040E4EC !Ordinal6374
0012FDD0 6C371BFB 00000000 001203B6 00000219 00000007 !Ordinal1109
0012FDEC 6C371BBA 001203B6 00000219 00000007 00000000 !Ordinal1578
0012FE18 77E148DC 001203B6 00000219 00000007 00000000 !Ordinal1579
0012FE38 77E14AA7 6C371B81 001203B6 00000219 00000007 user32!PtInRect
0012FEC4 77E266FD 0040E4EC 00000001 6C3711CE 0040E4EC user32!TranslateMessageEx
0040E4EC 00000219 00000007 00000000 1DDEB5AD 000001C0 user32!DispatchMessageA
*----> Raw Stack Dump <----*
0012fcd0 50 fd 12 00 d5 1e 37 6c - 07 00 00 00 00 00 00 00 P.....7l........
0012fce0 48 25 98 00 48 25 98 00 - d0 68 13 00 cd ab ba dc H%..H%...h......
0012fcf0 14 fd 12 00 f9 7e e1 77 - 68 1c b5 77 60 03 09 00 .....~.wh..w`...
0012fd00 20 00 00 00 6c fd 12 00 - f8 eb fd 7f 00 00 00 00 ...l...........
0012fd10 38 fd 12 00 87 2b f8 77 - 00 ec fd 7f 20 00 00 00 8....+.w.... ...
0012fd20 44 fd 12 00 54 c9 40 6c - 10 00 00 00 22 03 09 00 D...T.@l...."...
0012fd30 f8 eb fd 7f 00 00 00 c0 - 94 fd 12 00 e8 b1 40 00 ..............@.
0012fd40 00 00 00 00 c4 fd 12 00 - 0a 2e 40 6c ff ff ff ff ..........@l....
0012fd50 70 fd 12 00 ea 1c 37 6c - 19 02 00 00 07 00 00 00 p.....7l........
0012fd60 68 b2 40 00 6c fd 12 00 - 19 02 00 00 00 00 00 00 h.@.l...........
0012fd70 d0 fd 12 00 73 1c 37 6c - 19 02 00 00 07 00 00 00 ....s.7l........
0012fd80 00 00 00 00 ec e4 40 00 - f4 e4 40 00 00 00 00 c0 ......@...@.....
0012fd90 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................
0012fda0 00 00 00 00 00 00 00 00 - 00 00 00 00 18 10 37 6c ..............7l
0012fdb0 06 00 00 00 ec e4 40 00 - f4 e4 40 00 d0 68 13 00 ......@...@..h..
0012fdc0 84 fd 12 00 0c fe 12 00 - 82 2d 40 6c 00 00 00 00 .........-@l....
0012fdd0 ec fd 12 00 fb 1b 37 6c - 00 00 00 00 b6 03 12 00 ......7l........
0012fde0 19 02 00 00 07 00 00 00 - 00 00 00 00 18 fe 12 00 ................
0012fdf0 ba 1b 37 6c b6 03 12 00 - 19 02 00 00 07 00 00 00 ..7l............
0012fe00 00 00 00 00 00 00 00 00 - d0 68 13 00 b4 fe 12 00 .........h......
State Dump for Thread Id 0x480
eax=00148fb0 ebx=80020000 ecx=00145738 edx=00000000 esi=00145528 edi=00000100
eip=77f82230 esp=010afe28 ebp=010aff74 iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000206
function: NtReplyWaitReceivePortEx
77f82225 b8ac000000 mov eax,0xac
77f8222a 8d542404 lea edx,[esp+0x4] ss:01c3d3ff=????????
77f8222e cd2e int 2e
77f82230 c21400 ret 0x14
77f82233 55 push ebp
77f82234 8bec mov ebp,esp
77f82236 56 push esi
77f82237 57 push edi
77f82238 53 push ebx
77f82239 8bf4 mov esi,esp
77f8223b ff7514 push dword ptr [ebp+0x14] ss:01c3d54a=????????
77f8223e ff7510 push dword ptr [ebp+0x10] ss:01c3d54a=????????
77f82241 ff750c push dword ptr [ebp+0xc] ss:01c3d54a=????????
77f82244 ff5508 call dword ptr [ebp+0x8] ss:01c3d54a=????????
77f82247 8be6 mov esp,esi
*----> Stack Back Trace <----*
FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
010AFF74 77D525D2 77D52C07 00145528 00000000 40145094 ntdll!NtReplyWaitReceivePortEx
010AFFA8 77D52BB9 00141DF0 010AFFEC 77E837CD 00145628 rpcrt4!NdrVaryingArrayFree
010AFFB4 77E837CD 00145628 00000000 40145094 00145628 rpcrt4!NdrVaryingArrayFree
010AFFEC 00000000 77D52BA1 00145628 00000000 00905A4D kernel32!TlsSetValue
*----> Raw Stack Dump <----*
010afe28 5f 27 d5 77 94 00 00 00 - 54 ff 0a 01 00 00 00 00 _'.w....T.......
010afe38 50 83 14 00 58 ff 0a 01 - d0 fa 13 00 f0 1d 14 00 P...X...........
010afe48 28 56 14 00 d0 26 df 84 - b4 fb 21 bb f2 f0 44 80 (V...&....!...D.
010afe58 88 85 00 e1 60 f1 de 84 - 87 fa 49 80 b8 88 00 e1 ....`.....I.....
010afe68 b0 fc 00 00 b8 88 00 e1 - 00 00 00 00 00 00 00 00 ................
010afe78 b4 fb 21 bb 8a f4 44 80 - 01 00 00 00 90 01 00 00 ..!...D.........
010afe88 00 00 00 00 10 00 f8 00 - 8a 34 90 84 7c 00 f8 00 .........4..|...
010afe98 9a 34 90 84 68 26 df 84 - b8 88 00 e1 00 00 00 00 .4..h&..........
010afea8 1f 00 00 00 d0 26 df 84 - d0 26 df 84 00 00 00 00 .....&...&......
010afeb8 01 00 00 00 10 fc 21 bb - 00 00 00 00 18 f7 2f e2 ......!......./.
010afec8 d4 fb 21 bb 00 00 00 00 - eb 4d 41 80 d0 27 df 84 ..!......MA..'..
010afed8 60 f1 de 84 c4 fc 21 bb - de e8 44 80 04 00 00 00 `.....!...D.....
010afee8 88 34 90 84 99 a8 49 80 - 80 f3 12 00 00 00 00 00 .4....I.........
010afef8 48 f3 12 00 02 24 33 02 - 00 00 00 00 00 00 00 00 H....$3.........
010aff08 01 00 00 00 19 00 02 00 - 44 2a 50 c0 eb 01 00 00 ........D*P.....
010aff18 00 00 00 00 40 2a 50 c0 - eb 01 00 00 01 00 00 00 ....@*P.........
010aff28 00 20 50 c0 60 8b 9e 84 - a0 92 a4 84 00 00 00 00 . P.`...........
010aff38 a0 92 a4 84 30 94 a4 84 - 64 fc 21 bb 2d d8 42 80 ....0...d.!.-.B.
010aff48 de d7 42 80 c4 4b 06 80 - 00 94 a4 84 00 00 02 80 ..B..K..........
010aff58 00 a2 2f 4d ff ff ff ff - 50 fe 0a 01 00 00 02 80 ../M....P.......
State Dump for Thread Id 0x490
eax=77d52ba1 ebx=00148998 ecx=00000000 edx=00000000 esi=00145528 edi=00000100
eip=77f82230 esp=012cfe28 ebp=012cff74 iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000202
function: NtReplyWaitReceivePortEx
77f82225 b8ac000000 mov eax,0xac
77f8222a 8d542404 lea edx,[esp+0x4] ss:01e5d3ff=????????
77f8222e cd2e int 2e
77f82230 c21400 ret 0x14
77f82233 55 push ebp
77f82234 8bec mov ebp,esp
77f82236 56 push esi
77f82237 57 push edi
77f82238 53 push ebx
77f82239 8bf4 mov esi,esp
77f8223b ff7514 push dword ptr [ebp+0x14] ss:01e5d54a=????????
77f8223e ff7510 push dword ptr [ebp+0x10] ss:01e5d54a=????????
77f82241 ff750c push dword ptr [ebp+0xc] ss:01e5d54a=????????
77f82244 ff5508 call dword ptr [ebp+0x8] ss:01e5d54a=????????
77f82247 8be6 mov esp,esi
*----> Stack Back Trace <----*
FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
012CFF74 77D525D2 77D52C07 00145528 00000000 00000000 ntdll!NtReplyWaitReceivePortEx
012CFFA8 77D52BB9 00144BB0 012CFFEC 77E837CD 00148998 rpcrt4!NdrVaryingArrayFree
012CFFB4 77E837CD 00148998 00000000 00000000 00148998 rpcrt4!NdrVaryingArrayFree
012CFFEC 00000000 00000000 00000000 00000000 00000000 kernel32!TlsSetValue
I have no clue how to decipher what I'm looking at in a manner that I can find a place in the code to look.
any suggestions are greatly appreciated. Thanks
Dan Willis
|
|
|
|
|
Unless you are very good with assembler (or you are planning to learn it) Dr. Watson is very difficult to use for diagnostic.
Try the following (first and/or second)
1. Build your app in release with pdb. This does not effect anything, except if pdb is present most debuggers will pin point the location, including function name.
2. Install debugger from MS SDK (do not worry it has very small foot print, and does not cripple your system like VC debugger, it is optimal for servers). The only drawback is it has very cryptic interface and command line options. When used properly this debugger gives you (!)readable(!) dump at the time of crush.
|
|
|
|
|
Ok,
On my way! But if I didn't have a machine I could reproduce this error on, how would I go about deciphering the drwatson stuff? I understand assembler enough to work with it, but I'm not sure how to go backwards from the drwatson to trace it to my application.
I'll report back after I try the pdb and debugger route
thanks!
Dan Willis
|
|
|
|
|
As you probably guessed Dr. Watson dumps stack, assembly, and memory dump for each thread in your program. Stack is meaningless unless you have PDB symbol file.
In you example "OrdinalXXXX" and "!<nosymbols>" could be real function name.
0012FCD0 6C371ED5 00000007 00000000 00982548 00982548 !<nosymbols>
0012FD50 6C371CEA 00000219 00000007 0040B268 0012FD6C !Ordinal5163
0012FD70 6C371C73 00000219 00000007 00000000 0040E4EC !Ordinal6374
0012FDD0 6C371BFB 00000000 001203B6 00000219 00000007 !Ordinal1109
0012FDEC 6C371BBA 001203B6 00000219 00000007 00000000 !Ordinal1578
0012FE18 77E148DC 001203B6 00000219 00000007 00000000 !Ordinal1579
0012FE38 77E14AA7 6C371B81 001203B6 00000219 00000007 user32!PtInRect
0012FEC4 77E266FD 0040E4EC 00000001 6C3711CE 0040E4EC user32!TranslateMessageEx
0040E4EC 00000219 00000007 00000000 1DDEB5AD 000001C0 user32!DispatchMessageA
From what I can guess one thread in your example just received WP_PAINT (or some UI windows message) and stumbled on 0 pointer or something, another was dealing with stack allocation. But again I could be wrong. This looks like typical crash from MS Office (probably Excel).
P.S. build pdb with detailed information.
|
|
|
|