VB6 Project and Visual Studio 2010

Is it possible to reference a Rhino VB6 project in Visual Studio 2010? Can I just add the VB6 files to the project or do they all need to be converted?

Rhino VB6? What kind of project is this?

@Dale I’m working with Ray McKaig the author of Boltgen to create a UI for Rhino, his code was all written in VB6 and we are just wondering what kind of mess we might be getting into.


Hi Don,

Well, VB 6.0 was discontinued in March of 2005 (yikes). And, you cannot use it to create plug-ins for Rhino. About all you can do with it is create COM (ActiveX) components that display UI and then call these components from RhinoScript or some other language.

Going forward, you might want to consider porting all this to VB.NET. If you wanted to use the UI in something other than Rhino, then just add it to a .NET class library and then reference it from a RhinoCommon plug-in.

– Dale

I’m confused by this statement, Ray wrote the plugin for Rhino in VB6 and it does work, I’m pretty sure Dan Bayn writes his code in VB6 as well. Can you elaborate on this a little? (I never did anything with VB6/Rhino)

Going forward I realize that the UI elements are going to need to be written in VB.NET, and that was/is the plan, I could pass him an array of settings, if need be, but I think it would be best to bring all the code into VB.NET, I’m just not sure how well they will play together. Can it be added to the solution in VB6 format?

I have a preliminary design of the panel done, I just need to know the best way to go forward, whether to spend the time converting the code or just create an array and pass it to him.

I’m sure you can call VB6 DLLs from VB.NET. That being said I think it is going to be a debugging and maintenance nightmare. I’m also pretty sure that VB6 is processor specific which means it will only run on 32bit Rhino.

It would be best to convert the code to VB.NET and I believe there was a converter that Microsoft wrote. How easy of a task this is depends on the amount of code involved.

As far as your original question, most likely there is no support for VB6 projects to be included in Visual Studio 2010. That would require Visual Studio to include the VB6 compiler which I think they stopped supporting. I could be wrong and a little searching of the internet may help, this is just my guess.

Hi Don,

It is my understanding that BoltGen is a Monkey-compiled, RhinoScript plug-in. The UI is definitely RhinoScript. We have never supported Visual Basic 6.0 plug-ins in any version of Rhino (although you can use VB6.0 components in a plug-in, as mentioned by Steve).

Well that makes sense, he sent me one piece of code he had tried to convert:
choice = Rhino.ListBox(array{txt1, txt2}, pt, pt1, choice)
converted to:
'UPGRADE_WARNING: Array has a new behavior.
'UPGRADE_WARNING: Couldn’t resolve default property of object Rhino.ListBox.
'UPGRADE_WARNING: Couldn’t resolve default property of object choice.
choice = Rhino.ListBox(New Object(){txt1, txt2}, pt, pt1, choice)

(That is strange the upgrade text is not wrapping in the editing window, but does in the preview and post.)

However I did not know that:

So I assumed when he said VB6, that it was all VB6 code. I guess I’ll have to clarify that with him.

I used VB6 to create the BoltGen.rvb file, just a module in VB6. After testing validity (runs in VB6 and calls Rhino functions externally), I take the VB6 module and alter 2 lines … remove the module name at the top and activate a call to the program just like in the Rhino Script language. That file can be loaded into the Rhino Script editor and run. At that point, Monkey compiler can convert it into a plug-in.

VB6 is a sloppy language, and takes care of variable types automatically, where NET and C++ require declarations (although one can get by with VB NET using unknown variable types just like VB6 but it complains with messages). VB2008 has a conversion wizzard when opening VB6 programs. Later versions of VB NET dumped the converter, so the program must first be converted with VB2008 and upgraded from there.

I ran a conversion using VB2008 on BoltGen but I did not know how to reference the rhinocommon.dll so that the converter could use function call prototypes. Any help would be much appreciated.

Don is working on the possibility of creating a front panel to access the BoltGen program, a fine idea but tricky to implement as far as I can see. Since I have had virtually no exposure to VB NET, it is a mystery.
Regards, Ray McKaig

Well it sounds like reading your description, you used VB6 as an editor window, but what you really have is a rhinoscript. Does that seem like an accurate statement?

Very close. I believe RhinoScript was developed from VB6 initially and is virtually 100 percent compatible with the Script coding with few exceptions. I use VB6 as my program development system. It launches Rhinoceros automatically if it isn’t loaded yet and makes calls to control Rhinoceros. At that point Rhinoceros is just a graphics engine being driven by VB6 calls. It has proven to be an excellent development system since I can run it in debug interpretive mode with steps and breakpoints, and compile it into an executable if need be. Variable values can be changed on the fly for testing. No compilation is necessary to run a test which leads to rapid development.

Hi Ray,

RhinoScript is written in C++ and uses the Windows Script interfaces.


RhinoScript uses Microsoft’s VBScript, which is not as feature-rich as VB6. Specifically, VB6 has a lot of user interface tools that VBScript doesn’t have.

Developing a user interface in Rhino generally involves writing code in C++, C#, or VB.NET. I don’t think you’ll have any luck getting VB6 user interface to work in Rhino.

Right. VB6 is a white elephant, but is good for quick development. The world has passed it by, but it is still a useful tool. Backward compatibility is not in Microsoft’s vocabulary.

So the Windows Script interfaces must have been developed with VB6 in mind at the time. Yes, some nice VB6 features are missing from Script, but can usually be programmed around without too much trouble.

The few VB6 programs I converted to VB.net didn’t 100% convert, but it did a lot and flagged the areas where it had trouble. It was fairly simple to go directly to the Visual Studio help and learn what to do in VB.net (I was simultaneously learning VB.net - which IS a bit different). I think the calls to rhinocommon.dll would be most appropriately made manually in VB.net after the conversion.

I would think that if you are going to put a Windows face on Boltgen you would like to re-do it in VB.net as a plug-in and maybe even create the interface in Windows Presentation Foundation, which I hear is the real hot ticket now.

You’ll probably have an easier time translating over to WinForms from VB.

I’m not that familiar with WPF, but I’ve been getting the same impression (hot ticket - way of the future), but I’m a little cynical about it using XML under the hood. If you want to animate your controls and do other fancy candy - totally go for WPF, otherwise WinForms will probably be more familiar.

IMHO, it’s the web that created the impetus for XML in desktop applications, not a real actual need, but them again I’m just an XML hater :wink: and that’s a different conversation…

WinForms and WPF both use XML for defining the user interface. This format is compiled into something else in the final executable. That being said it probably will be easier to start off using WinForms.

@stevebaer I was just being a little silly…
To clarify though, it looks like you actually had to work with the XML directly in WPF (XAML files), and that’s what I wanted to point out. You don’t have to work with any XML in WinForms ( easier to transition to from VB). I haven’t seen any XML for WinForms other than the resource files - the designer pushes out a partial class. Granted there are plenty of XML files in VS projects though.
Sorry if I’m splitting hairs…