1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

STDAPIなexport関数をGetProcAddressで受け取るときのtypedef

Posted at

何度も忘れるので。

STDAPI <a-win32-api-name>(<an-api-signature>);

な関数のアドレスをポインタで受け取る時は

typedef HRESULT (STDAPICALLTYPE *<pointer-name>)(<an-api-signature>);

と書きましょう。

typedef STDAPI (*<pointer-name>)(<an-api-signature>);

とか適当に書くと

typedef "C" HRESULT __stdcall (*<pointer-name>)(<an-api-signature>);

と展開されて、 error C2159: more than one storage class specified で蹴られます。
(typedefとexternが被ってる)

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?