|
Hi gurus,
I'm working on a ATL plug-in for MS Outlook, but I would like to make it work on Outlook Express as well. I understand that it's not possilble via COM technology (as OE does not expose any COM interfaces ), but something with hooks? Any documentation on the subject?
Any help / hint would be much appreciated.
Thanks in advance,
Doru K.
|
|
|
|
|
There are articles here on codeproject. The guy is Amit Dey.
|
|
|
|
|
Hi,
I only found his article about Outlook add-ins, but Outlook Express is a COMPLETELLY different thing. Maybe there is an article about Outlook Express as well, but I didn't find it...could you send me the link?
Thanks,
Doru
|
|
|
|
|
I recently used the interface that I found in this article
http://www.codeproject.com/useritems/email.asp?target=MAPI[^]
Some of the code is perhaps a bit rusty, and may not be fully implemented, but working with the example code made it easy for me to understand the mechanisms involved, and it was straightforward to sort out any problems and adapt the COM interface for my own needs. I was extremely grateful for the help provided by this article.
|
|
|
|
|
Thank you! I hope this is what I need, although I'm not sure...I would like to add buttons to Outlook Express' toolbars, etc (like I did for MS Outlook).
Thanks again,
Doru K.
|
|
|
|
|
What is the difference between objects and interfaces in COM...?
For instance I use CoCreateInstance to create a COM object: ie IWebBrowser2
Then I use QueryInterface to get other interfaces like...IHTMLDocument2 or IHTMLEditDesign .
Can I create a COM object from IHTMLEditDesign as well or can I only get to IHTMLEditDesign via QueryInterface once an IWebBrowser2 object has been created...?
Thanks
How do I print my voice mail?
|
|
|
|
|
I think you have got a little mixed up with the terminology. CoCreateInstance creates the COM object that supports the IWebBrowser2 interface and returns you an pointer to that interface. COM rules state that once you've obtained an interface from a COM object, you can use that interface pointer to QueryInterface for any other interface supported by that object.
|
|
|
|
|
Hockey wrote:
What is the difference between objects and interfaces in COM...?
Interfaces must always adhere to a binary layout, while objects don't. When developing COM classes in C++, the objects will be laid out just like ordinary C++ objects in memory. In VB - who knows? This is why interfaces are the lingo of COM - it serves as a protocol to communicate with objects.
Interfaces also allow for advanced proxying. If you can wire the vtable so that proxy functions are called instead of the virtual methods, then you can add things like network transparency, apartment marshalling, etc, without having to require too much of a burden of the caller!
So the crude answer to your question would be; an object is a binary blob of data, and an interface is a structured and well formed table of function pointers, which points to functions which know how to manipulate the binary blob of data in a meaningful way. In C++ this distinction is not very obvious.
--
Din mamma.
|
|
|
|
|
My name is Nagarjuna.I am working on an ActiveX control (Not create by me).After registering it the control is not coming under control column in the component dialog box of Visual Basic 6. I checked the afxOleregisterControl(BOOL ) function in UpdateRegistry() function of my Cotrol class.The nRegFlag is properly set.My questions are:
1) In Visual Basic Component Dialog Box. why is that some control are just visible in Insertable column but not in Control column, even when ActiveX component is registered as Control.
2) If we want it in the control column what should we do.
Kindly help me out.
Bugfixer
|
|
|
|
|
Hi,
1) The major difference between the insertable column and the control column is that the control column is for displaying the activex controls while insertable column displays activex controls which supports linking and embedding. For example word, excel, acrobat activex controls fall in these category. They also works based on activex standards, but they are the true successors of old vb5 ole controls. These OLE controls were used for linking and embedding data files created by other OLE compatible apps.
2) By default all vc++ activex controls will come under Controls column. but if we want that to be displayed in Insertable column too, then we have to select the checkbox "Available in Insert Object Dialog" in the Activex creation wizard during creation. Or if u missed it out while creation, you can do it manually by modifying the sixth parameter of AfxOleRegisterControlClass call to include afxRegInsertable too. Do not forget to compile the application after modifying this. Compilation will register the activex and will add a new registry key called Insertable under the progId and clsid of the control. Then the control will get displayed in both Controls and Insertable Objects tabs of the Components dialog in VB
rgds .... mil10
|
|
|
|
|
I'm looking for a good sample project that shows how to implement interaction with an ActiveX control on a web page. I'm looking to create an ActiveX control that displays a listcontrol with checkboxes based on information gathered from the client machine's registry and filesystem, and then performing operations based on the user's selection. Embedding the control seems easy enough, using the object tag, but what then. Can anyone point me to good examples of going beyond step 1?
Cheers,
Carl
|
|
|
|
|
|
I am working on an application that needs to be able to archive data to CDR with the minimum of operator intervention (ideally just put in the disc).
It will run on XP and I want to use the IMAPI interface. That doesn't seem to be too difficult except that there's an AddData function that needs an IStorage pointer.
I need a pointer ( ) to how to get an IStorage filled with chosen directories and files from hard disc. I thought there must be an easy way but I can't find any documentation anywhere.
Please can someone tell me at least where to look?
Thanks.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Phil J Pearson wrote:
Please can someone tell me at least where to look?
MSDN[^].
HRESULT hr;
IStorage *pIst = NULL;
hr = pIst->CreateStorage(L"SomeName", STGM_READWRITE|
STGM_SHARE_EXCLUSIVE|STGM_CREATE,
0, 0, &pIst);
if(SUCCEEDED(hr))
{
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Thanks, but I know how to create a storage. The question is how to fill it with a set of directories and files.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Sorry Phil, it appears that the StgCreatePropSetStg Sample[^] example might be helpful in using a IPropertyStorage to invoke the WriteMultiple function which uses a IStorage object to tie them together. HTH.
- Nick Parker My Blog | My Articles
|
|
|
|
|
I know this View is derived from typical MFC classes like CFormView, etc...but does it also then inherit from IWebBrowser2 somehow?
Is it even possible to derive a class like CHtmlView from Interfaces...?
The reason I ask is...I wish to derive a single class from multiple interfaces (namely IWebBrowser2, IDocHostUIHandler, IHTMLEditDesigner and so on).
Can I do this? Every article I have read addresses each interface seperately and usually derive the interface from a new class...
I would like to preferably derive CHtmlView from each of these interfaces as well...
By default I have noticed CHtmlView allows you to call Navigate() and so on which are functions of IWebBrowser2 so I imagine it's already derived from IWebBrowser2???
If you could fill me in a little I would appreciate any help...
Thanks
How do I print my voice mail?
|
|
|
|
|
I took a look at the class definition. The class creates an instance of the WebBrowser and then does a QueryInterface() through that instance to get the IWebBrowser2 interface which is wrapped in a CComPtr<IWebBrowser2> m_pBrowserApp; member. It's safe to keep that interface pointer around - it ain't going to change unless the WebBrowser itself is closed. You can get all the other interfaces from that one (either directly or indirectly).
I'd suggest not trying to do multiple inheritance. Use the m_pBrowser member to QueryInterface() to get the IHTMLDocument2 interface and go from there (edit - or just call GetHTMLDocument ). Don't forget that the document can change if you do a navigate so caching that interface pointer could cause problems.
Rob Manderson
Colin Davies wrote: I'm sure Americans could use more of it, and thus reduce the world supply faster. This of course would be good, because the faster we run out globally, the less chance of pollution there will be. (Talking about the price of petrol) The Soapbox, March 5 2004
|
|
|
|
|
My biggest concern is handling the events from the IHTMLEditDesigner interface...i'm not sure yet how I should handle that...an event sink I think?
Thanks
How do I print my voice mail?
|
|
|
|
|
The IHTMLEditDesigner doesn't fire events in that sense. It's just an interface with 4 methods (in addition to the standard IUnknown methods). Each of the 4 methods gets called directly by MSHTML - no event sink needed. Think of em as being CALLBACK s implemented in a COM object.
I've been doing some work just this week with IHTMLEditDesigner s - maybe I'll write an article about em
Rob Manderson
Colin Davies wrote: I'm sure Americans could use more of it, and thus reduce the world supply faster. This of course would be good, because the faster we run out globally, the less chance of pollution there will be. (Talking about the price of petrol) The Soapbox, March 5 2004
|
|
|
|
|
Rob Manderson wrote:
I've been doing some work just this week with IHTMLEditDesigners - maybe I'll write an article about em
I most certainly think you should
I have read up a little more and I think I understand more about how COM and interfaces work, but the problem I face now is (Takeing the CHtmlView as an example but using a CView) When I embed a IWebBrowser2, IHTMLDocument2 inside my CView class everything works fine...however when I attempt to embed a IHTMLEditDesigner I get a compile error:
error C2143: syntax error : missing ';' before '*'
error C2501: 'IHTMLEditDesigner' : missing storage-class or type specifiers
error C2501: 'm_pDesigner' : missing storage-class or type specifiers
Any idea why this would be happening?
I am using Visual C++ 6 and I have downloaded the IE55 Sdk and windows core sdk and included them inside my Tools->Options->Directories???
I can't figure out the steps required to allow me to even start playing with interfaces...other then IWebBrowser2???
Thanks again
Cheers
How do I print my voice mail?
|
|
|
|
|
It looks very much like you're not including the header that defines the IHTMLEditDesigner interface. It's in mshtmlc.h . But don't forget that you need to derive your own class from IHTMLEditDesigner . Mine looks like this:
class CMSHTMLDisableDragHTMLEditDesigner : public IHTMLEditDesigner
{
public:
virtual HRESULT STDMETHODCALLTYPE
QueryInterface(REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject);
virtual ULONG STDMETHODCALLTYPE
AddRef(void);
virtual ULONG STDMETHODCALLTYPE
Release(void);
virtual HRESULT STDMETHODCALLTYPE
PreHandleEvent(DISPID inEvtDispId, IHTMLEventObj *pIEventObj);
virtual HRESULT STDMETHODCALLTYPE
PostHandleEvent(DISPID inEvtDispId, IHTMLEventObj *pIEventObj);
virtual HRESULT STDMETHODCALLTYPE
TranslateAccelerator(DISPID inEvtDispId, IHTMLEventObj *pIEventObj);
virtual HRESULT STDMETHODCALLTYPE
PostEditorEventNotify(DISPID inEvtDispId, IHTMLEventObj *pIEventObj);
CMSHTMLDisableDragHTMLEditDesigner();
BOOL Attach(IHTMLDocument2 *pDoc);
void Detach();
private:
IHTMLEditServices *m_pServices;
UINT m_uRefCount;
CMSHTMLDisableDragIDispatch m_dp;
};
And with appropriate code in each of the members.
Rob Manderson
Colin Davies wrote: I'm sure Americans could use more of it, and thus reduce the world supply faster. This of course would be good, because the faster we run out globally, the less chance of pollution there will be. (Talking about the price of petrol) The Soapbox, March 5 2004
|
|
|
|
|
Hi Rob, It was being caused by improper inclusion. I jumped the gun while reading the article and didn't bother to read the fine print when adding the includes directories...
I'm really good at that
I have another quick question if don't mind...
I have that CView which has an embedded IWebBrowser2 (copying CHtmlView) and I would like to embed a IHTMLEditDesign as well.
Can I not use a BEGIN_EVENTSINK_MAP approach like CHtmlView does to just wrap IWebBrowser2 events but for IHTMLEditDesign as well...?
Thanks again
How do I print my voice mail?
|
|
|
|
|
Hockey wrote:
Can I not use a BEGIN_EVENTSINK_MAP approach like CHtmlView does to just wrap IWebBrowser2 events but for IHTMLEditDesign as well...?
Nope. I did it like this.
My view class has an embedded variable of type CMSHTMLDisableDragHTMLEditDesigner (see previous reply) called m_designer . In the OnDocumentComplete() handler for the view I do this.
.
.
.
CHtmlEditView::OnDocumentComplete(lpszURL);
m_pDoc = (IHTMLDocument2 *) GetHtmlDocument();
m_designer.Detach();
m_designer.Attach(m_pDoc);
.
.
.
The Attach() looks like this.
BOOL CMSHTMLDisableDragHTMLEditDesigner::Attach(IHTMLDocument2 *pDoc)
{
if (m_pServices != (IHTMLEditServices *) NULL)
m_pServices->Release();
IServiceProvider *pTemp;
if (pDoc == (IHTMLDocument2 *) NULL)
return FALSE;
pDoc->QueryInterface(IID_IServiceProvider, (void **) &pTemp);
if (pTemp != (IServiceProvider *) NULL)
{
if (pTemp->QueryService(SID_SHTMLEditServices, IID_IHTMLEditServices, (void **) &m_pServices) == S_OK)
{
if (m_pServices != (IHTMLEditServices *) NULL)
{
m_pServices->AddDesigner(this);
return TRUE;
}
}
}
return FALSE;
}
and the Detach() looks like this.
void CMSHTMLDisableDragHTMLEditDesigner::Detach()
{
if (m_pServices != (IHTMLEditServices *) NULL)
m_pServices->RemoveDesigner(this);
}
What this does is attach your edit designer to the document. MSHTML then calls the various member functions of the edit designer at the appropriate times. No eventsink involved.
I hope this helps
Rob Manderson
Colin Davies wrote: I'm sure Americans could use more of it, and thus reduce the world supply faster. This of course would be good, because the faster we run out globally, the less chance of pollution there will be. (Talking about the price of petrol) The Soapbox, March 5 2004
|
|
|
|
|
Rob Manderson wrote:
Nope. I did it like this.
I just spent the last several hour trying to figure out why this approach wouldn't work and still haven't figured out why...
Why is it that approach will work for IWebBrowser2 and not IHTMLEditDesign ...
How are either interfaces different? They both fire events when appropriate...
Can you shed some light on this subject for me?
Thanks again, you've been a big help
How do I print my voice mail?
|
|
|
|