Hi, there!
I what to know if it's possible to create an OCX in C#, and if it's possible, what's the way ?
I have no clue...![]()
![]()
Thanks in advance,
João Luiz
Hi, there!
I what to know if it's possible to create an OCX in C#, and if it's possible, what's the way ?
I have no clue...![]()
![]()
Thanks in advance,
João Luiz
Last edited by Jlarini; Jul 3rd, 2008 at 09:45 AM.
nothing is impossible, it's sometimes very hard to do!![]()
If your thread is solved... Please edit it and add [Resolved] or [Solved] on it!
If you like Marine aquarium, feel free to PM me.
Sorry my bad English
God bless Parksie!
AFAIK, you can not create ocx controls in .NET. You would need to use Visual Basic 6.0 to create an ocx. In .NET your equilivalent would be a .NET user control of dll file entension that will only natively work in a .NET project.
VB/Office Guru™ (AKA: Gangsta Yoda™®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (VBA, VB 6, VB.NET, C#)
Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Star Wars Gangsta Rap • Reps & Rating Posts • VS.NET on Vista (New) • Multiple .NET Framework Versions (New) • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007
2007-2013
Why is my data not saved to my database? | Communicating between multiple forms | MSDN Data Walkthroughs
MSDN "How Do I?" Videos: VB | C#
VBForums Database Development FAQ
My CodeBank Submissions: VB (*NEW* Match Two Game, *NEW* More Random Random Numbers) | C# (*NEW* Match Two Game, *NEW* More Random Random Numbers)
My Blog: Using Parameters in ADO.NET | Keyboard Events | Assemblies & Namespaces
Well thats not really an ActiveX ocx control but an exposed .NET dll control that registers and unregisters etc. to simulate an ocx but if it helps it help.
VB/Office Guru™ (AKA: Gangsta Yoda™®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (VBA, VB 6, VB.NET, C#)
Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Star Wars Gangsta Rap • Reps & Rating Posts • VS.NET on Vista (New) • Multiple .NET Framework Versions (New) • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007
I guess to be specific an OCX is an ActiveX control and ActiveX is inherently a COM technology. .NET and COM are mutually exclusive. When using COM components, like ActiveX controls, in .NET apps you have to wrap them in managed code. Your app talks to the managed wrapper and it handles the curly job of actually interacting with the COM component. To it feels like you're using the COM component directly but you're actually using a .NET likely that uses the COM component. That's what the Interop DLLs are that you have to distribute with your app when you use COM components.
The other way is similar. You can't create COM components, like ActiveX controls, in .NET languages. What you can do is create .NET components that, through some jiggery-pokery, appear to be COM components to COM applications.
Rob, I know you know all this already but I'm just clarifying for the populous.
2007-2013
Why is my data not saved to my database? | Communicating between multiple forms | MSDN Data Walkthroughs
MSDN "How Do I?" Videos: VB | C#
VBForums Database Development FAQ
My CodeBank Submissions: VB (*NEW* Match Two Game, *NEW* More Random Random Numbers) | C# (*NEW* Match Two Game, *NEW* More Random Random Numbers)
My Blog: Using Parameters in ADO.NET | Keyboard Events | Assemblies & Namespaces
Allow me to interpret slightly differently.
http://www.codeproject.com/KB/miscct...incontrol.aspx
Vague questions are the best.
Another way to look at it is "Why create or simulate an ocx in .NET" when you can create a user control in .NET for use in either .NET or expose the COM and use in any other language?
Bottom line, where are you going to be using the desired "ocx" control? .NET or VB 6 or ???
VB/Office Guru™ (AKA: Gangsta Yoda™®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (VBA, VB 6, VB.NET, C#)
Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Star Wars Gangsta Rap • Reps & Rating Posts • VS.NET on Vista (New) • Multiple .NET Framework Versions (New) • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007
Thanx for the answers guys!
RobDog888,
Answering your question, I would use it with VB6...
I have an .OCX created in VB6 which is in use right now, but we are migrating the system to C# and, in a first moment, we thought to make this .OCX (in C#) to interact with the current app's version, to make it faster, until we migrate all the system...
As this .OCX has some forms, it's problematic to create a .dll, and, I read somewhere, that's not possible to put forms into a .Dll...
Well, I'm making a revision on the current OCX version to make it faster...
Thanks,
João Luiz
nothing is impossible, it's sometimes very hard to do!![]()
If your thread is solved... Please edit it and add [Resolved] or [Solved] on it!
If you like Marine aquarium, feel free to PM me.
Sorry my bad English
God bless Parksie!
You can still use COM/ActiveX components in .NET. Add a new component to your toolbox, then browse to your existing (and registered) COM component.
In that case you may want to look into the Forms Interop Toolkit.
http://msdn.microsoft.com/en-us/vbasic/bb419144.aspx
It allows you to use .NET forms and controls in a VB 6 program.
VB/Office Guru™ (AKA: Gangsta Yoda™®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (VBA, VB 6, VB.NET, C#)
Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Star Wars Gangsta Rap • Reps & Rating Posts • VS.NET on Vista (New) • Multiple .NET Framework Versions (New) • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007
Thanks, RobDog888!
I'll give it a try....
João Luiz
nothing is impossible, it's sometimes very hard to do!![]()
If your thread is solved... Please edit it and add [Resolved] or [Solved] on it!
If you like Marine aquarium, feel free to PM me.
Sorry my bad English
God bless Parksie!
Hello Jlarini,
Did you sove your issue?
I'm having a same issue with little different.
we are not migrating code from vb6.0 to C#.net.
Actually My Requirement is, I have a spreadsheet control. I want add an Image over a spreadsheet NOT in a CELL. I can't find any solution in vb6.0 so I choose below idea,
I need to use C# farpoint third party control in vb6.0. reason, in c# Farpoint spread have a method of shapes. We can add image and edit image over the spreadsheet not in cell. but this property don't have shapes or add image over spreadsheet in VB. So, I would like to create OCX in C# and use in VB6.0.
Can you give me any idea? Can you give me some code help.
Thanks,
thenndral
I know this is an older post so this may even be harder to answer since it's almost 2013. But for those of us who still develop in MS Access and other OCX environments... how is it that we are susposed to create our own ActiveX controls these days? Do I have to go out and try and find an old version of VB6? Their has to be an I.D.E. somewhere that is capable of outputting real OCX ActiveX Controls... I hope anyway?
Their has to be... I mean MS Access 2010 still uses OCX right? Or did they switch to the new .Net control? If they did switch in which year... 2007?
Any and all responses would be appreciated... I posted on another forum and no one seemed to have an answer to these questions... Everyone seems to know that you cant create real OCX controls with .Net... but no one seems to provide a solution as to how you create them these days.
thanx