I am trying to use Aspose.Words .NET in Delphi XE via COM, as suggested from the offcial doc. However, the “Arithmetic operation resulted in an overflow” occurs. Could you help to comment ?
https://docs.aspose.com/words/net/supported-platforms/#com
PS:
The .net 2.0 version DLL downloaded from the official repo is used.
https://releases.aspose.com/words/net
PS:
VBScript works…
Dim Doc
Set Doc = CreateObject("Aspose.Words.Document")
Dim Builder
Set Builder = CreateObject("Aspose.Words.DocumentBuilder")
Builder.Document = Doc
Builder.Write "Hi there"
Doc.Save("test.doc")
PS:
The not-working Delphi version …
program Project29;
{$APPTYPE CONSOLE}
uses Aspose_Words_TLB in 'D:\My Documents\RAD Studio\8.0\Imports\Aspose_Words_TLB.pas';
var doc: _Document;
builder: _DocumentBuilder;
begin
doc: = CoDocument.Create;
builder: = CoDocumentBuilder.Create;
builder.Document: = doc;
builder.Write('hi there');
doc.Save('test.doc');
end
Hi Jiaguo,
We are working on this issue and will get back to you soon.
Best Regards,
Thank you for your efforts !
I have done some more test cases , and the trend is attached for your convenience. The .ctp file is also attached. The source code is at the end of this email.
Best wishes,
“Case 1” is to write a paragraph.
//// C#
using System.IO;
using Aspose.Words;
public class Program
{
public static void Main()
{
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("hello world");
doc.Save("test.doc");
}
}
//// VBScript / COM, note: need to call RegAsm.exe to make Aspose.Words.dll accessible via COM
Dim Doc
Set Doc = CreateObject("Aspose.Words.Document")
Dim Builder
Set Builder = CreateObject("Aspose.Words.DocumentBuilder")
Builder.Document = Doc
Builder.Write "Hi there"
Doc.Save("test.doc")
//// Delphi / CrossTalk
program Project29;
{$APPTYPE CONSOLE}
uses CTAspose_Words;
var
AWDoc: Document; // Aspose Words Document AWDocBuilder: DocumentBuilder; // Aspose Words DocumentBuilder
begin
AWDoc: = Document.Create;
AWDocBuilder: = DocumentBuilder.Create(AWDoc);
AWDocBuilder.Write('hi there');
AWDoc.Save('test.doc');
end.
“Case 2” is to insert a image.
//// C#
using System.IO;
using System.Drawing;
using Aspose.Words;
public class Program
{
public static void Main()
{
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertImage("test.bmp");
doc.Save("test.doc");
}
}
//// VBScript / COM
Dim Doc
Set Doc = CreateObject("Aspose.Words.Document")
Dim Builder
Set Builder = CreateObject("Aspose.Words.DocumentBuilder")
Builder.Document = Doc
Builder.InsertImage "test.bmp"
Doc.Save("test.doc")
//// Delphi / CrossTalk
program Project29;
{$APPTYPE CONSOLE}
uses CTAspose_Words;
var
AWDoc: Document; // Aspose Words Document AWDocBuilder: DocumentBuilder; // Aspose Words DocumentBuilder
begin
AWDoc: = Document.Create;
AWDocBuilder: = DocumentBuilder.Create(AWDoc);
AWDocBuilder.InsertImage('test.bmp')
AWDoc.Save('test.doc');
end.
I have sent the same inquiry to CrossTalk support and the comments are posted below for your convenience
news://news.Atozed.com
atozedsoftware.crosstalk.general
From: “Chad Z. Hower aka Kudzu”
Subject: Re: StackOverflowException when using Aspose.Words 14.4 through CrossTalk 1.67 ?
Date: Sun, 01 Jun 2014 13:17:53 -0400
Message-ID:
Lines: 27
On 5/30/2014 3:41 PM, Jiaguo wrote:
I have done some more test cases, and the trend is attached for your convenience.The.ctp file is also attached.The source code is at the end of this email.
I only got as far as Case1. I can confirm the problem but I have traced
it all the way through into CrossTalk libraries and the exception is not
coming from CrossTalk. The exception is being raised by the Aspose
library when CrossTalk calls the Save method.
Since I do not have the Aspose source I cannot dig deeper. I could use
reflector but that won’t let me trace into the source so locating the
issue will not be easy. I did take a quick look in reflector but their
library is obfuscated so a lot of it is gibberish.
I suspect they are doing something weird like looking for the host
application and trying to get information from it and getting confused
when it doesn’t find something it expects (ie a Delphi exe, instead of a
.NET one).
Aspose will need to run a test case using CrossTalk and a Delphi exe to
resolve the issue or will have to provide us with source to debug.
–
“Programming is an art form that fights back”
IntraWeb IRC and Web Chat:
http://www.atozed.com/intraweb/Support/IRC.aspx
Hi Jiaguo,
Thanks for these details. We need some more time to investigate the issue in detail. You will be updated as soon as the analysis is complete.
Best Regards,
Many thanks for your efforts !
Hi,
could you help to comment about the progress ? For example, could you reproduce the problem (Delphi/COM) ?
Best regards,
Hi Jiaguo,
Yes, I was able to reproduce the issue and we are trying to resolve the issue. We will update you soon. Sorry for the inconvenience.
Best Regards,
Many thanks for your kindness and efforts !

Hi,
Could you help to comment what is the status on this issue ?
Could you help to provide an ETA ?
Hi Jiago,
This requires a little more investigation. We will update you in a couple of days. Sorry for the inconvenience.
Best Regards,
Hi,
Could you help to comment what is the status on this issue ?
Hi there,
Muhammad is on leave today and will share an ETA with you shortly. Your patience is greatly appreciated and I hope this issue is resolved for you shortly.
Thanks,
Thank you for your efforts !
Hello ?
Could you help to comment what is the status on this issue ?
Hi Jiaguo,
Sorry for the delay. This is in progress and will be resolved soon. We will keep you updated.
Best Regards,
Great to know it is being solved. Many thanks for your answer ! 
Hi, is this issue really being investigated ? Or it is only queued ?
Hi Jiaguo,
We will update you on the present status soon. Please stay tuned.
Best Regards,
Hi, can you tell me what is the present status ?