0

動作するソースコードを作成しようとしています

extern "C" {
    typedef LRESULT (__stdcall *NRI_PM_CALLBACK)(WPARAM, LPARAM);
}

LRESULT OnPaymentManagerMessage(WPARAM wParam, LPARAM lParam)
{
    int type = (wParam >> 4) & 0x0F;
    int device = wParam & 0x0F;
    //cstr.Format("** Msg **[ %d %d %d ]", type, device, lParam);
    //handle message here
    return lParam;
}

NRI_PM_CALLBACK callback = &OnPaymentManagerMessage; //error on this line 

エラー:タイプ「LRESULT(*)(WPARAM wParam、LPARAM lParam)」の値を使用して、タイプ「NRI_PM_CALLBACK」のエンティティを初期化することはできません

これをVisualStudioExpress2012で実行しています

なぜアイデアはありますか?

ありがとう

4

1 に答える 1

3

関数を作成OnPaymentManagerMessage()__stdcallます。

LRESULT __stdcall OnPaymentManagerMessage(WPARAM wParam, LPARAM lParam) 
/* ... */

__cdeclはコンパイラのデフォルトです(ただし、コンパイラオプションで変更できます)。

于 2013-02-28T08:35:49.657 に答える