Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to call c++ method from wcf service for get ip camera status.

Bellow code run successfully using wpf application but i want to run this method in wcf library then consume in wpf application.

when call method from wcf library then throw exeption.
[DllImport(@"C:\dhnetsdk.dll")]
private static extern bool CLIENT_Init(fDisConnect cbDisConnect, IntPtr dwUser);


Please give solution on urgent basis.

Thanks & Regards

Chandrashekhar Sharma
Posted
Comments
Afzaal Ahmad Zeeshan 19-Dec-15 5:02am    
What exception is thrown?
Sergey Alexandrovich Kryukov 20-Dec-15 1:08am    
It doesn't matter where you use P/Invoke. But using hard-coded file path like "C:\dhnetsdk.dll" anywhere is totally wrong, and "C:" is not a legitimate location. There are no cases when hard-coded file path could be useful in any production-grade application.
—SA
chsharma1990 22-Dec-15 23:41pm    
I have already used this method after placing dhnetsdk.dll in bin directory of apllication but again found error.
[DllImport("dhnetsdk.dll")]
private static extern bool CLIENT_Init(fDisConnect cbDisConnect, IntPtr dwUser);

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900