Hi..I want to create a message box that displays the string from an array. Is it possible using MesasgeBox()?? I have tried passing the name of the array to the function but I looked around and found youd could pass only string to the function. So waht is the solution???
Secondly, I am using a switch case to respond to my messagebox but its not working. the code is:
#include<stdio.h>
#include<windows.h>
#pragma comment(lib,"user32.lib");
#include<string.h>
char abc[10] = "hello";
int msg_id;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
msg_id = MessageBox(NULL, *abc , L"MMI MESSAGE", MB_OKCANCEL);
switch( msg_id )
{
case IDOK:
return 1;
break;
case IDCANCEL:
printf("%d",msg_id);
return 0;
break;
default:
return 2;
}
getchar();
}
I think the msg_id should get printed but its not. What am I doing wrong? Any advice would be appreciated.thanks..