RLester Posted August 17, 2003 Posted August 17, 2003 Is there any way to use a custom .net control component in a VB 6 application (assuming the .net framework is installed), or is this just Pie in the Sky? Quote
AndreRyan Posted August 17, 2003 Posted August 17, 2003 If you're using VB.Net you can create a Control Class Library, put in a UserControl and use the attribute COMClass and then right-click the project choose Properties go to Configuration Properties>Build and check Register for COM Interop. I'm not sure how to get the component to function, however but it works well on normal classes. There is probably a better way. Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
RLester Posted August 18, 2003 Author Posted August 18, 2003 Hello and thanks. This was helpful, but I am still puzzled: I built a tiny test control component in VB.NET. It has a label with caption "Hello" and one method which shows a message box with "Hello". I followed your advice, and also build some GUIDs so the component would register. I did a build and it created a DLL. I went into VB6, and added the DLL to the references. Now, I can declare a new instance of the DLL library, and of the "control" (if it still is a control). I can call the Hello method and see the message box, but I can't figure out how to get the actual control to show. It does not show up in any tab on the compoenents toolbox, but the fact that a DLL was created rather than an OCX gives me a sinking feeling I'may have lost this little battle, if not the war. Microsoft has a page with a walkthrough for "components" at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/vawlkWalkthroughCreatingCOMObjectsWithVisualBasicNET.asp, BUT not mention of the word "Control". Perhaps I am out of luck? Any additional info or ideas on where to look would be greatly appreciated!!! Thanks again. Quote
*Gurus* divil Posted August 18, 2003 *Gurus* Posted August 18, 2003 You won't get a .NET Windows Forms Control on to a VB6 form. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.