Somehow, it does not want to open the file which is line 2. I know that teDocs works because it gives me a number on line 3. The item oDTD on number 2 is an object. How does juno passes an object to a COM call?

the application is Trados Tag Editor. It is a translation software that we use. Most of the libraries are in .net, but I have translated most of the code to D, but I am having problem with this one. I need to continue with this, since I want to show the folks where I work that .net is not the only solution. .-)

Sorry about the wait, but as we all know, time is not what it used to be... Ok, so I had a few hours and went and downloaded the OLE package from MS and I found out that the Open statements for the Document call is defined this way,

I am passing the object and not the pointer of the object. How do I pass the pointer of the object to the call? I tried passing the *oDTD, but I get "TTXd.d(65): Error: can only * a pointer, not a 'juno.com.client.DispatchObject'".

So, in my code ... I am passing the object and not the pointer of the object.

No, you are passing a VARIANT instance - oDTD - which holds a reference to the IDtdSettingsFile object.

OleView's output is misleading - it's showing you IDL code, which (like C++) adds the pointer notation, while D doesn't need it. That code is also really only relevant for early binding. In late binding, which is what you're doing, function arguments get wrapped in a VARIANT. And oDTD is a VARIANT anyway.

But you could always unwrap it and pass the object reference (which will eventually get wrapped again):

Also, might be worth checking the value of the oDTD's vt field - it should be either VARTYPE.VT_UNKNOWN (13) or VARTYPE.VT_DISPATCH (9) (depending on which interface IDtdSettingsFile derives from). If it's neither, then something's amiss.

Also, might be worth checking the value of the oDTD's vt field - it should be either VARTYPE.VT_UNKNOWN (13) or VARTYPE.VT_DISPATCH (9) (depending on which interface IDtdSettingsFile derives from). If it's neither, then something's amiss.

Sorry about my lack of knowledge, but how do I do this? I tried oDTD.vt and I get "Error: no property 'vt' for type 'juno.com.client.DispatchObject'".

thanks for the help. I have gotten all of the classes to work with D, but this one. Any help will be greatly appreciate it.

it would be a VARIANT, because the "call" method returns a VARIANT unless you specify otherwise (and you haven't). Please post the current version of your code.

And if you're trying to pass a DispatchObject to teDocs.Open, then that would explain why it's failing - it's expecting an instance of IDtdSettingsFile (in the case of early binding) or a VARIANT (when late binding, as we're doing here).