DCOM limits
-
Does anyone know about any limits on amount of methods in one idl file? (using MS midl compiler) Is it depending on service pack?
Yes, check topics Q170989 and Q241849 on MSDN Lib. Generally, it boils to this: "Currently the maximum number of methods in an OLE automation dual interface are: Windows NT 4.0 - 110 methods Windows NT 4.0 SP2 - 512 methods Windows NT 4.0 SP3 - 1024 methods Windows 95 - 512 methods " hth
-
Does anyone know about any limits on amount of methods in one idl file? (using MS midl compiler) Is it depending on service pack?
The actual practical limit (which is more than 100 methods per interface) should never be reached. Just imagine an interface with 100 methods! This is not inteface, really - looks like "C" API. IMO if number of methods in an interface exceeds 15-20, it's time to split it. One thing that complicate the case is object propeties. They are not like regular interface methods, but anyway can take up to 2 methods per property (for "get" and "put" methods). In one of our projects where number of properties became threatening, we decided to replace them with just 2 methods: get_Property and set_Property, each one takes two arguments: property ID and VARIANT-based value. BTW, properties in OLE DB are designed the same way. This makes it possible to keep number of OLE DB interface methods small, and at the same time expose reach functionality via properties (making the whole thing quite hard to understand, but that's a topic for another discussion ;) ). Vagif Win32/ATL/MFC Developer Oslo, Norway
-
The actual practical limit (which is more than 100 methods per interface) should never be reached. Just imagine an interface with 100 methods! This is not inteface, really - looks like "C" API. IMO if number of methods in an interface exceeds 15-20, it's time to split it. One thing that complicate the case is object propeties. They are not like regular interface methods, but anyway can take up to 2 methods per property (for "get" and "put" methods). In one of our projects where number of properties became threatening, we decided to replace them with just 2 methods: get_Property and set_Property, each one takes two arguments: property ID and VARIANT-based value. BTW, properties in OLE DB are designed the same way. This makes it possible to keep number of OLE DB interface methods small, and at the same time expose reach functionality via properties (making the whole thing quite hard to understand, but that's a topic for another discussion ;) ). Vagif Win32/ATL/MFC Developer Oslo, Norway
Yes, You are right, 100 is enough. But I have little bit diferent problem. In one idl file I have more than one interface defined and sum of all methods in all interfaces is 500. When I try add any method to any interface in this dll, midl ended with strange error. I can remove method in one interface and add another in second, all work fine, but I cannot excceed 500 in idl. Does anybody know why?
-
Yes, You are right, 100 is enough. But I have little bit diferent problem. In one idl file I have more than one interface defined and sum of all methods in all interfaces is 500. When I try add any method to any interface in this dll, midl ended with strange error. I can remove method in one interface and add another in second, all work fine, but I cannot excceed 500 in idl. Does anybody know why?
Can you try splitting interfaces between different IDL files? Should probably help. BTW, are you sure that the limit is 500 and not 512? I don't think MIDL was written by VB developers ;P Vagif Win32/ATL/MFC Developer Oslo, Norway
-
The actual practical limit (which is more than 100 methods per interface) should never be reached. Just imagine an interface with 100 methods! This is not inteface, really - looks like "C" API. IMO if number of methods in an interface exceeds 15-20, it's time to split it. One thing that complicate the case is object propeties. They are not like regular interface methods, but anyway can take up to 2 methods per property (for "get" and "put" methods). In one of our projects where number of properties became threatening, we decided to replace them with just 2 methods: get_Property and set_Property, each one takes two arguments: property ID and VARIANT-based value. BTW, properties in OLE DB are designed the same way. This makes it possible to keep number of OLE DB interface methods small, and at the same time expose reach functionality via properties (making the whole thing quite hard to understand, but that's a topic for another discussion ;) ). Vagif Win32/ATL/MFC Developer Oslo, Norway