Problem using "cudaHostAlloc" in DLL

I use cuda_vs_wizard to create a DLL function involving a call to “cudaHostAlloc”, but when the dll function is called in another application, it says
"cudaSafeCall<> Runtime API error: setting the device when a process is active is not allowed.
Is there any limit in using it in DLLs?