Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 14 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 15.1 ('Xojo Pi Lab')
Instant purchase and download via GumRoad!

FEATURE

VB6 DLL Class to Xojo

Getting Visual Basic 6 DLLs to Work in Xojo

Issue: 15.1 (January/February 2017)
Author: Eugene Dakin
Author Bio: Eugene Dakin is an author, professional chemist, oilfield consultant and programmer in Canada. When he is in-between courses and oilfield projects, he and his wife spend valuable time raising their wonderful children. He has been hobby programming on computer's for over 25 years. He has created over 185 technical and industrial simulation program
Article Description: r> No descri
Article Length (in bytes): 7,619
Starting Page Number: e>
Article Number: 15103
Resource File(s):

Download Icon project15103.zip Updated: 2017-01-02 14:51:02

Related Link(s): None

Excerpt of article text...

e>There are quite a few old Visual Basic 6 (VB6) programs that are still being used on Windows OS. The reason for this is that Visual Basic 6 was an extremely popular programming language and there are many old algorithms that were developed. Although the best way to create a program is to manually rewrite the dynamic link libraries (DLL) over to Xojo, and the second-best option is to directly convert VB6's dll to Xojo with the handy Active X dll control in Xojo.

I happen to have a copy of Windows XP running and my old version of Visual Basic 6. This article will show how we create a couple of methods and show the whole Active X dll conversion process and run the DLL in Xojo. The first steps are to start VB6 and select an ActiveX DLL project (see Figure 1).

Once the DLL project has opened, let's save the project as VB6DLLProject, and save the default class as VB6DLLProjectClass. Visual Basic's class acts similarly to a Xojo class. Now let's write some code (see Figure 2).

In Class1(VB6DLLProjectClass1.cls) add the following code to add two double numbers together and return the sum of these values.

Public Function AddTwoNumbers(x As Double, y As Double) As Double

...End of Excerpt. Please purchase the magazine to read the full article.