CLI Form Application & CUDA


I made a c++ static library using CUDA, and linked it to a CLI form application.

Then, I encountered the below error when running the application.
Debug Assertion failed error in file dbgheap.c, Expression _CRTisValidHeapPointer(pUserData).

This error does not occur in the case of CLI console application.

I use CUDA 4.0 and Visual Studio 2008 (SP1).

Can anyone help me to solve it ?