Click to See Complete Forum and Search --> : How to pass pointer to string character


May 10th, 1999, 12:59 PM
I need to pass a pointer to a null-terminated string in the LPARAM of a SendMessage(...). I'm trying to do that
on Windows NT using UNICODE. I've tried several way, but without any success. Here is an example of what I'm
trying to do:

LPTSTR lpText = TEXT("\\My Documents\\Test.wav");
::SendMessage (hwndVoice, VRM_RECORD, NULL, (LPARAM)(LPCTSTR)lpText);


What is wrong with that??



Thanks
Frank

Michael Decker
May 10th, 1999, 02:34 PM
What's the problem you are having?

With what I see, I wouldn't save the pointer being passed for future use in the function that receives the message because it may go out of scope.

May 10th, 1999, 03:24 PM
I'm trying to send a filename to the Voice Control in WindowsCE. The only way, as the documentation says, is
to pass a pointer to a null-terminated string in the SendMessage. I'm not sure if the example I write before is correct,
but the control doesn't save my wav file in the filename I've specified.

An example showing how to pass a pointer to null-terminated string would be appriciated. I'm a newbie in passing pointer
to functions!

Thanks.
Frank