Recent Posts

Pages: [1] 2 3 ... 10
1
ObjAsm / Re: ObjAsm64
« Last post by Biterider on February 25, 2018, 10:33:11 PM »
Hi
I am often in the situation that I have to visualize or export data. In most cases, the tool of my choice is EXCEL.
To facilitate the EXCEL programming, the way to go is using COM. EXCEL uses various standard interfaces and very intensively dispatch interfaces. I used the EXCEL version 10.0 definitions and translated the core elements with ComView. The rest was manually polished and put into Excel.inc and Excelc.inc.
For convenience, I created an object called ExcelHost that handles the most common tasks, such as opening, closing, data exchange, charting, and so on. This object can easily be extended to handle formulas, macros, pivot tables, and so on. It looks this way:
 
Code: [Select]
Object ExcelHost, ExcelHostID, Primer
  StaticMethod      CloseBook,                POINTER
  StaticMethod      DeleteSheet,              POINTER
  RedefineMethod    Done
  StaticMethod      GetCell,                  POINTER, DWORD, DWORD, POINTER, DWORD
  StaticMethod      GetRange,                 POINTER, BSTR
  StaticMethod      GetSheet,                 POINTER, BSTR
  StaticMethod      GetSheetName,             POINTER
  RedefineMethod    Init,                     POINTER
  StaticMethod      NewBook
  StaticMethod      NewChart,                 DWORD, DWORD, BSTR
  StaticMethod      NewSheet,                 POINTER, BSTR
  StaticMethod      Open,                     BSTR
  StaticMethod      SaveAs,                   POINTER, BSTR
  StaticMethod      SelectRange,              POINTER
  StaticMethod      SetCell,                  POINTER, DWORD, DWORD, BSTR
  StaticMethod      SetColumnWidth,           POINTER, BSTR, REAL4

  StaticMethod      GetBorder,                POINTER
  StaticMethod      SetBorderAttr,            POINTER, DWORD, DWORD, DWORD

  StaticMethod      GetFont,                  POINTER
  StaticMethod      SetFontAttr,              POINTER, BSTR, DWORD, DWORD, DWORD, DWORD

  StaticMethod      GetInterior,              POINTER
  StaticMethod      SetInteriorAttr,          POINTER, DWORD, DWORD, DWORD

  StaticMethod      SetChartData,             POINTER, POINTER, DWORD
  StaticMethod      HasChartTitle,            POINTER, DWORD
  StaticMethod      GetChartTitle,            POINTER
  StaticMethod      SetChartTitleText,        POINTER, BSTR
  StaticMethod      GetChartAxis,             POINTER, DWORD, DWORD
  StaticMethod      SetChartAxisAttr,         POINTER, DWORD, DWORD, DWORD, DWORD
  StaticMethod      SetChartAxisValues,       POINTER, DWORD, REAL8, DWORD, REAL8
  StaticMethod      SetChartAxisTicks,        POINTER, DWORD, DWORD, REAL8, DWORD, DWORD, REAL8
  StaticMethod      SetChartAxisGridlines,    POINTER, DWORD, DWORD, DWORD, DWORD, DWORD
  StaticMethod      GetChartLegend,           POINTER
  StaticMethod      GetChartArea,             POINTER
  StaticMethod      GetChartPlotArea,         POINTER
  StaticMethod      GetChartSeries,           POINTER, DWORD
  StaticMethod      SetChartSeriesAttr,       POINTER, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD
  StaticMethod      SetChartSeriesData,       POINTER, BSTR, POINTER, POINTER

  StaticMethod      SetRangeAlignHor,         POINTER, DWORD
  StaticMethod      SetRangeAlignVer,         POINTER, DWORD
  StaticMethod      GetRangeBorder,           POINTER, DWORD
  StaticMethod      GetRangeArray,            POINTER, POINTER
  StaticMethod      CreateArray,              DWORD, DWORD, POINTER

  StaticMethod      SetRowHeight,             POINTER, BSTR, REAL4
  StaticMethod      SetSavedFlag,             POINTER, DWORD
  StaticMethod      SetSheetName,             POINTER, BSTR
  StaticMethod      SetVisible,               DWORD
  StaticMethod      Quit

  DefineVariable    pIExcelApp,               POINTER,  NULL
ObjectEnd

As you can see above, the strings are BStrings as used in COM automation. ObjAsm provides all the necessary tools in the ObjMem64 library and BString.inc macros to handle these types of strings.
Attached is an executable that shows some of the possibilities with ExcelHost. There you will also find the Excel interface definitions.
As a side note, I had to change the name of the interface definition macros to avoid conflict with other macros coming from other packages. The new format looks like this:

Code: [Select]
COM_INTERFACE_BEG IExcelFont, IDispatch, <0002084D-0001-0000-C000-000000000046>
 COM_MTD_STD  get_Application, ptr ptr Application
 …
COM_INTERFACE_END
 

The start of the interface is signaled with the macro COM_INTERFACE_BEG. It requires as argument a name, a predecessor interface and a GUID. It is convenient to include this last one here to have all relevant information together. The following lines specify the methods contained in the order of occurrence. These can be standard (COM_MTD_STD) or dispatch methods (COM_MTD_DSP). The end of the interface definition is signaled with the macro COM_INTERFACE_END.
If you want to use the interface definitions for your own implementation, you can easily change the above macros. It should be a simple task for a MASM coder   :biggrin:
 
Regards, Biterider
2
The Campus / Re: Converting Arithmetic Expressions to Assembly
« Last post by UniverseIsASimulation on February 25, 2018, 09:48:30 PM »
It's not. My website sleeps from 22 to 23 PM UTC+1. If I want to make it accessible 24h/day, I'd have to pay for the hosting, and now it's free.
3
The Campus / Re: Converting Arithmetic Expressions to Assembly
« Last post by hutch-- on February 25, 2018, 06:13:30 PM »
Sad to say the link is broken.
4
MasmBasic & the RichMasm IDE / Re: JJ_Include and saveAsTemplate
« Last post by jj2007 on February 25, 2018, 04:41:56 PM »
OK, there was a problem with long comments at the start of the file. Try the attached beta.
- Ctrl click skips the MsgBox and exports with comments stripped.
- normal click shows a MsgBox; yes exports content without, no exports with comments.
5
The Soap Box / Re: Office 2019
« Last post by jj2007 on February 25, 2018, 10:08:29 AM »
Office what? I have never had installed Microsoft Office in my home laptop/pc. Kingsoft office is exactly the same but freeware, all what I need in my home.

The KingSoft suite looks nice indeed. It is a bit slow, though; I made some tests with a 20MB tab-delimited file, loading is a factor 2 slower than with M$ Excel, sorting even a factor 5 or so (and I remember that OpenOffice was even slower). My unfinished spreadsheet control is another factor 3-5 faster, but that is an unfair comparison, as both KingSoft and Excel offer many more features.
6
The Soap Box / Re: Office 2019
« Last post by jimg on February 25, 2018, 09:34:54 AM »
Libreoffice here :)
7
MasmBasic & the RichMasm IDE / Re: JJ_Include and saveAsTemplate
« Last post by LordAdef on February 25, 2018, 08:18:03 AM »
I use conventional semi-colon comments. One file attached.
8
The Soap Box / Re: Office 2019
« Last post by felipe on February 25, 2018, 05:56:21 AM »
When i need to open some file like those (lets say office like files) i installed open office. What i like of it, is that it can convert a word file in a pdf file very easily.
9
The Soap Box / Re: Office 2019
« Last post by caballero on February 25, 2018, 05:52:02 AM »
Office what? I have never had installed Microsoft Office in my home laptop/pc. Kingsoft office is exactly the same but freeware, all what I need in my home.
10
The Soap Box / Re: Office 2019
« Last post by Vortex on February 25, 2018, 05:42:00 AM »
Hi Jochen,

Me too, I prefer Office 2003. It works fine. No eye-candy stuff.

Hi aw27,

Exactly, that's happening.

Hi Hutch,

I guess it must a problem related to the DLLs shipped with Office 2000. Sadly, M$ is crippling old software to sell the new versions.
Pages: [1] 2 3 ... 10