Create a Hello World Dialog

To create a resource-only DLL that is accessible in Origin using Origin C the DLL must be built using Microsoft Visual C++ version 5.0 or higher. Origin Dialog Builder includes an Origin Dialog AppWizard which simplifies the process of creating a resource-only DLL in Microsoft Visual C++. To access this wizard in Microsoft Visual C++, first download this zip file, extract it and then browse to copy the file

ODialog.awx

from the \Dialog Builder\VisualStudio6AppWizard subfolder to the \Common\MSDev98\Template subfolder of Microsoft Visual Studio.

To create a simple "Hello World" dialog in a resource only DLL using Microsoft Visual C++, the Origin Dialog AppWizard, Origin, and the Origin C programming language, follow the steps below.

Note: Beginning with Origin 2017, Origin C dialogs can be built using HTML and JavaScript. For most users, this will be a better approach than building tools using the older Origin Developer Kit. Building dialogs with the Developer Kit requires the user to create a resource DLL using Visual Studio. This has proven to be a barrier for many, both for development and for distribution. The HTML/JS approach eliminates such complications.

Contents

Steps 1 - 8: Use the Origin Dialog AppWizard to create a resource


C:\Program Files\OriginLab\OriginPro75\HelloWorld

Steps 9 - 11: Edit the Microsoft Visual C++ project settings

#include "afxres.h"

(with quotes) for Read-only symbol directives. If not empty, clear Compile-time directives. Click OK twice.

Create a Hello World Dialog ResourceIncludes.png

Steps 12 - 14: Add a Static control to the "Hello World" dialog

Create a Hello World Dialog HelloWorldDialog.png

Steps 15 - 18: Adjust header files to work more efficiently with Origin C

#define IDD_HW_DLG 100

and paste it into the file HelloWorldRes.h just above the line

#define IDC_HW_STATIC 6000
#define _APS_NEXT_RESOURCE_VALUE 100

to

#define _APS_NEXT_RESOURCE_VALUE 101

Step 19: Build Dialog Builder resource only DLL

Steps 20 - 24: Edit and execute Origin C code to launch the "Hello World" dialog in Origin

BOOL OnInitDialog()
{
	Control ctrl = GetItem(IDC_HW_STATIC);
	ctrl.Text = "Hello World!";
	return TRUE;
}

Create a Hello World Dialog HelloWorldDialogInOrigin.png

To create a resource-only DLL that is accessible in Origin using Origin C the DLL must be built using Microsoft Visual C++ version 5.0 or higher. Origin Dialog Builder includes an Origin Dialog AppWizard which simplifies the process of creating a resource-only DLL in Microsoft Visual C++. To access this wizard in Microsoft Visual C++, first download this zip file, extract it and then browse to copy the file

ODialog.awx

from the \Dialog Builder\VisualStudio6AppWizard subfolder to the \Common\MSDev98\Template subfolder of Microsoft Visual Studio.

To create a simple "Hello World" dialog in a resource only DLL using Microsoft Visual C++, the Origin Dialog AppWizard, Origin, and the Origin C programming language, follow the steps below.

Note: It is also possible to open a resource in Origin created using a resource editor/compiler other than Microsoft Visual C++. See the section Creating and Accessing an Open Watcom Resource-only DLL for a description of how to build a Dialog Builder resource using the Open Watcom C/C++ software and access it in Origin with Origin C.