|
-
Jun 30th, 2008, 04:01 PM
#1
Thread Starter
Hyperactive Member
-
Jun 30th, 2008, 04:05 PM
#2
Re: [2.0] Creating OCX in C# ?
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 (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • 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 i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 1st, 2008, 01:26 AM
#3
Re: [2.0] Creating OCX in C# ?
-
Jul 1st, 2008, 03:20 AM
#4
Re: [2.0] Creating OCX in C# ?
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 (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • 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 i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 1st, 2008, 05:52 AM
#5
Re: [2.0] Creating OCX in C# ?
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.
-
Jul 1st, 2008, 01:35 PM
#6
Re: [2.0] Creating OCX in C# ?
Allow me to interpret slightly differently.
http://www.codeproject.com/KB/miscct...incontrol.aspx
Vague questions are the best.
-
Jul 1st, 2008, 02:18 PM
#7
Re: [2.0] Creating OCX in C# ?
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 (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • 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 i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 2nd, 2008, 01:03 PM
#8
Thread Starter
Hyperactive Member
Re: [2.0] Creating OCX in C# ?
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
-
Jul 2nd, 2008, 03:03 PM
#9
Re: [2.0] Creating OCX in C# ?
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.
-
Jul 3rd, 2008, 01:48 AM
#10
Re: [2.0] Creating OCX in C# ?
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 (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • 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 i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 3rd, 2008, 09:44 AM
#11
Thread Starter
Hyperactive Member
Re: [2.0] Creating OCX in C# ?
Thanks, RobDog888!
I'll give it a try....
João Luiz
-
Jun 20th, 2012, 03:06 AM
#12
Member
Re: [Resolved] [2.0] Creating OCX in C# ?
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
-
Sep 1st, 2012, 09:04 PM
#13
New Member
Re: [Resolved] [2.0] Creating OCX in C# ?
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|