Hi,
I am sorry for the language again!
But i think you miss understand how
OLE objects works, and this line
Code:
alo := CreateOleObject('Aloaha_ZUGFeRD.XML');
Is trouble waiting to cause you a headache later, either on your device or on your clients.
See, CreateOleObject can do way more than you think, it is so much generic that you should be very careful with it and with what you are creating by name, you can call on text file like 'mynotes.txt' and it might create an
OLE machine form notepad or Visual Studio or ..... you can't be sure what are you calling or creating because it will use what the system has installed and registered, take this question and its answer from here, and please read it carefully
https://stackoverflow.com/questions/...ing-ole-delphi
On your device,
XML files are registered types with/for the "aloaha ZUGFeRD" and that why it is working, yet on another devices there could be different
OLE or application had registered
XML type (or mime-type....) and hence the var alo will hold unknown and undefined
OLE object.
the right and concise way to do it is same as the answer and example in link to StackOverflow, create the
OLE by its name not by the registered type then call on open the file, this will not fail.
For Example .... (well i can't find now) but in earlier post i suggest that you must use the constants for the
CLSID, these constants are included in the TLB file, so find you
OLE by its constant and create it then open the file 'Aloaha_ZUGFeRD.XML', and alo (the var/variable) doesn't need to be variant, it could be the interface you are using, also the
IDE autocomplete will works for you and will make your life easier.
Hope that was clear and good luck !
ps: if you search more, either the forum or the internet, you will also find you can call on use
COM/
DCOM without even registration, these registered your
OLE, this will further remove the need to register aloaha and you can use it in very similar way to a
DLL, hence remove any future conflict with the versions.