WPARAM of a message with a String

Hi everybody:
I'm trying to send a message between two windows and the WPARAM should be the String, which is contained in a textbox of the senderwindow. I'm programming in C++/CLI.
I know that WPARAM is defined als UNIT_PTR. I tried to cast, but it doesn't work.
SendMessageW(handle,WM_USER+40,(WPARAM)(this->TextBox->Text),(LPARAM)i)

How can I pass the string in the message???

Thanks in advance

garrido
If the two windows are two forms in the same executable, just add a new property to the receptor form of type String^.
Thanks for your reply, webJose. But I don't understand.
Yes the windows are 2 forms in the same executable, but the Textbox is a private member, so I cannot access it from other window.
I think your recommedation was:
String^ mystring = SenderWidow::TextBox->Text
isn't it??

In the form that needs to receive the string:

1
2
3
4
5
6
7
8
9
10
11
12
public:
    property String^ TheText
    {
        String^ get()
        {
            return privateTextbox->Text;
        }
        void set(String^ value)
        {
            privateTextbox->Text = value;
        }
    }


Now all you have to do is set the string using the above property.
Topic archived. No new replies allowed.