Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have vs 2012 ,and i want 2 get all serail port of the computer,
For this i have written code as
//  com = AutomationFactory.CreateObject("ComInterOp_SeeLevel828_Utility");
com = AutomationFactory.GetObject("InteropComObjects.IO.Ports.SerialPort");
 dynamic count = com.GetDeviceCount();
 StringBuilder sb = new StringBuilder();

 List<dynamic> devices = new List<dynamic>();
 for (int i = 1; i <= 9; i++)
 {
     devices.Add("COM" + i);
 }

 for (int i = 0; i < count; i++)
 {
     devices.Add(com.GetDevice(i));

 }
 cmdSerial.ItemsSource = devices;

But i am getting error in the line
com = AutomationFactory.GetObject("InteropComObjects.IO.Ports.SerialPort"); 

as No object was found registered for specified ProgID.
Please help
Posted
Comments
Mycroft Holmes 28-Feb-13 1:23am    
What error are you getting, if it is a security error you will need to take the app out of browser!
aassaahh 28-Feb-13 3:24am    
I am getting error as "No object was found registered for specified ProgID" . my application is out of browser.

1 solution

Hi, I found some samples about AutomationObject:
COM Support Samples[^]

Access to System's Devices[^]

Now in your case you must verify something Is InteropComObjects running at the time? It must be running in order to use the API.

Hope it helps in any way.
 
Share this answer
 

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