DWORD XShowMessageBoxUI( DWORD dwUserIndex, LPCWSTR wszTitle, LPCWSTR wszText, DWORD cButtons, LPCWSTR *pwszButtons, DWORD dwFocusButton, DWORD dwFlags, MESSAGEBOX_RESULT *pResult, XOVERLAPPED *pOverlapped )
Printable View
DWORD XShowMessageBoxUI( DWORD dwUserIndex, LPCWSTR wszTitle, LPCWSTR wszText, DWORD cButtons, LPCWSTR *pwszButtons, DWORD dwFocusButton, DWORD dwFlags, MESSAGEBOX_RESULT *pResult, XOVERLAPPED *pOverlapped )
this might help you guys out with what i mean
this is the documentation of what i am doing
picture 1 top of page
Attachment 30419
picture 2 bottom of the page
Attachment 30421
Doesn't the documentation says it all?
Do you have a problem with a specific parameter?
If you don't understand the documentation, your best bet is probably to google for the function name and find code examples of how someone else used it. For example:
http://forums.xbox-scene.com/lofiver...p/t706895.html
i mean like how would i do it like this
or what i really dont know the bit is confusing me is the ( ) instead of the { } i dont understand and want somone to explainQuote:
DWORD XShowMessageBoxUI(DWORD dwUserIndex,LPCWSTR wszTitle,LPCWSTR wszText,DWORD cButtons,LPCWST *pwszButtons,DWORD dwFocusButton,DWORD dwFlags,MESSAGEBOX_RESULT *pResult,XOVERLAPPED *pOverlapped);
The documentation is clear -- the function is defined, all parameters are described, etc.
It is assumed that the person reading the documentation already knows the C or C++ language. Documentation for library and library functions should not be used as a tutorial in learning the language. You need to learn the C++ language first (to the point you know what functions are, how to call them, what pointers are and how to use them), before you understand technical documentation such as what you've presented.
Regards,
Paul McKenzie
thats why i came here for help i know some cpp but not all i just wanted somone to give me a little tip as i have been trying to work it out for hours i have not just looked at it and thought i cant do that and posted on here i looked at it for hours and tried it many different ways
Again, the function is completely documented. What is required is that you know how to read the documentation, and it seems you don't know how to read documentation to C++ functions.
The authors of the documentation assume you know C++ already -- the authors have done what is required to relay the information to you on what is required to call the function (that's why you had the earlier response of "the documentation says it all"). The only thing missing is example of usage in a mock function or code, but that can probably be found by doing a web search.
All this suggests that you do not know C++ enough to understand how to call functions, and learning how to do that is done by books and tutorials, not a programming board such as CodeGuru. I could understand if you wrote a valid program (compiled, linked, etc.), and at runtime the function call failed (error return code, exception thrown, etc.), but what you're stating is that you don't understand basic C++ syntax with respect to calling functions and therefore can't write your program.
You should post your attempts.Quote:
i have been trying to work it out for hours i have not just looked at it and thought i cant do that and posted on here i looked at it for hours and tried it many different ways
Regards,
Paul McKenzie
yes i do m8 i got this so far
and then i have thisQuote:
DWORD XShowMessageBoxUI(DWORD dwUserIndex,LPCWSTR wszTitle,LPCWSTR wszText,DWORD cButtons,LPCWSTR *pwszButtons,DWORD dwFocusButton,DWORD dwFlags,MESSAGEBOX_RESULT *pResult,XOVERLAPPED *pOverlapped)
but the L on the play modz gives me this errorQuote:
z = XShowMessageBoxUI (XUSER_INDEX_ANY,L"Stelth V1",L"Thanks For Chossing Stelth V1. Stelth V1 Is Now Fully Loaded. HAVE FUN!!!",1,L"Play Modz",1,XMB_ALERTICON,NULL,NULL);
Error: argument of type "const wchar_t*" is incompatible with parameter of type "LPCWSTR *"
Did you read the documentation carefully? That argument is supposed to be an array of Unicode strings, not a Unicode string.
Look at the cButtons argument -- did you read the description? What if you had 2 or more buttons? How would you specify these buttons in that function call?
So the next question is this -- do you know what an array is and how to pass this array of strings?
Regards,
Paul McKenzie
You don't understand pointers? In fact, how can you write a coherent, C++ program without knowing what pointers are, how to use them, and how to read simple documentation? I'm sure your program isn't just one line.
As I stated earlier to you, the documentation assumes you know C++. If you don't know C++, then of course you won't understand the documentation. I don't know how much simpler I can make this point to you.Quote:
at all no offence but the documentation just makes things harder
This is how every author who is responsible enough documents their functions. Get used to it (meaning this -- learn C++ properly, and you won't get confused).
Regards,
Paul McKenzie
i know how to do one to a variable but i cant find any how to do one to a function anywhere
It isn't a pointer to a function. The function requires addresses passed to it for the last two arguments. An address is the same as a pointer. So you declare a variable of type T, and then pass the address of that variable (meaning you're passing a T*). I won't go any further -- look up what the address-of operator (&) does.
Secondly, what if you do finally get this to build successfully. Are you going to have the ability to debug your program if there are runtime errors?
Regards,
Paul McKenzie
You don't learn basics by trying to write programs like this. Where are the "Hello World" programs, or simple main() programs that demonstrate simple usage of pointers, functions, etc? Why are you even looking at functions such as the one you're trying to call? It's like trying to learn to play the piano by looking at something Listz or Chopin wrote.
Why are you not practicing things like this first?Code:void SomeFunction(int *p)
{
*p = 10;
}
int main()
{
int myP = 0;
SomeFunction( &p );
}
I think you're too enamored by trying to use advanced concepts because you want to have "cool" graphics. Instead you should be writing simple programs so that you know what you're doing.
Regards,
Paul McKenzie
Then explain the program I wrote above. It uses pointers in exactly the same way that the function you're having trouble with. If you know what that program does, then why are you having so much trouble with writing the code to call your function?
There is virtually no difference in the code I wrote, and the function you're trying to call. The function takes a pointer, and your mystery function also takes a pointer, the only difference being the data type. My code calls the SomeFunction() correctly, but you say you can't figure out the syntax to call your function. So the only conclusion is that you are not retaining what you've learned, or you never learned the "easy stuff" properly, or you're not using what you know and applying it to a real program.
The SomeFunction() description would be something like this:
Does that look familiar? It looks identical to the documentation to your function's arguments, with the one exception that the type is int. So replace my "int" with the type that your function wants to use.Quote:
SomeFunction( int *ptrInt )
Usage:
[in] ptrInt - integer value to set
Also, just because a program is small doesn't mean it's "easy". What do you mean by "easy"? Honestly, you need to learn the basics of C++, and not try and cherry-pick topics so that you can create some sort of GUI program. If there is a concept in C++ you don't understand, then write a simple program and test out the concept before you apply that concept to a larger program.
Regards,
Paul McKenzie
Regardless of whether you find it easy or not, you really need to learn it so that you don't get hung up on a function call for six weeks. As for "how would you to a pointer to a return?", that doesn't make any kind of sense.
We see this quite a bit here. People try to take short cuts and dive in way over their heads then come here for explanations. It's not that we're not willing to help, but it's frustrating when people ask questions that don't make sense or ask questions that they lack the foundation to understand the answer.
This is a complex language with many concepts and nuances that need to be mastered. There really are no short cuts, even if you're experienced in other languages.