AddItem-method for MSHFlexGrid 6.0
-
Hello! I am new to programming in VC++ and I have a problem with the MSHFlexGrid 6.0. I have three edit-fields and a FlexGrid with three columns. When I push a button the entries from the edit-fields shall be put in the columns of the grid and a new row must be added. I thought I can do this with the AddItem-method, but I couldn´t get it working. The syntax is: Object.AddItem(LPCSTR item; const Variant &); What must I enter for the second term? Or do you have any other ideas how I can solve my problem? Thanks for reading, Stefan
-
Hello! I am new to programming in VC++ and I have a problem with the MSHFlexGrid 6.0. I have three edit-fields and a FlexGrid with three columns. When I push a button the entries from the edit-fields shall be put in the columns of the grid and a new row must be added. I thought I can do this with the AddItem-method, but I couldn´t get it working. The syntax is: Object.AddItem(LPCSTR item; const Variant &); What must I enter for the second term? Or do you have any other ideas how I can solve my problem? Thanks for reading, Stefan
The method should describe the variant type For example if you need a BSTR as variant type you need for second parameter CString strString = "Your Text"; VARIANT va; VariantInit(&va); va.vt = VT_BSTR; va.bstrVal = strString.AllocSysString(); Object.AddItem("Whatever",&va); For other type of variant initialze proper memeber of VARIANT . vt memeber will descibe what member will be used and you will initialize that one (could be more) Best regards, /REMUS