Export (0) Print
Expand All
Expand Minimize

Compiler Error C3826

Error Message

'type': declaring pinned formal parameters is illegal

A function parameter cannot be decorated with the __pin keyword.

C3826 is only reachable using /clr:oldSyntax.

The following sample generates C3826:

// C3826.cpp
// compile with: /clr:oldSyntax /c
__gc class G {};

typedef G __pin * GPinPtrType;
typedef G * GPinPtrType2;

void func1(G __pin * x) {}   // C3826
void func1b(G * x) {}   // OK

void func2(GPinPtrType x) {}   // C3826
void func2(GPinPtrType2 x) {}   // OK

Community Additions

ADD
Show:
© 2014 Microsoft