/ | i | @ |
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.
Methods (and properties) can return any of the following error codes:
These error codes are shared with Chem32S 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_NOTIMP (OCX_ERROR - 3)
#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_INTERNET (OCX_ERROR -12)
#define OCXERR_SITEDOWN (OCX_ERROR -13)
#define OCXERR_URL (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)
#define OCXERR_METAFILE (OCX_ERROR -24)
#define OCXERR_UNKNOWN (OCX_ERROR -25)
#define OCXERR_ARCHIVE (OCX_ERROR -26)
#define OCXERR_EOF (OCX_ERROR -27)
#define OCXERR_FORMAT (OCX_ERROR -28)
#define OCXERR_INTERNAL (OCX_ERROR -29)
#define OCXERR_BADRXNFILE (OCX_ERROR -30)
#define OCXERR_NOTENUFBITS (OCX_ERROR -31)
#define OCXERR_VERSION (OCX_ERROR -32)
#define OCXERR_CLOSE (OCX_ERROR -33)
#define OCXERR_MOLBADKEYWORD (OCX_ERROR -34)
#define OCXERR_RTFCREATE (OCX_ERROR -35)
#define OCXERR_CRYPTO (OCX_ERROR -36)
The methods discussed in this section are grouped together by a common theme of chemistry.
The CalculateMF method calculates and returns the molecular formula of the current content of the control.
BSTR CalculateMF ();
The text associated with the MF item (see item properties) is not set until this function is called.
See the CalculateWeight method, return to Methods, Developer's Reference, or the top of this document.
The CalculateWeight method calculates and returns the molecular weight of the current content of the control.
double CalculateWeight ();
The text associated with the Weight item (see item properties) is not set until this function is called.
See the CalculateMF method, return to Methods, Developer's Reference, or the top of this document.
The Interpret interprets a string as a file, and displays it.
short Interpret (BSTR lpszString, short nFormat);
lpszFile is the string to interpret. The function returns zero, or an error code. nFormat is one of the following values:
Option zero is not very intelligent.
See the Load method, check the control's error codes, return to Methods, Developer's Reference, or the top of this document.
The Load method loads and interprets a URL, e.g. a file on a web site.
short Load (BSTR lpszURL, short nFormat);
lpszFile is the URL of the file to load. The function returns zero, or an error code. nFormat is one of the following values:
Option zero is not very intelligent.
See the Interpret method, check the control's error codes, return to Methods, Developer's Reference, or the top of this document.
The Select selects a particular MOL file to display from an SDF file.
short Select (short nFile);
The SDF file must have been loaded using Load or Interpret.
See the Load and Interpret methods, check the control's error codes, return to Methods, Developer's Reference, or the top of this document.
This methods obtain information about the loaded data.
Each of these functions accepts three short parameters, the first two are common to all three functions and are discussed here. The first parameter can be one of the following values:
In the case of SD files, all values (except certain counts) refer to the currently selected .MOL file.
The third parameter is always the specific entity in question - for example, the atom number, the bond number, etc.. These numbers alawys start from zero, so are one less than the corresponding number in .PL code.
The GetInteger method returns some integer data.
short GetInteger (short nClass, short nItem, short nID);
nItem and nID are discussed in the introduction to this section.
For each nClass, nItem can be as follows:
CLASS_COUNT
(nID is ignored)
CLASS_ATOM
#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
#define ATOM_RADICAL 15
#define ATOM_ATOMLIST 16
#define ATOM_RINGBONDCOUNT 17
#define ATOM_SUBSTITUTION 18
#define ATOM_LINKREPEAT 19
#define ATOM_LINKNOT1 20
#define ATOM_LINKNOT2 21
#define ATOM_ATTACHMENTPOINT 22
#define ATOM_RGROUP 23
#define ATOM_SGROUP 24
#define ATOM_SGROUPPARENT 25
#define ATOM_REPEATINGUNIT 26
#define ATOM_ISISOTOPE 27
#define ATOM_ISUNSATURATED 28
CLASS_BOND
#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
#define BOND_SGROUP 8
CLASS_RGROUP
#define RGROUP_SATISFY 1
#define RGROUP_RESTH 2
CLASS_SGROUP
#define SGROUP_TYPE 1
#define SGROUP_SUBTYPE 2
#define SGROUP_CONNECTIVITY 3
#define SGROUP_RESIDUE 4
#define SGROUP_EXPANDED 5
#define SGROUP_PARENT 6
See this section's introduction, the Load and Interpret methods, check the control's error codes, return to Methods, Developer's Reference, or the top of this document.
The GetReal method returns some floating point data.
float GetInteger (short nClass, short nItem, short nID);
nItem and nID are discussed in the introduction to this section.
For each nClass, nItem can be as follows:
CLASS_ATOM
#define ATOM_X 29
#define ATOM_Y 30
#define ATOM_Z 31
See this section's introduction, the Load and Interpret methods, check the control's error codes, return to Methods, Developer's Reference, or the top of this document.
The GetString method returns a string.
BSTR GetString (short nClass, short nItem, short nID);
nItem and nID are discussed in the introduction to this section.
For each nClass, nItem can be as follows:
CLASS_ATOM
#define ATOM_SYMBOL 64
#define ATOM_ALIAS 65
#define ATOM_LIST 66
CLASS_RGROUP
#define RGROUP_LOGIC 64
CLASS_SGROUP
#define SGROUP_TEXT 64
#define SGROUP_UPPERBRACKET 65
#define SGROUP_LOWERBRACKET 66
CLASS_SD
#define SD_FIELDNAME 64
#define SD_CONTEXT 65
CLASS_FIELD
The value of the field numbered nItem (starting from zero). Not all .MOL files will have values for all fields in
an .SDF.
See this section's introduction, the Load and Interpret methods, check the control's error codes, return to Methods, Developer's Reference, or the top of this document.
The control includes a number of methods which support standard Windows activities.
The AboutBox method displays a copyright dialogue.
HRESULT AboutBox ();
Return to Methods, Developer's Reference, or the top of this document.
The Clear method empties the control.
void Clear ();
Return to Methods, Developer's Reference, or the top of this document.
The Refresh method redraws the control's content.
void Refresh();
Return to Methods, Developer's Reference, or the top of this document.
Version 1.0.2, 8th May 2001
cyberspace services limited has ceased trading
this archive is hosted by
arts & ego
© 1978-2024 dylan harris