0

I have a C++ COM application with lots of classes. One class Utils has a function called GDALWarp() I have a second class with similar functions but a different approach called GdalUtils and it has a function called GdalWarp().

In my idl I have both functions. The first one with uppercase GDAL and the other not.

I use this COM application in a C# application and when a instantiate GdalUtils() I only have GDALWarp(uppercase) and not GdalWarp(). But it is still running the correct function in de COM application. When I comment out the GDALWarp function in the idl, I do have GdalWarp(lowercase).

Why this difference?

The idl is on GitHub: https://github.com/MapWindow/MapWinGIS/blob/develop/src/MapWinGIS.idl#L4584 https://github.com/MapWindow/MapWinGIS/blob/develop/src/MapWinGIS.idl#L6640

Paul Meems
  • 3,002
  • 4
  • 35
  • 66
  • What do you mean by "why this difference"? Also, please show us how do you call these methods in C# – Simon Mourier Jun 14 '19 at 15:55
  • The type library that's generated from the IDL also needs to be usable by languages that are case-insensitive. Basic being the most typical example. To ensure it is, the type library generator uses a very crude trick, it makes the casing of all identical identifiers the same. First one it encounters wins. Nothing you can do to stop it being helpful like that, other than giving the function a better name. – Hans Passant Jun 14 '19 at 16:06
  • Duplicates of this question: [one](https://stackoverflow.com/questions/7261517/problems-with-naminglowercase-uppercase-when-exporting-com-component-from-c-sh), [two](https://stackoverflow.com/questions/26302927/midl-changes-the-interface-name). – Hans Passant Jun 14 '19 at 16:09
  • Thanks @HansPassant for the clarification. I didn't think about the case-insensitive languages. I'll see if I can rename my new method. – Paul Meems Jun 17 '19 at 10:29

1 Answers1

0

After the clarification of @HansPassant I renamed the function and now the problem is solved.

Paul Meems
  • 3,002
  • 4
  • 35
  • 66