NVAPI.dl change display mode

Hi,
I’m trying to use the NVAP.dll to change the display setting, from clone view to dual and vise versa.
I’m having problem calling the NVAPI_INTERFACE NvAPI_SetView (NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargetInfo, NV_TARGET_VIEW_MODE targetView); function. Does enyone have code example how to call this function using C++ or C#?
Thanks,
Ben