I am trying to print out my player's x coordinate to the gui of my dll injected hack.
I know that xposition contains a DWORD of the address containing the player's x position, but I can't get it to assign its contents to the label xposStatus:
What is working (kinda)
This prints out what I wanted it to: the memory location holding my player's x coordinates. But that is only a small proof that I am on the right path.Code:xposStatus->Text = xposition.ToString();
Attempt 1: (The compiler yells at me)
Attempt 2: ("Error: invalid type conversion")Code:xposStatus->Text = *xposition.ToString();
Code:xposStatus->Text = *(DWORD *)xposition.ToString();
Attempt 3: (This compiles, but doesn't change the label at all)
Code:int test = *(DWORD *)xposition; xposStatus->Text = test.ToString();
How can I get that float value contained in xposition?
Last edited by Shadoninja; 05-13-2013 at 07:36 PM.
Yeah, it opens up a gui created from visual studios built in win32 application support. So the object on the gui that I am trying to change is the Text element of a Label^ object from System::Windows::Forms::Label^;
This is the same structure Fleep uses in one of his tutorials, but he only uses string literals to change certain label's text to "on" or "off." I want real-time information presented, which obviously requires variable input, and the label just isn't having it.
He wants to read a float from memory and convert it to a string
Code:DWORD position = *(DWORD_PTR*)xposition; xposStatus->Text = *(float*)position.ToString();
That line is giving me the "Invalid type conversion" error.
And the same error happens when I do it like thisCode:xposStatus->Text = *(float*)position.ToString(); underlined red^ (the carrot is pointing to it)
Honestly if there is a better way to set up the gui, I will be happy to do that. Even if its just a console window. I just want to learn a decent way of setting this all upCode:char* test = *(float*)position.ToString(); underlined red^