|
Hi!
I have a question for you, older & more skilled (then me ) COM programmers. I have an ATL Addin for MSOutlook2k. For now, it only displays some buttons in outlook (thanks Amit Dey! great tutorial!), but I would like to send an e-mail when pressing one of them(with some content set by me). Any ideas, tutorials, examples, Office APIs(if there is such a thing) or something like that?
BTW, I'm using VC++, NOT VB(I kind of had enough of VB tutorials
Thanks!
Doru K.
|
|
|
|
|
The easiest way (IMO) to work out how to do something using the Office object models is to prototype it in VBA (sorry...), then translate to VC++. It's not too tricky - you need to translate GetObject & CreateObject calls and work out how to call methods and access properties
Hmmm - I found this page[^] on Google - that might help?
<edit> This[^] might help even more - it converts VB automation code (i.e. what all the Outlook samples are written in) to C...
</edit>
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Thanks a lot! I hope it will work out...the code convertor is such a great ideea! Thanks again,
Doru
|
|
|
|
|
I'm tearing my hair out looking for atltypes.h. I've downloaded the WTL library, searched online, I'm stumped. Could someone tell me where this file lives please.
|
|
|
|
|
|
I downloaded and installed WTL70.exe from Microsoft. I did a search on my HD afterwards, no atltypes.h.
|
|
|
|
|
No, not a WTL file, an ATL file, ie it comes with VC++.NET
It's in the vc7/atlmfc/include folder.
Steve S
|
|
|
|
|
|
i am using the machine generated Code for the MS Command button (ActiveX).
When developing under WinNT4.0 there was no problem in Setting the Picture Path in the Properties to a BMP File and é voila, the dialog showed up with a bitmap button.
Now i am developing under Win2k, and everytime the dialog with the buttons intialises, the code crashes. Without the Bitmaps it works perfectly. Checking the Source i would manually load the bitmaps to the buttons (hoping that this might work).. i would like to load bitmaps from an Resource ID.
My Problem right now is that it needs an IDispatch*. I guess that i need a CPicture Object (casting it to an IDispatch*), but i can't find any constructor which would take an id, or a CBitmap or sthing like that.
Can anybody help?
Thanks in advance,
Bernhard
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
See my article "PixView". You may be able to use some of the code I have in the pix.h header for the second part of your problem.
|
|
|
|
|
thanks.. this really helped.. never knew about the CPictureHolder Class.
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
Is the following safe?
{<br />
map<CComBSTR, CComBSTR> mp;<br />
<br />
{<br />
CComBSTR& bstrNew = mp[L"1"];<br />
bstrNew = "Hello";<br />
}<br />
<br />
wprintf(mp[L"1"]);<br />
}
Will bstrNew get destroyed, thus invalidating the "Hello" string?
Jeremy Pullicino
C++ Developer
Homepage
|
|
|
|
|
Yes, this is safe. A reference is an alias for an object that exists elsewhere - in the map, in this case. When a reference goes out of scope, the referenced object still exists and no destructor call is made. In this respect, references work like pointers.
Brad
|
|
|
|
|
Jeremy Pullicino wrote:
map<CComBSTR, CComBSTR> mp;
I'd be careful, mixing non standard-library components with standard components could be dangerous. If you can afford to convert and store std::string's / std::wstring's, or boost::shared_ptr's to BSTR's prefer that to using the microsoft wrappers.
From MSDN
CComBSTR::operator &
BSTR* operator &( );
Modern C++ Design (7.6) - Alexandrescu
"Overloading unary operator& makes the Smart Pointer unusable with STL containers."
He then goes on to suggest never overloading operator& for components that are going to be used generically.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
|
Cool, thanks mike didn't even know it existed.
When did this get added? for .NET
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
|
How to resize the client rect of the control when designing?
The sample from the msdv is so complex that I can not understand, Thank you for the hlep!
|
|
|
|
|
I've been writing a DHTML control and have noticed it flickers a lot when resized with 'Show window contents while moving/resizing' on.
This happens even with the unmodified wizard-generated DHTML control (using vs.net, add atl control, dhtml control). The control works by using CAxWindow as an activex container window and creating a control (IWebBrowser2) inside it. For an example, create the dhtml control with the wizard, compile, then drop the control onto a form in vb/c# and make it fill the form. Then compile that and resize it.
Although I've read up a bunch about flicker, I'm not quite sure how I'm supposed to extend or modify CAxWindow to remove this flickering. Any ideas?
|
|
|
|
|
I think this is an issue with the DHTML control (MSHTML). I see the same problem in an app I'm working on which uses CHtmlView.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
not too sure about the WebBrowser activex control, but if you're using CWindow or it's classes, the following can help...
Insert a message handler as follows
MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)
then implement the handler...
<br />
LRESULT OnEraseBackground(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)<br />
{<br />
return 1;<br />
}<br />
Ryan
|
|
|
|
|
Can't Register atl com in chinese(unicode) path!
How Can I do it?
ZHANGYIFEI
|
|
|
|
|
I remember I saw this problem back on the NAV team. Somewhere in the ATL registration code, some code walks the filename and there is a ++ instead of CharNext() , which breaks when it encounters DBCS characters. Sorry I can't be more specific than that.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Ericahist updated (again) Sep 6!
|
|
|
|
|
I have a program which works on an open process. I need a way to spot if the process the program is working on has terminated. So I setup a CWorkerThread and use AddHandle() with the handle of the open process. When the handle becomes signaled, I send a message to the main window of my app.
So what's the problem?
When the process terminates and the Execute() method fires, I have to remove the process handle from the thread or it will keep firing messages to the main window. But when I use RemoveHandle(), the thread blocks on the Refresh() method.
Why this is happening? Any suggestions on how to fix it?
Thanks.
|
|
|
|
|
Hi,
I did that using MFC, just create a Worker thread and the process and waitforsingle/multiple objects, I can try to find the source code , here you have one sample that I got from the net ( I remember I did something similar):
<br />
void main( VOID )<br />
{<br />
STARTUPINFO si;<br />
PROCESS_INFORMATION pi;<br />
<br />
ZeroMemory( &si, sizeof(si) );<br />
si.cb = sizeof(si);<br />
ZeroMemory( &pi, sizeof(pi) );<br />
<br />
if( !CreateProcess( NULL,
"MyChildProcess",
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi )
) <br />
{<br />
ErrorExit( "CreateProcess failed." );<br />
}<br />
<br />
WaitForSingleObject( pi.hProcess, INFINITE );<br />
<br />
CloseHandle( pi.hProcess );<br />
CloseHandle( pi.hThread );<br />
}<br />
HTH
Braulio
|
|
|
|