How to convert OCX file into C#
-
Hi Everyone, I have a project which was written long time back. Now we are in position to convert into C# source code but we found that we donot have any source code. I need two favors from you. 1. How to convert the ocx file into C# source code without having the source code 2. How to convert VC++ source code into C# soruce code. Thanks in advance
-
Hi Everyone, I have a project which was written long time back. Now we are in position to convert into C# source code but we found that we donot have any source code. I need two favors from you. 1. How to convert the ocx file into C# source code without having the source code 2. How to convert VC++ source code into C# soruce code. Thanks in advance
dwark106 wrote:
1. How to convert the ocx file into C# source code without having the source code
Why? If your
COM
component works well, just use it in aC#
application (viaCOM interop
). If you're stuck with the 'conversion' requirement, I suppose the easier solution is implementing from scratch theCOM
object functionality (i.e. 'the black box' way) inC#
(in other words, I believe reverse engineering is not a good solution of your problem).dwark106 wrote:
2. How to convert VC++ source code into C# soruce code.
For a
C++
andC#
expert the task should be fairly straightforward (if you were an expert of both languages then you probably wouldn't do or ask about...). :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Hi Everyone, I have a project which was written long time back. Now we are in position to convert into C# source code but we found that we donot have any source code. I need two favors from you. 1. How to convert the ocx file into C# source code without having the source code 2. How to convert VC++ source code into C# soruce code. Thanks in advance
- Learn assembler. Disassemble OCX. Spend lots of time working out what the heck is going on. Code it in c# 2) Learn C++. Learn C#. Translate. To be honest, if you are lacking the source code for the OCX, then the best thing you can do is re-write it from the original specification. Or (more likely) write the spec from the OCX behaviour, and then rewrite the OCX. Good luck - you may need it...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
-
dwark106 wrote:
1. How to convert the ocx file into C# source code without having the source code
Why? If your
COM
component works well, just use it in aC#
application (viaCOM interop
). If you're stuck with the 'conversion' requirement, I suppose the easier solution is implementing from scratch theCOM
object functionality (i.e. 'the black box' way) inC#
(in other words, I believe reverse engineering is not a good solution of your problem).dwark106 wrote:
2. How to convert VC++ source code into C# soruce code.
For a
C++
andC#
expert the task should be fairly straightforward (if you were an expert of both languages then you probably wouldn't do or ask about...). :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Hi Pallini, Thanks for your response. 1. Actually I donot know what are the functions are being used by this application(ocx). I am also thinking to write from the scratch, but I do not have source code, so that I can chop the function that is not needed. 2. I was looking the easier way to convert the application. Anyways I will take your suggestions.
-
Hi Everyone, I have a project which was written long time back. Now we are in position to convert into C# source code but we found that we donot have any source code. I need two favors from you. 1. How to convert the ocx file into C# source code without having the source code 2. How to convert VC++ source code into C# soruce code. Thanks in advance
There are no conversion tools and nothing that is going to generate any kind of C# code for you. You have no choice but to study the existing OCX control and redesign and recode the control by hand in C#, or any other language for that matter.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008