Edit
Attach
Printable
topic end
<!-- * Set TOPICTITLE = Claus Brod: Should <tt>type</tt> be of type Type? (31 Dec 2005) --> <style type="text/css"> pre {background-color:#ffeecc;} </style> %STARTINCLUDE% <a name="$day"></a> ---+++ [[BlogOnSoftware20051231Type][Should <tt>type</tt> be of type Type?]] (31 Dec 2005) The other day, we were writing some .NET code for which we produced COM wrappers, including a type library (through =tlbexp=). One of the exported methods looked like this (in Managed C++): <verbatim> void AddButton(String *title, String *icon, ActionType type); </verbatim> In a COM test client which referred to said type library, the compiler reported inexplicable errors. They hinted that the parameter named (!) =type= somehow was thought to be of type [[http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemtypeclasstopic.asp][System.Type]]... but why? =type= is correctly declared as an =ActionType=, not as =System::Type=! I won't tell you what other means we used to track down this issue; let me just advise you to clean those chicken blood stains as early as possible, before they stick to your keyboard just like, well, chicken blood .-) In the end, [[http://search.barnesandnoble.com/bookSearch/isbnInquiry.asp?sourceid=00387042536162273707&ISBN=067232170X&bfdate=01-21-2005+15:54:04][Adam Nathan's blue bible]] had the right hint for us: Type libraries maintain a case-insensitive identifier table. Once an identifier has been added to the table in one case, any subsequent attempts to add the identifier to the table again will simply fail, regardless of the case. So in our example, the first "type"-ish identifier which was added to the table was =System::Type=. (Or maybe it was actually a parameter called =type= which was of type =System::Type=?). Later, the parameter name =type= was encountered, but no longer added to the table because of its unlikely relative which made it into the table first. Any subsequent references to anything called "type" or "Type" or "tYPE" would then resolve to =System::Type=, with the aforementioned consequences. %COMMENT{type="below" nonotify="on"}% --- %STOPINCLUDE%
to top
End of topic
Skip to action links
|
Back to top
Edit
|
Attach image or document
|
Printable version
|
Raw text
|
Refresh
|
More topic actions
Revisions: | r1.1
|
Total page history
|
Backlinks
You are here:
Blog
>
BlogOnSoftware20051231Type
r1.1 - 17 Feb 2006 - 06:53 -
ClausBrod
to top
Blog
This site
2017
:
12
-
11
-
10
2016
:
10
-
7
-
3
2015
:
11
-
10
-
9
-
4
-
1
2014
:
5
2013
:
9
-
8
-
7
-
6
-
5
2012
:
2
-
10
2011
:
1
-
8
-
9
-
10
-
12
2010
:
11
-
10
-
9
-
4
2009
:
11
-
9
-
8
-
7
-
6
-
5
-
4
-
3
2008
:
5
-
4
-
3
-
1
2007:
12
-
8
-
7
-
6
-
5
-
4
-
3
-
1
2006:
4
-
3
-
2
-
1
2005:
12
-
6
-
5
-
4
2004:
12
-
11
-
10
C++
CoCreate Modeling
COM & .NET
Java
Mac
Lisp
OpenSource
Scripting
Windows
Stuff
Changes
Index
Search
Maintenance
Impressum
Datenschutzerklärung
Home
Webs
Atari
Blog
Claus
CoCreateModeling
Klassentreffen
Main
Sandbox
Sommelier
TWiki
Xplm
Jump:
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback