Upper case / lower case problem in IDL file 
Author Message
 Upper case / lower case problem in IDL file

Hi,
  My control interface methods and properties all start with an
upper case letter, in particular four properties X1, Y1, X2, Y2,
but the tlb file generated by MIDL defines these four properties as
 x1, y1, x2, y2. The others are correct.
  Do you have any explanation ?

Here is how these properties are defined in the IDL file:
  [propget, id(12), helpcontext(1004002012), helpstring("property X1")]
HRESULT X1([out, retval] double *pVal);
  [propput, id(12), helpcontext(1004002012), helpstring("property X1")]
HRESULT X1([in] double newVal);
  [propget, id(13), helpcontext(1004002013), helpstring("property Y1")]
HRESULT Y1([out, retval] double *pVal);
  [propput, id(13), helpcontext(1004002013), helpstring("property Y1")]
HRESULT Y1([in] double newVal);
  [propget, id(14), helpcontext(1004002014), helpstring("property X2")]
HRESULT X2([out, retval] double *pVal);
  [propput, id(14), helpcontext(1004002014), helpstring("property X2")]
HRESULT X2([in] double newVal);
  [propget, id(15), helpcontext(1004002015), helpstring("property Y2")]
HRESULT Y2([out, retval] double *pVal);
  [propput, id(15), helpcontext(1004002015), helpstring("property Y2")]
HRESULT Y2([in] double newVal);

Chris.



Sat, 23 Jul 2005 18:04:42 GMT  
 Upper case / lower case problem in IDL file
Well, I found the reason: I also have a method having a parameter named
x1 (lower case). When I replace it by X1, then my type library is OK.
Seems like a bug though.

Chris.



Sat, 23 Jul 2005 21:52:25 GMT  
 Upper case / lower case problem in IDL file
I remember now that I've had similar problems with the MIDL compiler.

What version of the MIDL compiler are you using?

We never got it sorted properly, but I can't seem to find any KB articles
about it either. While we're at it - how do you people search for KB
articles? I never get a single hit :(

Anyhow - you're not alone :)

--
Kim Gr?sman, Visual C++ MVP
http://www.winwonk.com


Quote:
> Well, I found the reason: I also have a method having a parameter named
> x1 (lower case). When I replace it by X1, then my type library is OK.
> Seems like a bug though.

> Chris.



Sat, 23 Jul 2005 23:34:23 GMT  
 Upper case / lower case problem in IDL file


Quote:
> I remember now that I've had similar problems with the MIDL compiler.

> What version of the MIDL compiler are you using?

5.01.0164.
I am probably a little bit old fashioned.

Quote:
> We never got it sorted properly, but I can't seem to find any KB articles
> about it either. While we're at it - how do you people search for KB
> articles? I never get a single hit :(

Just email to vc.atl, pray, and Igor answers ;-)

Chris.



Sun, 24 Jul 2005 01:36:39 GMT  
 Upper case / lower case problem in IDL file
A known problem. The internal binary format of a TLB file maintains all
strings in a hash table, and uses indexes into this table wherever a
string is needed. This hash table preserves case but uses
case-insensitive comparisons. So the format is simply incapable of
representing two strings that are identical except for capitalization.
When the IDL file mentions such strings, MIDL compiler has no other
choice than to pick one of them. Just avoid such conflicts, that's all
you can do about it.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> Well, I found the reason: I also have a method having a parameter
named
> x1 (lower case). When I replace it by X1, then my type library is OK.
> Seems like a bug though.



Sun, 24 Jul 2005 03:07:21 GMT  
 Upper case / lower case problem in IDL file
Unfortunately, it's a feature - a damn annoying one at that. Imagine
#import-ing this TLB and having a method name casing changed,
not merely an argument name...

The problem is all string literals are stored only once in the TLB.
And the TLB is by definition case-insensitive... You guessed right,
the first occurrence of a literal decides the casing.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

Quote:

> Well, I found the reason: I also have a method having a parameter named
> x1 (lower case). When I replace it by X1, then my type library is OK.
> Seems like a bug though.

> Chris.



Sun, 24 Jul 2005 03:16:18 GMT  
 Upper case / lower case problem in IDL file
Maybe becasue some languages like VB are case-insensitive, so two method
names only differeing in case would look the same to them?

David Bell


Quote:
> A known problem. The internal binary format of a TLB file maintains all
> strings in a hash table, and uses indexes into this table wherever a
> string is needed. This hash table preserves case but uses
> case-insensitive comparisons. So the format is simply incapable of
> representing two strings that are identical except for capitalization.
> When the IDL file mentions such strings, MIDL compiler has no other
> choice than to pick one of them. Just avoid such conflicts, that's all
> you can do about it.
> --
> With best wishes,
>     Igor Tandetnik

> "For every complex problem, there is a solution that is simple, neat,
> and wrong." H.L. Mencken



> > Well, I found the reason: I also have a method having a parameter
> named
> > x1 (lower case). When I replace it by X1, then my type library is OK.
> > Seems like a bug though.



Sun, 24 Jul 2005 04:09:42 GMT  
 Upper case / lower case problem in IDL file
Not if they belong to different interfaces. But the TLB does not support
this case either.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken



Quote:
> Maybe becasue some languages like VB are case-insensitive, so two
method
> names only differeing in case would look the same to them?



> > A known problem. The internal binary format of a TLB file maintains
all
> > strings in a hash table, and uses indexes into this table wherever a
> > string is needed. This hash table preserves case but uses
> > case-insensitive comparisons. So the format is simply incapable of
> > representing two strings that are identical except for
capitalization.
> > When the IDL file mentions such strings, MIDL compiler has no other
> > choice than to pick one of them. Just avoid such conflicts, that's
all
> > you can do about it.
> > --
> > With best wishes,
> >     Igor Tandetnik

> > "For every complex problem, there is a solution that is simple,
neat,
> > and wrong." H.L. Mencken



> > > Well, I found the reason: I also have a method having a parameter
> > named
> > > x1 (lower case). When I replace it by X1, then my type library is
OK.
> > > Seems like a bug though.



Sun, 24 Jul 2005 04:19:11 GMT  
 Upper case / lower case problem in IDL file
This is damn annoying, especially if you need to import a 3rd party type
library at the top of your own IDL. The capitalization of many common method
names end up being influenced by someone else's programming style...

Q: Would it be possible to force the interpolation of your own methods
first, Ie. forward declare any dependant interfaces, and then import the 3rd
party library at the bottom of your IDL for example?
- Julien


Quote:
>Unfortunately, it's a feature - a damn annoying one at that. Imagine
>#import-ing this TLB and having a method name casing changed,
>not merely an argument name...

>The problem is all string literals are stored only once in the TLB.
>And the TLB is by definition case-insensitive... You guessed right,
>the first occurrence of a literal decides the casing.

>--
>=====================================
>Alexander Nickolov
>Microsoft MVP [VC], MCSD

>MVP VC FAQ: http://www.mvps.org/vcfaq
>=====================================




- Show quoted text -

Quote:
>> Well, I found the reason: I also have a method having a parameter named
>> x1 (lower case). When I replace it by X1, then my type library is OK.
>> Seems like a bug though.

>> Chris.



Mon, 25 Jul 2005 03:59:01 GMT  
 Upper case / lower case problem in IDL file
Did you importlib() the third party TLB? Or you only import-ed its
IDL file? You must do importlib() in the beginning of your library
section. I still cannot guarantee you if this does influence the
capitalization though...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

Quote:

> This is damn annoying, especially if you need to import a 3rd party type
> library at the top of your own IDL. The capitalization of many common method
> names end up being influenced by someone else's programming style...

> Q: Would it be possible to force the interpolation of your own methods
> first, Ie. forward declare any dependant interfaces, and then import the 3rd
> party library at the bottom of your IDL for example?
> - Julien



> >Unfortunately, it's a feature - a damn annoying one at that. Imagine
> >#import-ing this TLB and having a method name casing changed,
> >not merely an argument name...

> >The problem is all string literals are stored only once in the TLB.
> >And the TLB is by definition case-insensitive... You guessed right,
> >the first occurrence of a literal decides the casing.

> >--
> >=====================================
> >Alexander Nickolov
> >Microsoft MVP [VC], MCSD

> >MVP VC FAQ: http://www.mvps.org/vcfaq
> >=====================================



> >> Well, I found the reason: I also have a method having a parameter named
> >> x1 (lower case). When I replace it by X1, then my type library is OK.
> >> Seems like a bug though.

> >> Chris.



Mon, 25 Jul 2005 04:11:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. moving upper case names to lower case

2. Fastest way to convert lower to upper case?

3. Upper and lower case words

4. Select returning UPPER & LOWER CASE

5. STL string to upper/lower case

6. upper/lower case with VMS C

7. Convert keypress to upper case

8. Upper Case

9. convert string to Upper case

10. Converting Strings to Upper Case

11. testing 'string' for upper-case letters

12. Change a foreign language string to upper case

 

 
Powered by phpBB® Forum Software