|
As to adding toolbar buttons thru an addin to PP, this is very similar to the article on Outlook, but ofcourse with a few minor changes. If you have followed most of what my article says, (and have a little ATL COM background)you shouldn't have many problems. Just the registry keys for pp addins are different, the object model is slightly different(with regards to addin buttons) and you have to obviously import different typelibs(msppt9.olb & other dependencies). But the basic process of adding toolbar buttons, menu items, command handlers and propertypages are very similar to Outlook.
As to launching an external app,(on button click?) if the app is COM based, you would use interface based programming or ShellExec() for non-COM apps.
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
You were right - it only took me an hour or so to actually implement the button in powerpoint Thanks for writing such a great article..it really helped a lot.
|
|
|
|
|
I have built a COM server with c# and tested it with VB 6.0. Everything has gone well with VB. But when I tried to use it with VC++ it didn't work. I imported the type library with and without the no_namespace directive. When I compiled the project it gave these errors:
c:\MyProjects\MFC\COMClient1\Debug\COMServer1.tli(57): error C2064: term
does not evaluate to a function
c:\MyProjects\MFC\COMClient1\Debug\COMServer1.tli(53): error C2501:
'_TypePtr' : missing storage-class or type specifiers
c:\MyProjects\MFC\COMClient1\Debug\COMServer1.tli(53): error C2433:
'_TypePtr' : 'inline' not permitted on data declarations
c:\MyProjects\MFC\COMClient1\Debug\COMServer1.tli(53): error C2143:
syntax error : missing ';' before '_QuoteServer::GetType'
c:\MyProjects\MFC\COMClient1\Debug\COMServer1.tlh(86): warning C4183:
'GetType': missing return type; assumed to be a member function
returning 'int'
c:\MyProjects\MFC\COMClient1\Debug\COMServer1.tlh(86): error C2501:
'_QuoteServer::_TypePtr' : missing storage-class or type specifiers
c:\MyProjects\MFC\COMClient1\Debug\COMServer1.tlh(86): error C2146:
syntax error : missing ';' before identifier 'GetType'
my COM server has only two methods:
string GetQuote ();
int GetInt ();
There is a problem with the type library. _TypePtr is not defined anywhere. The interesting thing is that this component works very well with Visual Basic. Does anybody know what this problem might be?
Thanks,
Tunca Bergmen
|
|
|
|
|
more ofenly, when vs complied the com source to a tlb in it will have a hint like this:
// #import "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.tlb" you shoud add this to StdAfx.h before #inport youOwn.tlb
the basice property like _Type, _ObjRef will added in you project for the proto type
i think, it will solve you problem.
but the bigger problem is : after everythin done, there be some runtime errors when you call a Ptr in you program
anyone can help?
|
|
|
|
|
I have written an ATL DCOM object running as a service logged on as a local user on that server.
Can I find out who is instantiating my server object from a client.
|
|
|
|
|
I'm a begineer in COM. Please anyone help me.
I have to pass a String value(CString) from an edit box into COM Object(LPCTSTR).
ThankYou
|
|
|
|
|
You need to do something like this where your CString is called cString, and your com function is pInt->Fuction():
BSTR bstr;
bstr = ::SysAllocString(cString);
pInt->Function(bstr);
::SysFreeString(bstr);
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Just an observation:
If the requirement is only to send the contents of the
CString to the server (as in this case), then the
solution is okay. If the server changes it and the client
needs it back, a BSTR * will be required.
The IDL should have [in] BSTR bstr in the first case.
For the second type it should have [in, out] BSTR *pbstr
With best regards,
Sayan
Email:sayanmukherjee@indiatimes.com
|
|
|
|
|
Thanks for you Help. I did as you explained. But it's showing an error.
error C2664: 'SysAllocString' : cannot convert parameter 1 from 'class CString' to 'const unsigned short *'
Please explain
|
|
|
|
|
There's a few things you need to take into account.
Your COM object's interface that you're trying to reach... did you implement it using IUnknown or IDispatch? IUnknown will let you more or less pass any kind of data you want including good 'ol CHAR and CHAR* type stuff. IDispatch, which is required if your component is or ever will be used in Visual Basic or any scripting language (JavaScript or VB Script), is much more limited. From my experience and I don't doubt some will disagree, IDispatch is "safer" in most cases regardless of whether your object is needed in VB or not (particularly if you have to support Windows 95/98). IDispatch, however, greatly narrows down your options to a degree on types. Sure, there's ways around this restriction, but basically with IDispatch you have some basic integer types... after that you really have to use BSTR's and VARIANT's. These are a real pain in the... keister, particularly in C++ but you'll have better results.
The solution using SysAllocString mentioned above would be the correct usage if you're using IDispatch and passing a BSTR. I'm gathering from the type you mentioned that you chose IUnknown.
In this case, it's really quite simple,
CString strData("Hello World");
// Load your smart pointer to your object
IMyInterfacePtr pInterface;
HRESULT hr = pInterface.CreateInstance(__uuidof(MyCoClass));
if (SUCCEEDED(hr))
{
hr = pInterface->YourFunctionCall(strData.GetBuffer(strData.GetLength()));
if (SUCCEEDED(hr))
{
}
else
{
}
strData.ReleaseBuffer();
}
|
|
|
|
|
The CString object exposes exactly that datatype as a cast, so do the following:
myobjectvariable.myobjectmethod((LPCTSTR) myCString, ...);
Should do the trick, hope it helps.
Simon
|
|
|
|
|
DLL-based Component CA is developed with ATL Object wizard. Its features including:
1. single-threaded
2. custom interface
3. no aggregation support
CA has only one interface named IA which has a method GetData:
STDMETHOD(Receive)(/*[out]*/ long* pDataLength,
/*[out, size_is(*pDataLength)]*/ unsigned char** ppData);
A confusing fact is that:
When I use CA in a normal MFC EXE, it works well.
Then I use CA in an ATL-based EXE. In that EXE I have another Componet say CB.
CB creates a thread say WorkingThread().
In WorkingThread(), I call CreateInsantance() to create CA:
IA* pIA = NULL;
RESULT hr = CoCreateInstance(CLSID_A, NULL, CLSCTX_INPROC_SERVER,
IID_IA,
(void**)&pIA);
It failed with a HRESULT indicating "The interface IA is not supported by CLSID_A".
I have included A.h and two const definition of CLSID_A and IID_A in the ATL EXE's source,
the same as I did in the normal MFC EXE.
If CA is a dual interface, no such troubles. So I assume this is related to custom interface.
But how to solve this problem?
|
|
|
|
|
You need to make sure that you call CoInitailize for each thread that will create COM objects.
Basically this function inidicates to OLE which type of threading model that thread will use when it creates COM objects.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I need to fire events from a DCOM server once in a time interval.
Do you have any idea about how should i implement this or at least do you know some tutorial that solves such a task?
rechi
|
|
|
|
|
Is your server a service?
In that case, you can use a separate worker thread in your
application to do the needful. The timing action can be
implemented using Events and the thread has to be
synchronised with that event. The event will signal the
thread when the required time has elapsed.
With best regards,
Sayan
Email:sayanmukherjee@indiatimes.com
|
|
|
|
|
Dear all:
I have programmed a toolband(.dll) by C++.But I don't know How to uninstall a component(.dll) by C++.
please give me some advice or examples
Thank you for your help
|
|
|
|
|
regsvr32 dllname.dll /u
from the command line
bryce
|
|
|
|
|
You are able to call DllRegisterServer and DllUnregisterServer toolband.DLL's functions or RegSvr32.exe [/u] toolband.DLL
With best wishes,
Vita
|
|
|
|
|
or simply swipe the IE toolband specific registry keys that you added?
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
Dear all:
I have installed a toolband(.dll) in IE in a web page by using Internet component download.But I don't know How to uninstall a component(.dll) in a web page.
please give me some advice or examples
Thank you for your help
|
|
|
|
|
Open up Explorer, go to \windows\Downloaded Program Files, find the one you want to remove, and hit the Delete key.
--Mike--
Actual sign at the laundromat I go to: "No tinting or dying"
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
You can use Windows Shell script to swipe out the relevant registry keys?
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
I want to add popup menu button into a Explorer bar for IE, just like the history explorer bar in IE6. There are a "view" popup menu and a search button on the IE history explorer bar. By the way, is it possible to add a control(such as a treeview) to the window area of Explorer toolbar?
If you know how to do it, please help me, examples will be appreciated!
Thanks!
|
|
|
|
|
checkout
toolband -http://www.codeproject.com/useritems/toolband.asp
dropdown menu/toolbar-http://www.codeproject.com/wtl/toolbar.asp
and Bjarne Viksoe's website www.viksoe.dk for full code samples of explorer bars,toolbands etc.
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
Hi folks. I've created an ATL control that subclasses the standard treeview. It's very nice and I can host it in a web page and everything. The problem is when I resize the web page (with full window drawing as it's resized) I get a really bad flicker of the tree view. Something is causing my control to erase. I've tried suppressing WM_ERASEBKGND, but no good. When ATL resizes the main window of my control with SetWindowPos, it gets erased. If I make a windowless control (just using the default drawing from the wizard) I get flicker free resizing.
Does anyone know how I can get rid of flicker for the windowed control?
Thanks
Matt
|
|
|
|