Click here to Skip to main content
15,885,998 members
Home / Discussions / COM
   

COM

 
GeneralCom Controls and overloading pretranslator() Pin
15-Jun-01 3:39
suss15-Jun-01 3:39 
GeneralWorer thread notification and VB Pin
15-Jun-01 2:02
suss15-Jun-01 2:02 
GeneralWhy Am I Getting Linker Errors On GetObjectContext In ATL/C++ Code Pin
14-Jun-01 11:48
suss14-Jun-01 11:48 
GeneralAggregation in Inside Com Pin
jcyoon14-Jun-01 5:35
jcyoon14-Jun-01 5:35 
GeneralRe: Aggregation in Inside Com Pin
18-Jun-01 20:29
suss18-Jun-01 20:29 
GeneralRe: Aggregation in Inside Com Pin
jcyoon21-Jun-01 8:55
jcyoon21-Jun-01 8:55 
QuestionHow to add MFC support to ATL EXE Project? Pin
14-Jun-01 5:10
suss14-Jun-01 5:10 
QuestionLimitation of .tlb import in VC++? Pin
14-Jun-01 4:03
suss14-Jun-01 4:03 
I *appear* to have run into a limitation (or perhaps a bug?) in the #Import statement used to import a type library in Visual C++. Since I can find no documentation on this, I was hopeing that one of you might be able to shed some light on my problem.

Imagine that I have two projects. One automation server, and one client.
1) The Automation server
The server is defined by an .idl file containing several (dual) interfaces (around 20). Among all those interfaces I have a total of 499 functions defined.

2) The Automation client
The client uses the #import statement to import the type library (.tlb) created by the server.

At this point, everthing works fine. The #import <.tlb> runs smoothly and the client can access and use the functionality of the server without a problem.
Now... If I add another function to the server (function 500) suddenly the client refuses to compile.
I've determined that the problem is not simply a syntax problem. It appears to me, that the #import directive has a fixed limit of 499 functions that it can handle before it chokes. Can anyone confirm this?
Looking at the client-generated implementation files (*.tlh and *.tli), I find that the output generated for the two different versions (499 functions vs. 500 functions) is quite different. The *.tlh file for the 499 function version (the one that works) contains an #include statement at the bottom to include the *.tli file. In the 500 function version, the #include is replaced by:
#pragma start_map_region(<*.tli file and path>)
__declspec(implementation_key(1)) short <function1> ( );
__declspec(implementation_key(1)) short <function2> ( );
... // functions 3 to 498 excluded for brevity
__declspec(implementation_key(1)) short <function499> ( );
__declspec(implementation_key(1)) short <function500> ( );


I'm willing to entertaint the argument that I simply should not ever create (much less import) a type library containing 500+ functions. However, I would still like to find out what the story is with this, if only to satisfy my curiosity.
Also, I can find no documentation on either the "#pragma start_map_region" or "__declspec(implementation_key())" statements. (I know what #pragma and __declspec are Smile | :) . Can anyone tell me what these are and what they do?

Thank you.
AnswerRe: Limitation of .tlb import in VC++? Pin
J Patel21-Jun-01 11:38
J Patel21-Jun-01 11:38 
Questionwhat does ESP means? Pin
14-Jun-01 3:00
suss14-Jun-01 3:00 
AnswerRe: what does ESP means? Pin
Kevin Perry (msft)19-Jun-01 19:06
Kevin Perry (msft)19-Jun-01 19:06 
Generalexception handling framework Pin
praveen prabhakar13-Jun-01 14:05
praveen prabhakar13-Jun-01 14:05 
General[dual] (un)happiness Pin
13-Jun-01 2:01
suss13-Jun-01 2:01 
GeneralRe: [dual] (un)happiness Pin
3-Jul-01 5:22
suss3-Jul-01 5:22 
GeneralRich Edit Controls - Embedding Files Pin
Steve Thresher12-Jun-01 1:51
Steve Thresher12-Jun-01 1:51 
GeneralUnable to locate assembly error Pin
11-Jun-01 22:31
suss11-Jun-01 22:31 
GeneralDefault parameter values Pin
Christian Dahl10-Jun-01 23:29
Christian Dahl10-Jun-01 23:29 
GeneralRe: Default parameter values Pin
Ulf Öhlén10-Jun-01 23:47
Ulf Öhlén10-Jun-01 23:47 
GeneralConfiguring a COM+ Server Application as an NT Service Pin
12ways10-Jun-01 22:18
12ways10-Jun-01 22:18 
QuestionHow to get the com-GUID directly from its dll or exe file Pin
9-Jun-01 19:02
suss9-Jun-01 19:02 
AnswerRe: How to get the com-GUID directly from its dll or exe file Pin
MikeG18-Jun-01 6:17
MikeG18-Jun-01 6:17 
QuestionHow to get the com-GUID directly from its dll or exe file Pin
9-Jun-01 18:57
suss9-Jun-01 18:57 
QuestionHow to get the com-GUID directly from its dll or exe file Pin
9-Jun-01 18:57
suss9-Jun-01 18:57 
GeneralAutomatic help creation for a COM/ActiveX type library Pin
8-Jun-01 5:27
suss8-Jun-01 5:27 
GeneralI am new Pin
8-Jun-01 0:26
suss8-Jun-01 0:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.