I have a .NET dll that has some interfaces \ classes that are affected by com. during the build procedure a .tlb file is created, and some C ++ code refers to this tlb. As a result, the compiler creates a .tlh file for tlb.
When I run the assembly locally, one of the properties in one of the interfaces ends with the corresponding method in tlh, which does not have the same name. The property in the .net code is called PropertyA end, which is called get_propertyA, and PropertyB ends with the name get_PropertyB. I didnβt beat for a century when this happened, I just used the method defined in tlh and assumed that everything was hunky dory, however, when I introduced these changes, the assembly did not work for anyone else, because the compilers generated properties called get_PropertyA and get_PropertyB (random case mismatch in propertyA).
The tlb files generated on both machines are identical (according to hexadecimal matching), and the tlh files are generated by the same version of the compiler.
The build procedure creates tlb by executing: path regasm \ to \ dll \ Mydll.dll -tlb: path \ to \ output \ mydll.tlb
Any ideas why my local version ends with a property with the wrong name? Or what can I do to fix this?
UPDATE: I read that tlbexp will use the first version of the string found and which can be changed by recompiling. Although I do not use tlbexp, I wondered if this was a problem. I found parameters with the same name as my method (in other ways), but with a lowercase letter at the beginning. So I replaced all of these. Rebuilt, unchanged. Then I renamed my COM method. Built and received the expected missing method errors. Renamed the method back to its original name, and it looks like it has been fixed. Since it works now, and I cannot make it crash again, I cannot try the suggested solutions, but I like the idea of ββrenaming in case this happens in the future.
Sam holder
source share