Click here to Skip to main content
16,012,316 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: STD Error: Pin
Rama Krishna Vavilala3-Jun-02 16:53
Rama Krishna Vavilala3-Jun-02 16:53 
GeneralRe: STD Error: Pin
Sidney3-Jun-02 16:58
Sidney3-Jun-02 16:58 
GeneralRe: STD Error: Pin
Rama Krishna Vavilala3-Jun-02 17:01
Rama Krishna Vavilala3-Jun-02 17:01 
GeneralRe: STD Error: Pin
Sidney3-Jun-02 17:08
Sidney3-Jun-02 17:08 
GeneralRe: STD Error: Pin
Rama Krishna Vavilala3-Jun-02 17:19
Rama Krishna Vavilala3-Jun-02 17:19 
GeneralRe: STD Error: Pin
Sidney3-Jun-02 17:15
Sidney3-Jun-02 17:15 
GeneralGetMessage Pin
wilche3-Jun-02 15:33
wilche3-Jun-02 15:33 
Hi Everyone,

I need some help!!!

I have been retrieving my messages from the message queue in my thread using the GetMessage().

I've placed the message inside the MSG structure and retrieve the messaage contents by referencing msg.wParam. msg.wParam is an UINT value that represents the address of msg content, in this case, a dynamically allocated char * pointer.

After using this string, I wanted to deallocate the memory for this char *ptr, doing this.

delete (char *) msg.wParam;

It compiles but didn't work. As suspected, msg.wParam isn't a ptr, it's an address! So I tried this.

char *tmp;
tmp = (char *) msg.wParam;
delete tmp;

It compiles Same problem. So what can I do?
Everytime a new msg comes, the information in msg.wParam is rewritten. But I'm pretty sure that the memory allocation remains!
Confused | :confused:

Any help on this problem is greatly appreciated! Thanks!
wilche
GeneralRe: GetMessage Pin
John M. Drescher3-Jun-02 17:13
John M. Drescher3-Jun-02 17:13 
GeneralRe: GetMessage Pin
Rama Krishna Vavilala3-Jun-02 17:16
Rama Krishna Vavilala3-Jun-02 17:16 
GeneralRe: GetMessage Pin
wilche3-Jun-02 17:25
wilche3-Jun-02 17:25 
GeneralRe: GetMessage Pin
John M. Drescher4-Jun-02 9:41
John M. Drescher4-Jun-02 9:41 
Questionsetting scroll lines under Win98 ??? Pin
Alek3-Jun-02 15:20
Alek3-Jun-02 15:20 
QuestionMEMdc not working with SetWindowOrg? Pin
aldeba3-Jun-02 14:49
aldeba3-Jun-02 14:49 
AnswerRe: MEMdc not working with SetWindowOrg? Pin
Ed Gadziemski3-Jun-02 15:14
professionalEd Gadziemski3-Jun-02 15:14 
GeneralRe: MEMdc not working with SetWindowOrg? Pin
aldeba3-Jun-02 15:48
aldeba3-Jun-02 15:48 
GeneralRe: MEMdc not working with SetWindowOrg? Pin
Ed Gadziemski4-Jun-02 3:50
professionalEd Gadziemski4-Jun-02 3:50 
QuestionHow do i make a fully-qualified PIDL out of a single-level PIDL? Pin
redeemer3-Jun-02 13:24
redeemer3-Jun-02 13:24 
QuestionSpin Control ?? Pin
BlackDogEngineering3-Jun-02 13:16
BlackDogEngineering3-Jun-02 13:16 
AnswerRe: Spin Control ?? Pin
aldeba3-Jun-02 14:38
aldeba3-Jun-02 14:38 
GeneralChanging Treeview TVS_INFOTIP timeouts Pin
Hydra3-Jun-02 12:19
Hydra3-Jun-02 12:19 
GeneralDebugging causing exceptions Pin
moredip3-Jun-02 12:14
moredip3-Jun-02 12:14 
GeneralRe: Debugging causing exceptions Pin
Alexandru Savescu4-Jun-02 0:53
Alexandru Savescu4-Jun-02 0:53 
GeneralComboBox & autocompleting with visibled droplist & error in Win98 Pin
Wizard_013-Jun-02 11:55
Wizard_013-Jun-02 11:55 
GeneralPointer and Arrays Pin
RaphaelBr3-Jun-02 11:33
RaphaelBr3-Jun-02 11:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.