イベントとのマルチ スレッドを使用するには、#include <windows.h> が必要です
イベントでマルチスレッドを使用する場合は、windows.h ファイルが必要です。 このエラーを解決するには、イベント ソースとイベント レシーバーが定義されているファイルの先頭に #include <windows.h>
を追加します。
// C3724.cpp
// uncomment the following line to resolve
// #include <windows.h>
[event_source(native), threading(apartment)]
class CEventSrc {
public:
__event void event1(); // C3724
};
[event_receiver(native)]
class CEventRec {
public:
void handler1() {
}
void HookEvents(CEventSrc* pSrc) {
__hook(CEventSrc::event1, pSrc, CEventRec::handler1);
}
void UnhookEvents(CEventSrc* pSrc) {
__unhook(CEventSrc::event1, pSrc, CEventRec::handler1);
}
};
int main() {
}