char 配列を使用して動的な MessageBox を作成したいのですが、uType (UINT) に問題があります。
私のコードを見ると、最初に | を含む char 文字列があります。区切り記号であり、配列 "a" に解析されます。次に、charをUINTに変換しますが、機能しません。メッセージボックスが表示されません。助けてくれてありがとう:-)
char str[] ="Testing message|Title Message|MB_OK|MB_ICONINFORMATION";
char * pch;
char * a[4];
int i = 0;
pch = strtok (str,"|");
while (pch != NULL)
{
    a[i] = pch;
    pch = strtok (NULL, "|");
    //cout << a[i];
    i++;
}
char test[1000] = "";
strcat_s (test,a[2]);
strcat_s (test,"|");
strcat_s (test,a[3]);
UINT y;
stringstream s;
s << test;
s >> y;
MessageBox(0,a[0],a[1],y);
Sleep(10000);
解決 :
                        UINT x;
                            if(!strcmp(a[3],"MB_ICONERROR")){
                                x = 0x10;
                            }else if(!strcmp(a[3],"MB_ICONEXCLAMATION")){
                                x = 0x30;
                            }else if(!strcmp(a[3],"MB_ICONINFORMATION")){
                                x = 0x40;
                            }else if(!strcmp(a[3],"MB_ICONQUESTION")){
                                x = 0x20;
                            }
                            if(!strcmp(a[2],"MB_OK")){
                                x = x + 0;
                            }else if(!strcmp(a[2],"MB_OKCANCEL")){
                                x = x + 1;
                            }else if(!strcmp(a[2],"MB_YESNO")){
                                x = x + 4;
                            }else if(!strcmp(a[2],"MB_YESNOCANCEL")){
                                x = x + 3;
                            }else if(!strcmp(a[2],"MB_RETRYCANCEL")){
                                x = x + 5;
                            }else if(!strcmp(a[2],"MB_ABORTRETRYIGNORE")){
                                x = x + 2;
                            }
                            MessageBox(0, a[0], a[1], x);