Movatterモバイル変換


[0]ホーム

URL:


PEP 245

Alex Shindichshindich at itginc.com
Wed Apr 4 16:39:35 EDT 2001


I am writing this message in an attempt to undo the damage that the recentdiscussion about COM caused, as I believe that some members of the Pythoncommunity may have been led to false conclusions about the COM technology.First of all, I would like to apologize for any false COM-related statementsmade by me. At no point in time did I intend to educate anyone about COM,nor did I intend to explain anyone how the COM technology works. Again, ifmy statements caused confusion, I sincerely apologize for that.Second of all, I would like to encourage people interested in learning moreabout COM to take everything said in this thread with a great deal ofcaution, and instead read one of the following books:1. Inside COM, by Dale RogersonAmazon Link:http://www.amazon.com/exec/obidos/ASIN/1572313498/o/qid=986414511/sr=8-1/ref=aps_sr_b_1_1/107-6092622-01669352. Essential COM, by Don Box -- My personal favoriteAmazon Link:http://www.amazon.com/exec/obidos/ASIN/0201634465/qid=986414619/sr=1-1/ref=sc_b_2/107-6092622-01669353. Effective COM: 50 Ways to Improve Your COM and MTS-based Applications,by Don Box, Keith Brown, Tim Ewald, Chris Sells -- This book talks aboutmore advanced topicsAmazon Link:http://www.amazon.com/exec/obidos/ASIN/0201379686/qid=986414768/sr=1-4/ref=sc_b_5/107-6092622-0166935Why do I recommend to take the recent conversation wit a great deal ofcaution? For a very simple reason. I made certain misleading statementsabout COM. For instance, I said that "COM components can be written usinganything that is capable of creating C++-compatible virtual tables." Thatstatement was only partially true, and Mr. Martelli was kind enough tocorrect me. He said: "(Not quite -- the methods in the almost-virtual-tablesof COM need to use calling-convention __stdcall, with 'this' aka 'self' asthe first [implicit] argument on the stack, while C++ compilers for Win32platforms, depending on their brand, normally use __fastcall [arguments inregisters] or else __thiscall ['this' aka 'self' in the CX register], forexample -- a minor issue, but let's not spread _further_ misinformationabout COM, shall we:-)." And his comment was quite valid. He was alsocorrect explaining that one of the reasons for using __stdcall convention isto standardize on how parameters are being passed into the methods. Exceptthat he did not explain the whole picture. For instance he omitted the factthat __stdcall convention requires that a function being called removes theparameters from the stack before the function returns. This is as importantof a requirement as the mechanism of passing parameters, i.e. one cannotcreate COM-compatible interfaces if the functions implementing interfacemethods do not clean up the stack before returning from the call. Fromreading Mr. Martelli's comment one may have been misled about the meaning ofthe __stdcall calling convention.ATTENTION: I did not list all the other restrictions associated with__stdcall. For detailed information search for "__stdcall" on MSDN.While the issue I pointed out is not very significant in itself, it showsthat even such trust-worthy community members as Mr. Martelli do not alwaysprovide complete information. And therefore it is better to read books.Sincerely,Alex Shindich


More information about the Python-listmailing list

[8]ページ先頭

©2009-2025 Movatter.jp