Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ C# ActiveX
Hi,
 
I have a device controlled by a controller with a software interface. I do not have any documentation regarding SDK available but a manual for software.
 
This software has .dll files and .ocx files available in it's Binaries folder.
 
I want to develop a custom application in C# to communicate with the controller using available .ocx and .dll files.
 
First of all I want to know if this task is achievable. Secondly, if it is achievable then how?
 
Can .ocx files be of any help to me? I do not know what to start with.
 
Kindly, help me in this regards.
 
Cheers,
 
Proof.
Posted 10-Apr-13 0:45am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

It depends if the a typelib is available for the OCX. It may be included as a resource in the binary or somewhere else. The quickest way to check that is to add OCX reference in C#. "Add Reference->Browse". Visual Studio will try to create a wrapper of the ocx. If it succeeds you may start controlling the ocx from C# code. You don't have any documentation so that you should guess the behavior from property and method names.
  Permalink  
v2
Comments
Member 8772143 at 10-Apr-13 20:05pm
   
I tried doing so but it gives an error "A reference to abc.ocx could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component". I rather added the component to the tool box and dragged and dropped it onto a form.
Babak Mahmoudi at 10-Apr-13 23:26pm
   
I cannot figure out any resolution. Is this OCX part of a large application so that it depends on other components? Can you send me the OCX file?
Member 8772143 at 15-Apr-13 3:46am
   
Hi Babak,
 
How shall I send you the file?

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

  Print Answers RSS
0 OriginalGriff 190
1 PIEBALDconsult 150
2 BillWoodruff 148
3 DamithSL 140
4 Jochen Arndt 125
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,190


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 10 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100