C++ code(working) { void CALLBACK MessageCallback(LONG lCommand, NET_DVR_ALARMER *pAlarmer, char *pAlarmInfo, DWORD dwBufLen, void* pUser) NET_DVR_ALARMINFO m_struAlarmInfo; memcpy(&m_struAlarmInfo, pAlarmInfo, sizeof(NET_DVR_ALARMINFO)); } C# code (Not working) { public void MessageCallback(Int32 lCommand, ref CHCNetSDK.NET_DVR_ALARMER pAlarmer, [MarshalAs(UnmanagedType.LPStr)] string pAlarmInfo, UInt32 dwBufLen, IntPtr pUser) CHCNetSDK.NET_DVR_ALARMINFO m_struAlarmInfo; Array.Copy(m_struAlarmInfo, pAlarmInfo.ToCharArray(), (int)dwBufLen); } Some how for the C# code cannot work when i debug the code it will give me error Error 1:The best overloaded method match for 'System.Array.Copy(System.Array, System.Array, int)' has some invalid arguments Error 2 :Argument '1': cannot convert from 'AlarmMgtApps.CHCNetSDK.NET_DVR_ALARMINFO' to 'System.Array' anyone keen to help?