What is ActiveX, and how do I use it?
Overview
WinMark’s ActiveX control provides the highest degree of flexibility in automating your marking process. There are some operations, such as reading data from a spreadsheet or database, or performing conditional logic, or managing external processes, that can only be accomplished by utilizing the ActiveX control.
That’s great, but ‘What is it?’ you ask. (Well, if you’re a software person, you already know what it is. For the rest of us…)
The ActiveX control is essentially a collection of subroutines. ActiveX is a technology provided in certain Windows applications that allows the functionality of one program to be used within another program. It is s the same sort of thing that allows you to embed an Excel spreadsheet into a Word document. With the WinMark ActiveX control, you can embed the WinMark marking functionality into a related control program, like:
Visual Basic
Visual C++
Access
Excel
LabView
There may be others as well, but these programs have been used to design a marking interface.
Getting Started
The process of getting started with the WinMark ActiveX control varies with the control software being used:
Visual Basic – this document describes the process of loading the ActiveX control into a VB project and creating a simple marking interface.
Visual C++ – this document describes the steps required for adding or inserting the WinMark Pro ActiveX control into your Visual C++ project.
Using ActiveX, how do I change my font from Stroke to True Type?
By default, all text objects are defined as Stroke font objects. You can change the font to any of the other Stroke fonts by using SetStringProperty on the text object’s StrokeFont property. To change from the Stroke to a True Type font, you must first toggle the binary FontType value (0 = TTF, 1 = Stroke) to select True Type as the FontType, then select the desired font as the TrueTypeFont.
For example, to set the font of object ‘Text1’ to Arial True Type:
mh.SetBoolProperty “Text1”, “FontType”, FALSE
mh.SetStringProperty “Text1”, “StrokeFont”, “Arial”
How do I load multiple files and switch from one to another in ActiveX?
Use the LoadDrawing method to load mark files into the ActiveX control. To load multiple files and then select from the set of loaded files, use the Index property. Note that, while you could reload a file every time it is needed, to do so will use up the Windows GDI Resources which can then lead to software lockup. It is best to load the files once, then index through them to select the desired file. A typical use of the LoadDrawing and MarkDrawing methods and the Index property in Visual Basic is:
mh.DrawingIndex = 0
mh.LoadDrawing “test1.mkh”
mh.DrawingIndex = 1
mh.LoadDrawing “test2.mkh”
mh.DrawingIndex = 2
mh.LoadDrawing “test3.mkh”
mh.DrawingIndex = 0
mh.MarkDrawing
mh.DrawingIndex = 1
mh.MarkDrawing
mh.DrawingIndex = 2
mh.MarkDrawing
The first six lines load the three mark files to three index locations. The last six lines of code illustrate how to call up each drawing by index value and then mark it.
Why do I have to resize my imported graphic images in WinMark Pro to make them mark properly?
WinMark Pro builds 3090 and below automatically scale imported vector files to fill 66% of the available Drawing Canvas (field size). This behavior was fixed in build 3155, allowing you to scale as Best Fit (66%), 1 to 1, X-axis extents, or Y-axis extents. Either version allows proportional or non-proportional scaling using precise scale values, or by "clicking and dragging", or by using the Object Transformation tool from the WinMark Pro toolbar.
If you would like to upgrade you current version of WinMark Pro, Click here.
My Fenix (or FH head) has four inputs and four outputs, but WinMark Pro shows eight of each. What’s up with that?
WinMark Pro’s I/O features provide eight input and six output bits (two of the output bits are reserved for laser control) in order to conform to older products. For specific details on the correlation of the WinMark Pro I/O bits to the hardware capabilities of our marking products, refer to Synrad Technical Bulletin #01, available for download here.
How do I save my custom date codes before upgrading WinMark Pro?
If your .MKH mark files contain saved serial numbers, custom date or shift code definitions, or you are using WinMark Launcher’s Auto Startup feature, please read the following information before upgrading to a newer version of WinMark Pro.
WinMark Pro stores custom date code formats, saved serial numbers, shift code definitions, and Launcher startup information in the Windows Registry rather than in the .MKH mark file. To avoid losing this information, you must save the appropriate Registry keys before upgrading WinMark Pro and then restore that data after installation. Follow the steps described below to save custom date formats and repeat this process for other keys you want to save. Valid Registry key names are:
Custom date codes - UserDateFormats
Shift code definitions - Shift Defines
Saved serial numbers - SavedSerialNumbers
Launcher startup info – Startup
DO NOT SAVE AND RESTORE ANY OTHER REGISTRY KEYS! Doing so may affect the functionality of the upgrade. If you have changed WinMark Pro’s global Drawing or Object Defaults (under Tools/General Settings.../Application Settings) with customized values, you must reenter them after the upgrade installation is complete.
NOTE: WinMark Pro versions 4.0.0.3773 and above automatically provide an option to preserve current WinMark Registry settings when performing an upgrade installation.
To save Registry information:
- 1. Open RegEdit.EXE from the Windows directory.
- 2. Click on the '+' sign next to HKEY_CURRENT_USER.
- 3. Click on the '+' sign next to Software.
- 4. Click on the '+' sign next to Synrad.
- 5. Click on the '+' sign next to Synrad WinMark.
- 6. Click on the UserDateFormats folder. Verify that your custom date codes are listed in the Name and Data columns to the right.
- 7. Go to the Registry menu and select Export Registry File.
- 8. Verify that the Selected Branch option is selected in the Export Range group and that the selected branch is:
'HKEY_CURRENT_USER\Software\Synrad\Synrad WinMark\UserDateFormats'. - 9. Type in an appropriate file name (like 'CustomDateCodes') and click on Save.
- 10. Repeat Steps 6 through 9 to save shift, serial number, or startup data as required.
- 11. Close RegEdit.
To uninstall/upgrade WinMark Pro:
- 1. Uninstall WinMark Pro, then install the WinMark Pro version upgrade.
- 2. Open WinMark Pro, select the marking head and lens type, and then close WinMark Pro.
To restore Registry information:
- 1. Open RegEdit.
- 2. Go to the Registry menu and select Import Registry File.
- 3. Select the saved date code file and click OK. You should see a message that the data was successfully imported into the Registry file.
- 4. Perform a test mark using a mark file containing one of your custom date formats to verify that date codes are properly formatted.
- 5. Repeat Steps 2 through 4 to restore any other saved Registry key data.
WinMark Automation Overview.
WinMark’s automation tools provide a sequenced method of controlling mark session automation. WinMark allows control and monitoring of:
- 1. Input and output channels on the FLCC and the marking head. (See Technical Bulletin 01, available here, for complete details of the I/O available on the various models of marking heads and FLCCs.)
- 2. Data received through the WinMark PC’s RS232 port.
- 3. Data entered by the operator.
- 4. Internally controlled serial numbers, date and shift codes.
The Automation Flowchart, available within WinMark from the Help menu, illustrates the sequence of automation steps:

WinMark executes the stages in the order given, and loops through from the Set Digital After Mark stage to Set Digital Before Piece stage until the number of pieces marked is equal to the drawing’s Mark Count property. By default, new drawings have their Mark Count property set to one. If Mark Count is set to zero, WinMark will continue through the automation loop indefinitely.
Wait Digital… states act on the inputs of the marking head and/or the Fiber Link Controller Card (FLCC) or D/A card (for SH marking head systems). Unlike the Wait Digital command in the Event Builder, there is no timeout property for the basic Wait Digital… functions – WinMark will wait forever for the input condition to be met. If the condition is not met, the session may be aborted using the ESC key.
Set Digital… states allow control of the outputs of the marking head, FLCC, or D/A card. WinMark will set or clear the output bits and move on. Note that, if the drawing’s Mark Count is set to a value other than one, there is almost no time elapsed between completion of the Set Digital After Mark and the Set Digital Before Piece stages. If an input is toggled from one state to the other in these two stages, a PLC or other type of controller might not even detect the change in output status that took place in the Set Digital After Mark stage. See the basic automation description here for a recommended I/O approach.
Input and Output bit numbers in WinMark correspond with the input and output numbers for your marking hardware. For instance, Output bit 7 within WinMark will control OUT7 on the FH marking head, IN3 on the FH marking head will be interpreted as Input bit 3 within WinMark. Note that, since the WinMark software supports all existing marking head products, the Wait Digital… and Set Digital… states may show I/O bits that are not supported on your marking hardware. For more information on which I/O are available on your marking hardware, refer to the marking head manual or see Technical Bulletin 01, available here.
On Before… and On After… stages use the Event Builder tool. These stages provide the flexibility to build up a chain of commands.
Coupling the basic Wait Digital and Set Digital stages with WinMark’s Auto Text functions and the Event Builder stages, most any sort of automation scheme may be developed. For branching and conditional logic, though, you may need to consider using the WinMark ActiveX control.
[Back to Questions] [Top of Page] [Previous Page]
