Compiler Error C3744
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Error C3744

__unhook must have at least 3 arguments for managed events

The __unhook function must take three parameters when used in a program that is compiled for Managed Extensions for C++.

__hook and __unhook are not compatible with /clr programming. Use the += and -= operators instead.

C3744 is only reachable using /clr:oldSyntax.

The following sample generates C3744:

// C3744.cpp
// compile with: /clr:oldSyntax
#using <mscorlib.dll>
using namespace System;

public __delegate void delegate1();

[ event_source(managed) ]
public __gc class CPSource {
   __event delegate1* event1;

public __gc class CReceiver {
   void Handler1() {

   void UnhookAll1(CPSource* pSrc, CReceiver* pRec) {
      __unhook(pSrc);   // C3744
      // The following line resolves the error.
      // __unhook(&CPSource::event1, pSrc, &CReceiver::Handler1);

int main() {
© 2015 Microsoft