Home » C# Programming

C# program to share screen using RDPCOMAPILIB.dll


i'm getting this error when i try to share screen from my notebook connected to the router using wifi n my pc by ethernet

"System.ArgumentException: Value does not fall within the expected range.

   at RDPCOMAPILib.IRDPSRAPIViewer.Connect(String bstrConnectionString, String bstrName, String bstrPassword)

   at AxRDPCOMAPILib.AxRDPViewer.Connect(String bstrConnectionString, String bstrName, String bstrPassword)"

this error comes each time i try to connect it

axRDPviewer.connect(Connstring,"user1", "");

I cant get this corrected...


It works perfect when i do it on my pc

but aint working when try to share my notebook screen...


the Connstring is being sent by Tcp message(Send and receive)...


Can u tell me where is the source of the problem... How can i take care of this???


4 Answers Found


Answer 1

Somebody Plz help me.. I cant find any kind of mistake... wats the error causing factor...

Answer 2


Here is a very helpful blog about this topic for your references, http://daron.yondem.com/PermaLink.aspx?guid=d8bbab27-169d-43d4-aea7-494845891789

Could you please make your scenario and the repro steps be more detailed?  Also, if you can provide us with some sample codes, it would be much helpful for us to troubleshoot the issue.

Have a nice weekend!



Answer 3

the code in the tutorial and that in my project is same... the difference is that the invitation message in the tutorial is being copied and then send to the viewer by user interaction. while in my project it is automated.. the invitation is sent to the viewer by tcp/ip message... the issue is not there when its done on the same pc.. i encounter this problem when i work on lan... when my host is on one system and viewer is on another system connected by LAN (Wifi/ethernet)... Do u still need the codes...


my project is in c#...


Thank u for the tutorial.... I guess i need some more help...

Thank u...



Answer 4

Hi Ayan,

I performed some tests at my lab.  Two Windows 7 systems, one for host and one for viewer.   The viewer is connecting by Wifi.   The share desktop apps work fine.   Could you please tell us what Windows version are you using on the host and viewer systems? 

BTW, when I copy/paste the connection string value from the host to the viewer, if we change the value even a single word, I can repro the error message : Value does not fall within the expected range.  So, could you please double check whether the connection string is the same between the host and the viewer? 

Good day!




<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure