Type Library import generator tool has a interesting BUG!
Type Library import generator tool has a interesting BUG!
If you import component-> Import a type library, you can get a unit named like XXX_TLB.pas, for example, Office_TLB. Everything worked and fine, until I close all project and re-open it. I found interesting thing happened : If i double click TLB.pas file in Project manager dialog, it launch EXTERNAL editor which I assigned .pas extension. Firstly, I thought something wrong with my project file? or perhaps the registry broken? I tried every possibilities without success. Finally, I just tried to copy ALL content of that unit, and pasted to notepad, strange thing happened: just top part of content were pasted! ...So I tried to use Sublime editor to open that file, a "NUL" symbol vivid showed to my eyes! Wow~ this is an invisible BUG. Even XE6 update1 still has this problem: " ultra NUL byte followed by XXXX.chm". The bug is existed for Every import library unit! Just take a look for picture you will see very interesting phenomenon.
After deleted that NUL byte, everything got fine! XD
Steps to reproduce?
ReplyDeleteJeroen Wiert Pluimers create new vcl delphi project.
ReplyDeletemenu->Component->import component, import type library, choose ado or office or any kind of COM object, next.....
add XXX_TLB.pas to your project. save all then close all project files.
reopen project. now you can test what I mentioned above, like double click on unit, or find syntax error.... or try to select ALL content of XXX_TLB.pas, and paste to windows notepad...
It seems to happen only when there is a helpfile. Perhaps only with that one helpfile.
ReplyDeleteUwe Raabe
ReplyDeleteI guess it is. Thanks. :)
Qing-Shan Xiao can you test the files without help files?
ReplyDeleteJeroen Wiert Pluimers
ReplyDeleteOOPS, Sorry sir, I don't have any idea which COM with or without that. Just I tried Office, ADO, they have mentioned about help file (although there actually NO that file in that dictionary... for example vbaof11.chm doesn't in my system) .
I will try more if I have time. :P
Thanks. please let the Delphi community know your findings.
ReplyDeleteI just dig deeper for problem. YES. Just ONLY when that type library has helpfile dscription in it will cause the problem.
ReplyDeleteI use visual studio OLEViewer :
for example :
[
uuid(2DF8D04C-5BFA-101B-BDE5-00AA0044DE52),
version(2.3),
helpstring("Microsoft Office 11.0 Object Library"),
helpfile("vbaof11.chm"),
helpcontext(0x00000001),
custom(0F21F359-AB84-41E8-9A78-36D110E6D2F9, "Microsoft.Office.Core.dll")
]
above type lib will cause trouble.
below won't:
[
uuid(714DD4F6-7676-4BDE-925A-C2FEC2073F36),
version(1.0),
helpstring("AccessibilityCplAdmin 1.0 Type Library")
]
Thanks for remind me:
Uwe Raabe and Jeroen Wiert Pluimers