Xojo and InDesign on Windows 7

Hi all,

I’m mostly a Mac guy, but I have to port a Mac app that drives InDesign to Windows 7 Pro. On my MBPro running Windows 7 (32 bit) in Bootcamp, I can’t even get a one-line program to compile; the Xojo compiler just crashes. So I moved to a 64-bit Win 7 Pro box. The app compiles OK, but crashes immediately. Any suggestions are welcome.

Here’s the code for my app in its entirety (the real app is much more complex than this 3-liner):

dim idObj As InDesign.Application = new InDesign.Application
dim myDoc as InDesign.Document
myDoc = idObj.Documents.add(true)

When I run this, I get this error from “InDesign.Application.Documents.Get” :

Get
If mThis = Nil Then Raise New NilObjectException
Dim disp As New COM.IDispatch(mThis)
Call disp.AddRef
Dim memID As Integer = 1685021555
Dim resultCode As Integer
Dim params As New MemoryBlock( COM.DISPPARAMS.Size )
Dim result As New MemoryBlock( COM.SIZEOF_VARIANT )
Dim err As UInt32
resultCode = disp.Invoke( memID, COM.IID_NULL, COM.LOCALE_USER_DEFAULT, COM.DISPATCH_PROPERTYGET, params, result, nil, err )
If resultCode = COM.S_OK Then
Dim retVal As Variant = COM.VARIANTToRBVariant( result )
If Nil = retVal Then Return Nil
Return New InDesign.Documents( COM.IUnknown(retVal).Handle )
Else // Throw Exception
Raise New COM.COMException(“Failed on Documents”, resultCode )
End If

End Get

I’ve tried this with InDesign CC (v9.2.1 x32) and InDesign CS3 (v5.04)

Any thoughts? I really don’t want to have to move to Visual Studio for this, but (as usual) the client is in a hurry to have this running, so I’ll do what it takes.

Thanks!

Edit: the bug symbol is next to the 2nd line; so I guess it’s saying that mThis is Nil. But why? I can do exactly this in Visual Studio without a problem.

Edit: forgot to say I’m running 2014r1.1, no 3rd-party plugins at the moment.

Have you found a solution for this issue? I get the exact same error.

What about using the constructor ?

dim myDoc as new InDesign.Document