alrabaca
July 20th, 2007, 04:32 PM
Hi,
Im trying to convert a string value which is retrived from a listbox as shown here in my code:
HWND exWND = FindWindow(NULL, "Untitled - Notepad");
HWND exEB = FindWindowEx(exWND, NULL, "Edit", NULL);
int count = TForm1::ListBox1->Items->Count;
for(int x = 0; x < count; x++)
{
String combMessage;
combMessage = TForm1::ListBox1->Items->ValueFromIndex[x];
SendMessage(exEB, WM_SETTEXT, 0, (long)combMessage);
}
Basically when I compile it, I get an error:
[C++ Error] myfirstproject.cpp(87): E2031 Cannot cast from 'AnsiString' to 'long'
So my question, is there a way to change 'combMessage' from AnsiString to long so it would be compatable to go into my SendMessage function.
Thanks alot
Im trying to convert a string value which is retrived from a listbox as shown here in my code:
HWND exWND = FindWindow(NULL, "Untitled - Notepad");
HWND exEB = FindWindowEx(exWND, NULL, "Edit", NULL);
int count = TForm1::ListBox1->Items->Count;
for(int x = 0; x < count; x++)
{
String combMessage;
combMessage = TForm1::ListBox1->Items->ValueFromIndex[x];
SendMessage(exEB, WM_SETTEXT, 0, (long)combMessage);
}
Basically when I compile it, I get an error:
[C++ Error] myfirstproject.cpp(87): E2031 Cannot cast from 'AnsiString' to 'long'
So my question, is there a way to change 'combMessage' from AnsiString to long so it would be compatable to go into my SendMessage function.
Thanks alot