Introduction
Events
Methods
Properties
Appendices
Index




Introduction

This control draws chemicals from .MOL files. It can be used to communicate with certain chemical editors which do not conform to OLE standards.

The Chem32S control was written using Microsoft Foundation Classes (MFC) in Visual C++. It is designed for Windows NT, but will happily run on Windows 95.

The control supports many Events, Methods and Properties including most of the standard MFC ones.

In order to work effectively with existing chemical editors, the control supports Dynamic Data Exchange (DDE), both as client and server. It can also launch and manipulate executables. This enables your applications to, for example, launch such an editor and exchange information with it.

Because it can be used to launch other programs, this control should not be used on Web pages.




Events

Introduction

Standard events supported by this control are Click, DblClick, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove and MouseUp. The control also supports the following additional events:

See Methods, Properties, return to Developer's Reference, or the top of this document.



DDECommand Event

The DDECommand event occurs when a command is received by the control's DDE Server.

void DDECommand(BSTR lpszService, BSTR lpszTopic, BSTR lpszCommand);

The parameters reflect the service, topic and command that have been received by the control.

Before the control can receive a DDE command, your application must prepare the ground, by at least initialising the DDEService property and using the DDEAddTopic method.

See DDEService, DDEAddTopic, DDEDeleteTopic, DDEGetTopic, return to Events, Developer's Reference, or the top of this document.




Methods

In this section, information is arranged into:

The following methods are supported by this control:

See Events, Properties, return to Developer's Reference, or the top of this document.



Error Codes

Functions can return any of the following error codes:

These codes are currently defined as follows:

#define OCX_ERROR -1000

#define OCXERR_WINDOWS (OCX_ERROR - 0)
#define OCXERR_RESOURCE (OCX_ERROR - 1)
#define OCXERR_BADPARAM (OCX_ERROR - 2)
#define OCXERR_NODLL (OCX_ERROR - 3)
#define OCXERR_LOCKMEM (OCX_ERROR - 4)
#define OCXERR_TEXTOUT (OCX_ERROR - 5)
#define OCXERR_BADMOLFILE (OCX_ERROR - 6)
#define OCXERR_ALLOCMEM (OCX_ERROR - 7)
#define OCXERR_OPENFILE (OCX_ERROR - 8)
#define OCXERR_READ (OCX_ERROR - 9)
#define OCXERR_BADFONT (OCX_ERROR -10)
#define OCXERR_NODATA (OCX_ERROR -11)
#define OCXERR_NOSUCHRESULT (OCX_ERROR -12)
#define OCXERR_TESTVERSION (OCX_ERROR -13)
#define OCXERR_MOLFILETOOBIG (OCX_ERROR -14)
#define OCXERR_CREATEFILE (OCX_ERROR -15)
#define OCXERR_CLIPBOARD (OCX_ERROR -16)
#define OCXERR_SIZEMEM (OCX_ERROR -17)
#define OCXERR_WRITE (OCX_ERROR -18)
#define OCXERR_TYPE (OCX_ERROR -19)
#define OCXERR_DDE (OCX_ERROR -20)
#define OCXERR_TOOMANYXEQ (OCX_ERROR -21)
#define OCXERR_LAUNCH (OCX_ERROR -22)
#define OCXERR_READONLY (OCX_ERROR -23)


Chemical Methods

The methods discussed in this section are grouped together by a common theme of chemistry.

These functions are only valid when the data displayed by the control was successfully loaded using LoadMolFile or was Pasted in using the control's own clipboard format. Any attempt to use these functions on data pasted in using any other format will yield undefined results.



CalculateMF Method

The CalculateMF method calculates and returns the molecular formula of the current content of the control.

BSTR CalculateMF ();

Return to Methods, Developer's Reference, or the top of this document.



GetAtomData Method

The GetAtomData returns some information about a particular atom.

short GetAtomData (short nItem, short nAtom);

nItem identifies exactly which piece of data to obtain, and nAtom identifies the atom to examine (from the range of zero to one less than the atom count returned by GetCount). Any one of the following values, which correspond to value describing the atom in the .MOL file, may be supplied for nItem:

#define ATOM_MASSDIFF 1
#define ATOM_CHARGE 2
#define ATOM_STEREO 3
#define ATOM_HYDROGEN 4
#define ATOM_VALENCE 5
#define ATOM_HO 6
#define ATOM_ELEMENT 7
#define ATOM_INDEX 8
#define ATOM_REACTION_TYPE 9
#define ATOM_REACTION_NUMBER 10
#define ATOM_MAPPING 11
#define ATOM_INVERSION 12
#define ATOM_ISSTEREO 13
#define ATOM_ISFIXED 14

See the GetAtomPosition, GetBondData, and GetCount methods, return to Methods, Developer's Reference, or the top of this document.



GetAtomPosition Method

The GetAtomPosition returns the atom's coördinates, as specified in the .MOL file, not as currently drawn on the screen.

void GetAtomPosition (short nAtom, double* pdbX, double* pdbY, double* pdbZ);

nAtom is the atom number, which must be between zero and one less than the atom count returned by GetCount. Each of the remaining variables point to a double, which is used to receive the corresponding coördinate value.

See the GetAtomData, GetBondData, and GetCount methods, return to Methods, Developer's Reference, or the top of this document.



GetBondData Method

The GetBondData method returns information about a particular bond.

short GetBondData (short nItem, short nBond);

nItem identifies exactly which piece of data to obtain, and nBond identifies the bond to examine (from the range of zero to one less than the bond count returned by GetCount). Any one of the following values, which correspond to value describing the atom in the .MOL file, may be supplied for nItem:

#define BOND_FROM 1
#define BOND_TO 2
#define BOND_TYPE 3
#define BOND_STEREO 4
#define BOND_TOPOLOGY 5
#define BOND_SIDE 6
#define BOND_REACTION 7

See the GetAtomData, GetAtomPosition, and GetCount methods, return to Methods, Developer's Reference, or the top of this document.



GetCount Method

The GetCount returns the number of a particular type in the .MOL file.

BSTR GetCount ();

nItem identifies exactly which count of data to obtain. Any one of the following values, which correspond to a count found in the .MOL file, may be supplied for nItem:

#define COUNT_ATOM 1
#define COUNT_BOND 2
#define COUNT_LIST 3
#define COUNT_CHIRAL 4
#define COUNT_STEXT 5
#define COUNT_COMPONENT 6
#define COUNT_REACTANT 7
#define COUNT_PRODUCT 8
#define COUNT_INTERMEDIATE 9
#define COUNT_LINE 10

You will need to use this method to obtain the atom (COUNT_ATOM) or bond (COUNT_BOND) counts before using GetAtomData, GetAtomPosition, or GetBondData.

See the GetAtomData, GetAtomPosition, and GetBondData methods, return to Methods, Developer's Reference, or the top of this document.



LoadMolFile Method

The LoadMolFile method loads and interprets a .MOL file.

short LoadMolFile (BSTR lpszFile);

lpszFile is the full path name of the .MOL file to load. The function returns an error code. Please note the .MOL file should be in version 1 format, although this function can make some sense of version 2 format .MOL files. This function cannot read version 3 .MOL files.

See the SaveMolFile method, check the OCX's error codes, return to Methods, Developer's Reference, or the top of this document.



SaveMolFile Method

The SaveMolFile calculates and returns the molecular formula of the current content of the control.

short SaveMolFile (BSTR lpszMolFile, boolean bCreate);

lpszFile is the full path name of the .MOL file to create. If bCreate is false, then the file must already exist. The function returns an error code.

Note this function simple writes out the .MOL file it previously loaded and is currently displaying. This function is designed to make it simple to paste a .MOL file into the .OCX, then save it.

See the LoadMolFile and Pastemethods, check the OCX's error codes, return to Methods, Developer's Reference, or the top of this document.



Standard Methods

The control includes a number of methods which support standard Windows activities.



AboutBox Method

The AboutBox method displays a copyright dialogue.

HRESULT AboutBox ();

Return to Methods, Developer's Reference, or the top of this document.



CanCopy Method

The CanCopy method indicates whether the control can copy its current content to the clipboard.

boolean CanCopy ();

The function returns true if a copy is possible.

See the CanCut, CanPaste, Copy, Cut, and Paste methods, return to Methods, Developer's Reference, or the top of this document.



CanCut Method

The CanCut method indicates whether the control can cut it's current content to the clipboard.

boolean CanCut ();

The function returns true if a cut is possible. The only difference between this and the CanCopy is that this method will return false if the control is set to read only, whereas that method would return true.

See the CanCopy, CanPaste, Copy, Cut, and Paste methods, return to Methods, Developer's Reference, or the top of this document.



CanPaste Method

The CanPaste method indicates whether the control can paste its current content of the clipboard.

boolean CanPaste();

The function returns true if a copy is possible. Note that the control will happily paste a metafile, a bitmap, or its own Chemical OCX data. It cannot (yet) paste a Sketch file.

See the CanCopy, CanCut, Copy, Cut, and Paste methods, return to Methods, Developer's Reference, or the top of this document.



Clear Method

The Clear method empties the control.

void Clear ();

Return to Methods, Developer's Reference, or the top of this document.



Copy Method

T

he Copy method copies its content to the clipboard.

boolean Copy();

The control puts its content on the clipboard as a bitmap, and in its own Chemical OCX format. It returns true if successful.

See the CanCopy, CanCut, CanPaste, Cut, and Paste methods, return to Methods, Developer's Reference, or the top of this document.



Cut Method

The Cut method cuts its content to the clipboard.

boolean Cut();

The control puts its content on the clipboard as a bitmap, and in its own Chemical OCX format. It returns true if successful.

See the CanCopy, CanCut, CanPaste, Copy, and Paste methods, return to Methods, Developer's Reference, or the top of this document.



Paste Method

The Paste pastes the content of the clipboard into the control.

boolean Paste ();

The appropriate data type is selected from the clipboard in the following order:

The plain drawing options for paste are provided to enable the developer to display sophisticated chemical information, such as reactions, which have been prepared in an application such as ISIS/Draw, and which need to be displayed elsewhere. Any attempt to use any of the chemical methods after pasting a metafile or bitmap into the control will yield undefined results.

The control returns true if successful.

See the CanCopy, CanCut, CanPaste, Copy, and Cut methods, return to Methods, Developer's Reference, or the top of this document.



Refresh Method

The Refresh method redraws the control's content.

void Refresh();

Return to Methods, Developer's Reference, or the top of this document.



DDE Methods

The control includes DDE functionality to permit communication with non-OLE compliant chemical editing applications, such as ISIS/Draw. These functions, and the executable methods, enable a developer to simulate OLE by supporting double-clicking on a chemical to run up ISIS/Draw and let the user edit a .MOL file - although this also requires some ISIS/Draw PL macro programming.

Future version of this control may drop these functions.

The DDEService property must be set before any of these methods are used.



DDEAddTopic Method

The DDEAddTopic method adds the specified topic to the list of those accepted by the control's DDE server.

short DDEAddTopic (BSTR lpszTopic);

lpszTopic is the name of the topic to add to the server. The method returns a handle to the topic if successful, or -1 on failure.

The DDE server must have previously been successfully initialised by assigning a value to the DDEService property. Once a topic has been added, a DDECommand event may occur when an external application uses that topic to communicate with the control.

See DDECommand, DDEDeleteTopic, DDEGetTopic, or DDEService, return to Methods, the Developer's Reference, or the top of this document.



DDEConversationCommand Method

The DDEConversationCommand method issues a command to a DDE server.

long DDEConversationCommand (BSTR lpszCommand);

lpszCommand is command to issue to the server. The method returns a value from the server.

The DDE conversation must have been successfully initialised by an earlier call to DDEConversationStart.

See DDEConversationEnd, DDEConversationStart, DDEInUse, DDEService, or DDEXeq, return to Methods, the Developer's Reference, or the top of this document.



DDEConversationEnd Method

The DDEConversationEnd method ends a conversation with a DDE server.

short DDEConversationEnd ();

The DDE conversation must have been successfully initialised by an earlier call to DDEConversationStart.

See DDEConversationCommand, DDEConversationStart, DDEInUse, DDEService, or DDEXeq, return to Methods, the Developer's Reference, or the top of this document.



DDEConversationStart Method

The DDEConversationStart method starts a conversation with a DDE server.

short DDEConversationStart(BSTR lpszService, BSTR lpszTopic);

lpszService identifies the service with which the conversation is desired, and lpszTopic identifies the topic of discussion. The method returns -1 if DDE has not been initialise, 0 if conversation cannot be started for some reason, and 1 if the conversation is successfully started.

DDE can only be initialised by assigning a value to the DDEService property.

See DDEConversationCommand, DDEConversationStart, DDEInUse, DDEService, or DDEXeq, return to Methods, the Developer's Reference, or the top of this document.



DDEDeleteTopic Method

The DDEDeleteTopic method removes the specified topic to the list of those accepted by the control's DDE server.

short DDEDeleteTopic(short nTopic);

nTopic is the value identifying the topic, previously returned by DDEAddTopic. The method returns 0 if successful, and -1 if something went dreadfully wrong.

See DDECommand, DDEAddTopic, or DDEGetTopic, return to Methods, the Developer's Reference, or the top of this document.



DDEGetTopic Method

The DDEGetTopic method returns the name of the specified topic.

BSTR DDEGetTopic(short nTopic);

nTopic is the value identifying the topic, previously returned by DDEAddTopic. The method returns NULL if unsuccessful, or the name of the topic otherwise.

See DDECommand, DDEAddTopic, or DDEDeleteTopic, return to Methods, the Developer's Reference, or the top of this document.



DDEInUse Method

The DDEInUse method confirms whether or not the DDE server has been initialised.

boolean DDEInUse ();

The DDE server can be initialised by assigning a value to the DDEService property.

See DDEService, return to Methods, the Developer's Reference, or the top of this document.



DDEXeq

The DDEXeq method connects to a service, issues a command, and then disconnects from that service.

long DDEXeq(BSTR lpszService, BSTR lpszTopic, BSTR lpszCommand);

lpszService is the DDE server with which you wish to communicate, lpszTopic is the topic of the conversation, and lpszCommand is the single command you wish to issue.

This method is equivalent to calling DDEConversationStart, DDEConversationCommand and DDEConversationEnd in sequence. The method returns -1 if it cannot successfully communicate with the server, and the return value of the command otherwise.

The DDE server can be initialised by assigning a value to the DDEService property.

See DDEConversationCommand, DDEConversationEnd, DDEConversationStart, DDEInUse, DDEService, or DDEXeq, return to Methods, the Developer's Reference, or the top of this document.



Executable Methods

The control includes DDE functionality to permit communication with non-OLE compliant chemical editing applications, such as ISIS/Draw. These functions, and the DDE methods, enable a developer to simulate OLE by supporting double-clicking on a chemical to run up ISIS/Draw and let the user edit a .MOL file - although this also requires some ISIS/Draw PL macro programming.

Future version of this control may drop these functions.



ExecutableClose

The ExecutableClose method sends a close message to an executable.

short ExecutableClose (short nExecutable);

nExecutable is the executable identifier returned by ExecutableLaunch.

If the executable has a number of windows, you should identify the key window using the ExecutableWindow property before you use this method.

Not all executable take any notice of instructions telling them to go away. You can check whether this is the case having used this method by having your program do the following:

See the ExecutableIsRunning, ExecutableLaunch, and ExecutablePredujiceTerminate methods, the ExecutableWindow property, return to Methods, the Developer's Reference, or the top of this document.



ExecutableGetLastError

The ExecutableGetLastError method returns the last system error which occurred as a consequence of using these methods.

long ExectuableGetLastError ();

You should use this function to determine the exact reason why at attempt to use the ExecutableLaunch method failed.

See the ExecutableLaunch method, return to Methods, the Developer's Reference, or the top of this document.



ExecutableHide

The ExecutableHide attempts to hide an executable's window;

void ExecutableHide(short nExecutable);

nExecutable is the executable identifier returned by ExecutableLaunch.

If the executable has a number of windows, you should identify the key window using the ExecutableWindow property before you use this method.

See the ExecutableLaunch, and ExecutableShow methods, the ExecutableWindow property, return to Methods, the Developer's Reference, or the top of this document.



ExecutableIsRunning

The ExecutableIsRunning checks to see if a previously launched executable is still running.

boolean ExecutableIsRunning (short nExecutable);

nExecutable is the executable identifier returned by ExecutableLaunch. The method returns true if the executable is still running.

See the ExecutableLaunch method, the ExecutableWindow property, return to Methods, the Developer's Reference, or the top of this document.



ExecutableLaunch

The ExecutableLaunch method attempts to run a program.

short ExecutableLaunch (BSTR lpszAppName, BSTR lpszCmdLine, BSTR lpszWindowTitle, short nShowWindow);

lpszAppName is a string containing the applications name. If the application is not on the path, you will may need to provide the full path. The method will enclose this parameter in quotes.

lpszCmdLine is a string containing the command line parameters to feed to the program.

lpszWindowTitle is a string containing the program's main window title. This is used by the control to identify which window is to be targeted by other methods, including ExecutableClose, ExecutableHide and ExecutableShow. If this string is omitted, or the program does not launch with a window with this title, then control will attempt to identify an appropriate window. You can also provide this information using the ExecutableWindow property.

nShowWindow is a standard windows parameter identifying how the new applications window is to appear upon launch. This value corresponds to that fed to the standard windows API call ShowWindow - see that call's documentation for further information.

If successful, the method returns zero or a positive number as an executable identifier, which is used by other Executable methods and properties. If the function fails, it returns one of the following error codes:

See the ExecutableClose, ExecutableGetLastError, ExecutableHide, ExecutableIsRunning, ExecutablePredujiceTerminate, ExecutableReuse, and ExecutableShow methods, the ExecutableWindow property, error codes, return to Methods, the Developer's Reference, or the top of this document.



ExecutablePredujiceTerminate

The ExecutablePredujiceTerminate kills a previously launched application.

short ExecutablePrejudiceTerminate(short nExecutable);

nExecutable is the executable identifier returned by ExecutableLaunch.

For a discussion on when to use this method, see the ExecutableClose.

Be warned: killing an application is dangerous and should only be done in the last resort. If you do this, there is a danger that work in progress will not be saved, and it is quite possible for the applications files to become corrupt. Do not use this function unless you have to.

See the ExecutableClose, ExecutableIsRunning, and ExecutableLaunch methods, the ExecutableWindow property, return to Methods, the Developer's Reference, or the top of this document.



ExecutableReuse

The ExecutableReuse indicates that an executable's slot can be reused.

short void ExecutableReuse (short nExecutable);

nExecutable is the executable identifier returned by ExecutableLaunch.

Once an application is launched, its identifier remains reserved for that application until this method is called to free it.

See the and ExecutableLaunch methods, return to Methods, the Developer's Reference, or the top of this document.



ExecutableShow

The ExecutableShow method attempts to show a previously hidden executable's window;

void ExecutableShow (short nExecutable, boolean bMaximize);

nExecutable is the executable identifier returned by ExecutableLaunch. If bMaximixe is true, the window is shown maximised, otherwise it is shown normalised.

If the executable has a number of windows, you should identify the key window using the ExecutableWindow property before you use this method.

See the ExecutableHide, and ExecutableLaunch methods, the ExecutableWindow property, return to Methods, the Developer's Reference, or the top of this document.




Properties

These properties are designed to be set from calls in your applications code. None can be set using the standard property page. A number cannot be set using Visual Basic's property sheet. The next generation of this control will support these features.

This section is separated into standard properties, item properties, and other properties.

This control's non-standard properties are:



Standard Properties

The standard properties supported by this control are Appearance, BackColor, BorderStyle, ForeColor and hWnd. Developers should note the use of the American spelling of these names.



Item Properties

This section discusses the various item properties, which allow an application detailed control on the appearance of a chemical drawn in the control.

All these properties require an item number, which can be one of the following:

These item numbers are currently defined as follows:

#define ITEM_ISOTOPE 1
#define ITEM_SYMBOL 2
#define ITEM_CHARGE 3
#define ITEM_MULTIPLIER 4
#define ITEM_STRUCTURE 5
#define ITEM_COMPOUND 6
#define ITEM_BOND 7
#define ITEM_CARBON 8
#define ITEM_HYDROGEN 9


ItemColour

The ItemColour property specifies the colour used to draw the item.

OLE_COLOUR ItemColour (short nItem);

See item properties for details of the possible value of nItem.

See item properties, return to Properties, the Developer's Reference, or the top of this document.



ItemDrawn

The ItemDrawn property determines whether an item is drawn or not.

short Drawn (short nItem);

If this property is non-zero, the item is drawn. The ItemPosition property can also be used to prevent an item appearing.

See the ItemPosition property, item properties, return to Properties, the Developer's Reference, or the top of this document.



ItemFont

The ItemFont property specifies the name of the font used to display a text item.

BSTR ItemFont (short nItem)

See item properties for details of the possible value of nItem. Text items include ITEM_ISOTOPE, ITEM_SYMBOL, ITEM_CHARGE, ITEM_MULTIPLIER, ITEM_STRUCTURE, ITEM_COMPOUND, ITEM_CARBON and ITEM_HYDROGEN. What happens when the font is not available on the user's system is undefined.

See item properties, return to Properties, the Developer's Reference, or the top of this document.



ItemSize

The ItemSize property determines the relative size of an item.

double ItemSize (short nItem);

See item properties for details of the possible value of nItem. The relationship used to determine the size depends on the item, as follows:

See item properties, return to Properties, the Developer's Reference, or the top of this document.



ItemOffset

The ItemOffset property determines the relative offset of certain items.

double ItemOffset (short nItem);

See item properties for details of the possible value of nItem. The relationship used to determine the size depends on the item, as follows:

See item properties, return to Properties, the Developer's Reference, or the top of this document.



ItemPosition

The ItemPosition property determines the relative position of certain items.

short ItemPosition (short nItem);

See item properties for details of the possible value of nItem. The relationship used to determine the size depends on the item.

For the text items ITEM_STRUCTURE and ITEM_COMPOUND, nItem has the following possible values:

For the items ITEM_SYMBOL, ITEM_CARBON and ITEM_HYDROGEN, nItem has the following possible values:

See the ItemDrawn property, item properties, return to Properties, the Developer's Reference, or the top of this document.



Other Properties

This section discusses the remaining properties found in the control.



BondThickness

The BondThickness property specifies the thickness, in pixels, of the bonds when drawn;

short BondThickness

If the thickness is zero, the bond is drawn as thin as possible.

See the DoubleDistance property, return to Properties, the Developer's Reference, or the top of this document.



CompoundNumber

The CompoundNumber property specifies a short piece of text which may be drawn in the control;

BSTR CompoundNumber;

See the ItemColour, ItemFont, ItemOffset, ItemPosition, ItemSize, StructureComment, StructureText, and TestId properties, return to Properties, the Developer's Reference, or the top of this document.



DDEService

The DDEService property specifies the name of the service offered by the control using Dynamic Data Exchange;

BSTR DDEService;

If you are unfamiliar with Dynamic Data Exchange, then you should familiarise yourself with the concepts behind it before you use the control's DDE methods and properties. This control offers a DDE service and DDE client functionality, but only supports conversations and commands.

This property must be set before you use any of the controls DDE methods, even if you only want to act as a DDE client.

See DDE Methods, the DDE Timeout property, return to Properties, the Developer's Reference, or the top of this document.



DDETimeout

The DDETimeout property specifies the maximum time, in milliseconds, to wait for a DDE Server to respond when using the DDE client methods.

long DDETimeout;

If this number is zero, then there is no time limit.

See DDE Methods, the DDE Service property, return to Properties, the Developer's Reference, or the top of this document.



DoubleDistance

The DoubleDistance property specifies the relative space between lines in double and triple bonds.

double DoubleDistance;

This value is calculated relative to the average bond length of bonds drawn in the compound. Thus a double distance of 1.0 implies the lines are separated by the average bond length, which is probably a little excessive. The default distance is 0.15.

See the BondThickness property, return to Properties, the Developer's Reference, or the top of this document.



ExecutableWindowTitle

The ExecutableWindowTitle property identifies the name of the primary window of an executable.

BSTR ExecutableWindowTitle;

Please see ExecutableLaunch method for details of this property.

See the ExecutableLaunch method, Executable methods, return to Properties, the Developer's Reference, or the top of this document.



Margin

The Margin property specifies the relative quantity of white space between the chemical being drawn and the edge of the control.

double Margin(boolean bHorizontal);

bHorizontal is true for the horizontal margin, and false for the vertical.

The Margin value is a percentage, with 100 representing nothing but white space, and zero representing no margin. You should always ensure you have some margin when drawing a .MOL file, because coördinates of atoms are specify the centre of the atom. The default value of both margins is 80.0.

See the ExecutableLaunch method, Executable methods, return to Properties, the Developer's Reference, or the top of this document.



ReadOnly

The ReadOnly property can be used to prevent changes being made to the control.

double ReadOnly;

When the control is set to ReadOnly, then neither Cut, LoadMolFile nor Paste work. You can still Clear the content of the control.

The Margin value is a percentage, with 100 representing nothing but white space, and zero representing no margin. You should always ensure you have some margin when drawing a .MOL file, because coördinates of atoms are specify the centre of the atom. The default value of both margins is 80.0.

See the ExecutableLaunch method, Executable methods, return to Properties, the Developer's Reference, or the top of this document.



StructureComment

The StructureComment property specifies a piece of text which is associated with the control. It is not drawn.

BSTR StructureComment;

See the CompoundNumber, ItemColour, ItemFont, ItemOffset, ItemPosition, ItemSize, StructureText, and TestId properties, return to Properties, the Developer's Reference, or the top of this document.



StructureText

The StructureText property specifies a short piece of text which may be drawn in the control;

BSTR StructureText;

See the CompoundNumber, ItemColour, ItemFont, ItemOffset, ItemPosition, ItemSize, StructureComment, and TestId properties, return to Properties, the Developer's Reference, or the top of this document.



TestId

The TestId property specifies a piece of text which is associated with the control. It is not drawn.

BSTR TestId;

See the CompoundNumber, ItemColour, ItemFont, ItemOffset, ItemPosition, ItemSize, StructureComment, and StructureText properties, return to Properties, the Developer's Reference, or the top of this document.




Appendices

These appendices document some of the chemical assumptions made by the control.

Appendix 1 - Atomic Symbols
Appendix 2 - Valencies




Appendix 1 - Symbols and Isotopes

This table specifies which atomic symbols, the atomic number, and the molecular weight used by the control.

"Ac", 89, 227.00000
"Ag", 47, 107.86800
"Al", 13, 26.98150
"Am", 95, 243.00000
"Ar", 18, 39.94800
"As", 33, 74.92100
"At", 85, 210.00000
"Au", 79, 196.96700
"B", 5, 10.81100
"Ba", 56, 137.34000
"Be", 4, 9.01220
"Bi", 83, 208.98000
"Bk", 97, 247.00000
"Br", 35, 79.90400
"C", 6, 12.01115
"Ca", 20, 40.08000
"Cd", 48, 112.40000
"Ce", 58, 140.12000
"Cf", 98, 251.00000
"Cl", 17, 35.45300
"Cm", 96, 247.00000
"Co", 27, 58.93800
"Cr", 24, 51.99600
"Cs", 55, 132.90500
"Cu", 29, 63.54600
"Dy", 66, 162.50000
"Er", 68, 167.25999
"Es", 99, 254.00000
"Eu", 63, 151.96001
"F", 9, 18.99840
"Fe", 26, 55.84700
"Fm", 100, 257.00000
"Fr", 87, 223.00000
"Ga", 31, 69.72000
"Gd", 64, 157.25000
"Ge", 32, 72.59000
"H", 1, 1.00797
"He", 2, 4.00260
"Hf", 72, 178.49001
"Hg", 80, 200.59000
"Ho", 67, 164.92999
"I", 53, 126.90440
"In", 49, 114.82000
"Ir", 77, 192.20000
"K", 19, 39.10200
"Kr", 36, 83.80000
"La", 57, 138.91000
"Li", 3, 6.93900
"Lr", 103, 256.00000
"Lu", 71, 174.97000
"Md", 101, 258.00000
"Mg", 12, 24.30500
"Mn", 25, 54.93800
"Mo", 42, 95.94000
"N", 7, 14.00670
"Na", 11, 22.98980
"Nb", 41, 92.90600
"Nd", 60, 144.24001
"Ne", 10, 20.17900
"Ni", 28, 58.71000
"No", 102, 259.00000
"Np", 93, 237.00000
"O", 8, 15.99940
"Os", 76, 190.20000
"P", 15, 30.97380
"Pa", 91, 231.00000
"Pb", 82, 207.19000
"Pd", 46, 106.40000
"Pm", 61, 147.00000
"Po", 84, 210.00000
"Pr", 59, 140.90700
"Pt", 78, 195.09000
"Pu", 94, 242.00000
"Ra", 88, 226.00000
"Rb", 37, 85.47000
"Re", 75, 186.20000
"Rh", 45, 102.90500
"Rn", 86, 222.00000
"Ru", 44, 101.07000
"S", 16, 32.06400
"Sb", 51, 121.75000
"Sc", 21, 44.96500
"Se", 34, 78.96000
"Si", 14, 28.08600
"Sm", 62, 150.35001
"Sn", 50, 118.69000
"Sr", 38, 87.62000
"Ta", 73, 180.94800
"Tb", 65, 158.92400
"Tc", 43, 98.90620
"Te", 52, 127.60000
"Th", 90, 232.03799
"Ti", 22, 47.90000
"Tl", 81, 204.37000
"Tm", 69, 168.93401
"U", 92, 238.03000
"V", 23, 50.94200
"W", 74, 183.85001
"Xe", 54, 131.30000
"Y", 39, 88.90500
"Yb", 70, 173.03999
"Zn", 30, 65.37000
"Zr", 40, 91.22000



Appendix 2 - Valency

This table specifies an atomic number and charge, and the number of bonds assumed for that pair.

1,0,0
1,0,1
1,1,0
2,0,0
3,0,0
3,0,1
3,1,0
4,0,0
4,0,2
4,1,1
4,2,0
5,-1,4
5,0,3
5,0,4
5,0,5
6,-1,3
6,0,0
6,0,4
6,1,3
7,-1,2
7,-1,3
7,0,3
7,0,5
7,1,4
8,-1,1
8,0,2
8,1,3
9,-1,0
9,0,1
10,0,0
11,0,0
11,0,1
11,1,0
12,0,0
12,0,2
12,2,0
13,-1,4
13,0,0
13,0,3
13,3,0
14,-2,6
14,-1,5
14,0,0
14,0,4
15,-1,6
15,0,0
15,0,3
15,0,5
15,0,7
15,1,4
16,-2,0
16,-1,1
16,-1,7
16,0,0
16,0,2
16,0,4
16,0,6
16,1,3
16,1,5
17,-1,0
17,0,1
17,0,3
17,0,5
17,0,7
18,0,0
19,0,0
19,0,1
19,1,0
20,0,0
20,0,2
20,2,0
21,0,0
21,0,3
21,3,0
22,0,0
22,0,3
22,0,4
22,3,0
23,0,0
23,0,3
23,0,4
23,0,5
23,2,0
23,2,2
23,3,0
24,0,0
24,0,2
24,0,3
24,0,6
24,1,2
24,2,0
24,3,0
25,0,0
25,0,1
25,0,2
25,0,3
25,0,4
25,0,6
25,0,7
25,2,0
25,3,0
26,-2,0
26,-1,4
26,0,0
26,0,2
26,0,3
26,1,1
26,2,0
26,3,0
27,0,0
27,0,2
27,0,3
27,1,2
27,2,0
27,3,0
28,0,0
28,0,2
28,0,3
28,0,4
28,0,6
28,2,0
29,0,0
29,0,1
29,0,2
29,1,0
29,2,0
30,0,0
30,0,2
30,2,0
30,2,4
31,0,0
31,0,2
31,0,3
31,3,0
32,0,0
32,0,2
32,0,4
33,-1,4
33,-1,6
33,0,0
33,0,3
33,0,5
33,0,6
33,1,4
34,-1,1
34,0,0
34,0,2
34,0,4
34,0,6
35,-1,0
35,0,1
35,0,3
35,0,5
36,0,0
37,0,0
37,0,1
37,1,0
38,0,0
38,0,2
38,2,0
39,0,0
39,0,3
39,3,0
40,0,0
40,0,2
40,0,4
40,2,2
41,0,0
41,0,3
41,0,4
41,3,0
42,0,0
42,0,2
42,0,4
42,0,5
42,0,6
43,0,0
44,-2,6
44,-1,8
44,0,0
44,0,1
44,0,2
44,0,3
44,0,4
44,0,7
44,0,8
44,3,0
45,0,0
45,0,1
45,0,2
45,0,3
45,1,0
45,3,0
46,-2,4
46,0,0
46,0,2
46,0,3
46,0,4
46,0,6
46,2,0
47,0,0
47,0,1
47,0,2
47,1,0
47,2,0
48,0,0
48,0,2
48,2,0
49,0,0
49,0,3
49,1,2
49,3,0
50,-2,6
50,-1,3
50,-1,5
50,0,0
50,0,2
50,0,4
50,2,0
50,2,4
51,-2,0
51,-1,6
51,0,0
51,0,2
51,0,3
51,0,5
51,3,0
52,0,0
52,0,2
52,0,4
53,-1,0
53,0,1
53,0,3
53,0,5
53,0,7
53,1,2
54,0,0
55,0,0
55,1,0
56,0,0
56,0,2
56,2,0
57,0,0
57,0,3
57,3,0
58,0,0
58,0,3
58,0,4
58,3,0
59,3,0
59,0,0
59,0,3
60,0,0
60,0,3
60,3,0
61,0,0
62,0,0
62,0,3
62,2,0
62,3,0
63,0,0
63,0,2
63,0,3
63,3,0
64,0,0
64,0,3
64,3,0
65,0,0
65,0,3
65,0,4
65,3,0
66,0,0
66,0,3
66,3,0
67,0,0
67,0,3
67,3,0
68,0,0
68,0,3
68,3,0
69,0,0
69,0,2
69,3,0
70,0,0
70,0,3
70,3,0
71,0,0
71,0,3
71,3,0
72,0,0
72,0,4
73,0,0
73,0,5
74,0,0
74,0,4
74,0,6
75,0,0
75,0,7
76,-2,6
76,0,0
76,0,6
76,0,8
77,0,0
77,0,1
77,0,3
77,0,4
77,1,0
77,3,0
78,-2,6
78,-2,4
78,0,0
78,0,2
78,0,4
78,2,0
79,-1,4
79,0,0
79,0,1
79,0,3
79,1,0
79,3,0
80,0,0
80,0,1
80,0,2
80,1,0
80,1,1
80,2,0
81,0,0
81,0,1
81,0,3
81,1,0
81,3,0
82,0,0
82,0,2
82,0,4
82,2,0
83,-1,4
83,0,0
83,0,3
83,0,5
83,1,2
83,3,0
84,0,0
85,0,0
86,0,0
87,0,0
88,0,0
89,0,0
90,0,0
90,0,3
90,0,4
90,2,0
90,2,2
91,0,0
92,0,0
92,0,2
92,0,4
92,0,5
92,0,6
92,2,4
92,3,0
93,0,0
94,0,0
95,0,0
96,0,0
97,0,0
98,0,0
99,0,0
100,0,0
101,0,0
102,0,0
103,0,0



Index

AboutBox method
Appearance property
Appendices
ATOM_...
Atomic Symbols
Atomic Valencies
BackColor property
BOND_...
BondThickness property
BorderStyle property
CalculateMF method
CanCopy method
CanCut method
CanPaste method
Chemical Methods
Click event
Clear method
CompoundNumber property
Copy method
COUNT_...
Cut method
DblClick event
DDE Methods
DDEAddTopic method
DDECommand event
DDEConversationCommand method
DDEConversationStart method
DDEConversationEnd method
DDEDeleteTopic method
DDEGetTopic method
DDEInUse method
DDEService property
DDETimeout property
DDEXeq method
DoubleDistance property
Error Codes
Events
Executable Methods
ExecutableClose method
ExecutableGetLastError method
ExecutableHide method
ExecutableIsRunning method
ExecutableLaunch method
ExecutablePredujiceTerminate method
ExecutableReuse method
ExecutableShow method
ExecutableWindowTitle property
ForeColor property
GetAtomData method
GetAtomPosition method
GetBondData method
GetCount method
hWnd property
Introduction
Item Properties
ITEM_...
ItemColour property
ItemDrawn property
ItemFont property
ItemOffset property
ItemPosition property
ItemSize property
KeyDown event
KeyPress event
KeyUp event
LoadMolFile method
Margin property
Methods
MouseDown event
MouseMove event
MouseUp event
OCXERR_...
Other Properties
Paste method
Properties
ReadOnly property
Refresh method
SaveMolFile method
Standard Methods
Standard Properties
StructureComment property
StructureText property
Symbols
TestId property
Top of document
Valencies





Back to the top.

The Chem32S control, and this documentation, is (c) 1998 Modgraph Consultants Inc. and Cyberspace Services Ltd..

These pages are maintained by Cyberspace Services Ltd. (at demon, and CIX).

cyberspace services limited has ceased trading
this archive is hosted by arts & ego
© 1978-2024 dylan harris