• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

need help type casting

polarbear6

Golden Member
iam no programmer
i only do some casual php scripting
i mostly do web programming
i seldom do programming and i seldom ^ 10 do windows programming
and even if i do i do it in in vb or vc#

but this time i decided to get my hands dirty and do some winapi programming(i know its a big step but have to do it)

EDIT:THIS IS IN C, my god iam becoming so forgetful

know the problem is i have a button which on clicking should add two numbers and show them in a message box
but how to type cast the sum to a string or a dword
i tried (variabletype) variable value
but my programming just crashes 😱
what can be the reason

also i am looking for nice tutorials on winapi programming
and some tutorials on pointers ....

 
Assuming C:

char buff[16];
int myInt = 7;
snprintf(buff,16,"%i",myInt);

// Now pass buff to your MessageBox
 
There might be any number of reasons for that. Post some code and we'll take a look at it.
 
nvm i was pointelessly coding(experimenting)

but how to add two numbers in windows.h
like
int a =7;
int b = 8;
int c = a + b;
when i tried it i get this error
initalizer element is not constant



 
It sounds like you're trying to use them as global variables. Try inside of a function - if it's just throwaway code, main().
 
well is it possible to make interactions to outside world from inside the int main()
i mean i need to get a message box for the sum
but then is it possible to throw a message box from with in int main()

and besides if i open a main()
my window wont show up

 
Back
Top