Click here to Skip to main content
15,915,702 members
Home / Discussions / COM
   

COM

 
GeneralRe: autoactivate deskband Pin
Shaun Harrington11-Oct-06 4:02
Shaun Harrington11-Oct-06 4:02 
GeneralDCOM VB Active X Control in MFC fails but works when hosted in VB Pin
quannum13-Jan-03 23:23
quannum13-Jan-03 23:23 
GeneralLicense Control!!! Pin
akelasher13-Jan-03 11:49
akelasher13-Jan-03 11:49 
GeneralBest method for implementing IEnumXXXX Pin
Heath Stewart12-Jan-03 19:19
protectorHeath Stewart12-Jan-03 19:19 
GeneralDynamic COM Server Use Pin
Anonymous10-Jan-03 12:29
Anonymous10-Jan-03 12:29 
GeneralRe: Dynamic COM Server Use Pin
geo_m10-Jan-03 21:29
geo_m10-Jan-03 21:29 
GeneralRe: Dynamic COM Server Use Pin
Anonymous12-Jan-03 1:42
Anonymous12-Jan-03 1:42 
GeneralRe: Dynamic COM Server Use Pin
geo_m12-Jan-03 3:07
geo_m12-Jan-03 3:07 
Hi,

Normally I am using the other way around, as I consider the browser app to be the controlling part, the IMyEffect interface is defined in here (either directly in the exe's IDL if any or in some of the DLLs supplied directly with it - say default plugin). This normally produces the tlb file somewhere. You have to store this tlb - this is your header.

Then when you need to develop some plugin, you refers to the tlb file, receiving all required declarations:

in IDL file of the newly developed plugin:

<br />
library SOMEPLUGINLib<br />
{<br />
  importlib("stdole32.tlb");<br />
  importlib("stdole2.tlb");<br />
<br />
  importlib("\Projects\Tlb\plugin.tlb");<br />
<br />
  [uuid()<br />
  ]<br />
  coclass SuperNewPlugin<br />
  {<br />
    [default] interface IMyPlugin; // it is defined from importlib<br />
  }<br />
<br />


Be aware, that the IDL compiler uses different paths for searching the tlb files (at least it seemed that for me some versions later, since then I use absolute paths here)

When you need to generate the C++ part, there is very usefull directive #import "plugin.tlb" see documentation for more options with this directive (I consider some of them usefull). Then this generates the header for you and includes it into the compilation chain (In fact, it behaves as normal include)

Optionally you can refer directly the dll file instead of tlb, result is the same

This import creates some .tlh and optionally .tli files in your Debug (Release) folder, so you can inspect what actually is here. It should contain the interface definition and all IIDs and CLSIDs defined in the plugin.tlb

So then the usage is something like that:
<br />
#import "\Projects\Tlb\plugin.tlb" raw_interfaces_only, raw_native_types, no_namespace, named_guids <br />
<br />
class ATL_NO_VTABLE CSuperNewPlugin : <br />
 ...<br />
 public IDispatchImpl<IMyPlugin, &IID_IMyPlugin, &LIBID_WHERE_THE_PLUGIN_IS_DEFINEDLib>,  // we are referring to different library<br />
...<br />

The rest remains the same...

Hope it is somehow clear, if not don't hesitate to ask more Wink | ;)
GeneralRe: Dynamic COM Server Use Pin
thowra13-Jan-03 13:23
thowra13-Jan-03 13:23 
GeneralRe: Dynamic COM Server Use Pin
geo_m13-Jan-03 21:33
geo_m13-Jan-03 21:33 
GeneralRe: Dynamic COM Server Use Pin
thowra14-Jan-03 8:24
thowra14-Jan-03 8:24 
GeneralCOM Interface Name Clashes Pin
Anonymous10-Jan-03 7:08
Anonymous10-Jan-03 7:08 
GeneralRe: COM Interface Name Clashes Pin
geo_m10-Jan-03 21:51
geo_m10-Jan-03 21:51 
GeneralRe: COM Interface Name Clashes Pin
Anonymous12-Jan-03 1:12
Anonymous12-Jan-03 1:12 
GeneralRe: COM Interface Name Clashes Pin
geo_m12-Jan-03 3:19
geo_m12-Jan-03 3:19 
GeneralDear ERIK!!!!!!!!!!Please..... Pin
vcarivu10-Jan-03 0:53
vcarivu10-Jan-03 0:53 
GeneralPluging ActiveXContol in I.E toolbar-Pls help me Urgent Pin
vcarivu9-Jan-03 20:30
vcarivu9-Jan-03 20:30 
QuestionIs OLE object = to COM?? Pin
E_LISE_LI9-Jan-03 14:14
E_LISE_LI9-Jan-03 14:14 
AnswerRe: Is OLE object = to COM?? Pin
geo_m10-Jan-03 4:44
geo_m10-Jan-03 4:44 
GeneralSTL map of _variant_t Pin
[James Pullicino]5-Jan-03 21:58
[James Pullicino]5-Jan-03 21:58 
GeneralRe: STL map of _variant_t Pin
geo_m7-Jan-03 6:58
geo_m7-Jan-03 6:58 
GeneralAutomation Problem with ROT (Running Object Table) Pin
Alois Kraus3-Jan-03 5:57
Alois Kraus3-Jan-03 5:57 
GeneralMS exchange server - deleting attachments Pin
Ammad Amjad31-Dec-02 20:58
Ammad Amjad31-Dec-02 20:58 
GeneralRe: help me!!!!!!!!!!!!!!!!!!!!! Pin
Renjith Ramachandran31-Dec-02 20:46
Renjith Ramachandran31-Dec-02 20:46 
GeneralRe: help me!!!!!!!!!!!!!!!!!!!!! Pin
Anders Molin3-Jan-03 14:05
professionalAnders Molin3-Jan-03 14:05 

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.