Please find the article: Building an Office2K COM addin with VC++/ATL By Amit Dey There is very good example. ================================ Useful links
Brigsoft
Posts
-
Outlook addin -
Outlook security bypass question.I write spam filter and want validate senders from address book. But some versions of outlook show a warning message. Is it possible to bypass it? Thanks. ================================ My products are here!
-
TextOut a BSTR:wtf:I have found the best way!!! CComBSTR some(CString("some")); CString some1= some; CComBSTR and CString are exellent together!!! ================================ My Home is here!
-
Interesting COM ATL Event question.There are some ATL templates and macros that help catch COM events. As IDispEventSimpleImpl, SINK_ENTRY_INFO etc. But what I must to do if I do not know all events before a program start. For example, there are Outlook::ItemsEvent for Outlook folders. I can catch any one. But I want catch all to one function. How can I register events dynamically? Your ideas? ================================ My home is here!
-
Big difference between VB new operator and COM CoCreateInstance?I want to convert HTML to TEXT from some string It good works in VB code like this: Dim body As String Dim hd As HTMLDocument Dim str As String Set hd = New HTMLDocument Open "c:\test\a.html" For Input As #1 body = Input(4188, #1) hd.body.innerHTML = body Debug.Print hd.body.outerText I try do it with VC++ so: IHTMLDocument2 *pHtmlDoc = NULL; HRESULT hr; hr = CoCreateInstance(CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER, IID_IHTMLDocument2, (LPVOID *) &pHtmlDoc); IHTMLElement *pBody; hr = pHtmlDoc->createElement(CComBSTR("BODY"), &pBody); CComBSTR bsText; hr = pBody->get_outerHTML(&bsText); // OK, we have "" CComBSTR SomeText("Some Text); hr = pBody->put_outerHTML((BSTR)SomeText); // ;-( falls It falls down while "put_outerHTML" Who know right solution? PS Set hd = New HTMLDocument creates an object with html code with base document structure (5 tags: html, body, head, title, p). CoCreateInstance creates absolutely empty object. Why? ================================ My products are here
-
Namespace and Temmplate functionTry this #include int main(int argc, char* argv[]) { _int64 a = 10; std::cout << a << std::endl; return 0; } in my system it is not working too. Probably, the broble is in _int64, not in yor function. ================================ Useful links
-
playing and audio "wav" fileUse: #include sndPlaySound(...) without any fileopen, etc. Best regards, Alex. ================================ Useful links
-
Dumb CFile question..Question: What is SetRTF()? ================================ Useful links
-
OnCommand and Pretranslate message>IF I step in, on hitting enter in my textbox Are you sure that OnCommand had to be generated on this event? For examlpe, OnComand will be generate if you click some button, but not if the button set focus or lost using Tab key. Pretranslate massege gets ALL messages. And if you do all right WM_COMMAND will be prosecute or not, how you want. ================================ Useful links
-
static and non-static function1)Yes, if I pass to the function object of its class. 2) By a same way. ================================ Useful links
-
Simple Dialog Box in SDI--- HELP!!!!Call for View 1) Invalidate() 2) UpdateWindow() =========================== My home is www.brigsoft.com
-
Creating windows in worker threadsTry AfxMessageBox("Some message")? If it works, it is good. =========================== My home is www.brigsoft.com