memory handling with properties
From: Eric (bauersachs_at_kull.ch.nospam.me.com)
Date: 09/30/04
- Next message: Dmitry Streblechenko \(MVP\): "Re: How to set Send/Recive immediately after outlook starts"
- Previous message: Dmitry Streblechenko \(MVP\): "Re: FileAs"
- Next in thread: Dmitry Streblechenko \(MVP\): "Re: memory handling with properties"
- Reply: Dmitry Streblechenko \(MVP\): "Re: memory handling with properties"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 30 Sep 2004 19:23:13 +0200
How does memory handling of the properties work exactly?
The structure SPropValue.Value contains only pointers (for strings etc.). If
the properties are moved around, then I must pay great attention to all the
memory allocations.
I have seen that in the implementation of GetProps someone has declared a
local variable on the stack like
TCHAR szContainerName[64];
and then used a pointer to that variable in the SPropValue.Value.lpszA which
was used in IMAPIProp::GetProps and SetProps. I've seen this in the
implementation as well as for callers. Is this correct? Isn't the stack
destroyed before the caller can access the variables? Or is this only true
for implementators, not for callers?
When and how do I have to allocate the memory with MAPIAllocateMore /
MAPIFreeBuffer exactly?
When is it ok to use stack variables?
Can someone shed a little light on this issue?
Eric Bauersachs
- Next message: Dmitry Streblechenko \(MVP\): "Re: How to set Send/Recive immediately after outlook starts"
- Previous message: Dmitry Streblechenko \(MVP\): "Re: FileAs"
- Next in thread: Dmitry Streblechenko \(MVP\): "Re: memory handling with properties"
- Reply: Dmitry Streblechenko \(MVP\): "Re: memory handling with properties"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|