Subject: RE: C Api: how get formula text from CDFIELD structure
Thank You Ben, for good words ! I found my mistake and as ever he is very simple 
wrong function declaring:
Declare Private Function wNSFFormulaDecompile Lib wAPIModule Alias “NSFFormulaDecompile” _
( pFormulaBuffer As String, fSelectionFormula As Boolean, hM As Long, formulaTextLength As Integer) As Integer
right function declaring:
Declare Private Function wNSFFormulaDecompile Lib wAPIModule Alias “NSFFormulaDecompile” _
( Byval pFormulaBuffer As String, fSelectionFormula As Boolean, hM As Long, formulaTextLength As Integer) As Integer
Can I ask one more question ? I don’t understand how to parse CDFIELD record attribute Flags 
For example, I have Flags attribute with value:
first byte -> 8A
second byte -> 00
In result have 0x8A00
In api documentation I found what meanings can have flags attribute and no one of this not correct for me.
/* CDFIELD Flags Definitions */
#define V3SPARESTOCLEAR 0x0075 /* Clear these if FOCLEARSPARES is TRUE */
#define FREADWRITERS 0x0001 /* Field contains read/writers */
#define FEDITABLE 0x0002 /* Field is editable, not read only */
#define FNAMES 0x0004 /* Field contains distinguished names */
#define FSTOREDV 0x0008 /* Store DV, even if not spec’ed by user */
#define FREADERS 0x0010 /* Field contains document readers */
#define FSECTION 0x0020 /* Field contains a section */
#define FSPARE3 0x0040 /* can be assumed to be clear in memory, V3 & later */
#define FV3FAB 0x0080 /* IF CLEAR, CLEAR AS ABOVE */
#define FCOMPUTED 0x0100 /* Field is a computed field */
#define FKEYWORDS 0x0200 /* Field is a keywords field */
#define FPROTECTED 0x0400 /* Field is protected */
#define FREFERENCE 0x0800 /* Field name is simply a reference to a shared field note */
#define FSIGN 0x1000 /* sign field */
#define FSEAL 0x2000 /* seal field */
#define FKEYWORDS_UI_STANDARD 0x0000 /* standard UI */
#define FKEYWORDS_UI_CHECKBOX 0x4000 /* checkbox UI */
#define FKEYWORDS_UI_RADIOBUTTON 0x8000 /* radiobutton UI */
#define FKEYWORDS_UI_ALLOW_NEW 0xc000 /* allow doc editor to add new values */