|
Hi,
I have a few ActiveX controls in a browser, and I want
them to access each other's method( without creating a new instance)
Can someone tell me how can it be done.
Thanks,
Sansky
John 3:16
For God so loved the world,
that he gave his only begotten Son ( Jesus Christ ) ,
that whosoever believeth in him should not perish, but have everlasting life.
|
|
|
|
|
Hi there,
I have an app here that already initializes COM via a call to CoInitializeEx(NULL, COINIT_MULTITHREADED). I have recently added drag and drop support, and am calling AfxOleInit() some time after the call to CoInitializeEx(). This works on my development machine no problem, but on another machine AfxOleInit()'s call to CoInitialize() fails with RPC_E_CHANGED_MODE. I don't understand why it works on my first machine, though I realize the failure on the second machine is due to the fact that it was initialized to MTA and now we are trying to use STA.
Any ideas? Surely you can use COM as well as drag and drop in a single application, right???
Thanks,
swine
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
Hi all,
How can I add a toolbar button and a Menu to outlook express (not outlook express 2000)? I am using VC++ 6.0. one more thing is I don't know what is the user's OS and the version of outlook.
I mean my program has to identify the os and outlook version automatically and add the component.
Can anyone help me please?
Thank you in advance.
|
|
|
|
|
|
I mean Outlook Express.
I had gone through the sdk in your site, but I couldn't follow. Can you please expland it further, or can you breifly explain me how can i add a toolbar button and a menu in outlook express.
Infact I tried to hook with windows as what S.Rod explained. I had gone through the PGP source but couldn't understad anything.
can you help me.
|
|
|
|
|
Using my SDK, it is not possible to do anything userinterface like(i.e. dealing with msimn.exe), only serverside stuff, as Outlook Express uses it. So the only thing possible is to rewrite the whole Outlook Express user interface, using all existing mail related stuff thru the SDK. A daunting task!
what you have to do basically is find the Window whose classname = "ThorBrowserWndClass" - Outlook Express 4 main window
"Ath_Note" - each new message you create or read OE is this class
"Outlook Express Browser Class" - main OE window for all ver.
Then you subclass the windows WindowProc. The XXXPluginInfo calls save and store information with regards to your your plugin information - toolbar/menu that is implemented in a dll(__declspec(dllexport)!!).
But yes, this code will only confuse you, unless the implementation is described too. I have tried using some very old code here on CP, that specifically drills down the OE window. Using Spy++ you could see that you need to use FindWindow() and FindWindowEx() API's to find-
Outlook Express Browser Class
|
SizeableRebar
|
RebarWindow32(this is the parent band?)
|
3 ToolbarWindow' s - i.e. OE's menu,toolband/rebarband/statusbar.
But although I can get OE's main band, any addition to the band(as in Nick Hodapp's rebarband code on CP) does not show a new toolbar button or menu next to the last item, as expected.
if you look at the msoe.dll(for OE6 - for 4.x it was called msimnui.dll??), you will see a function called LoadMappedBitmap(). but how to use it? I'm sure additions to toolbar/menu(as in msim) is very possible and works perfectly too. But how??
Hush,hush...
thought I heard you call my name now.
Kula Shaker.
Amit Dey
Latest articles at CP - PocketPC New menu
Office addin
|
|
|
|
|
There is no documented SDK for doing things like in Outlook Express. May be there is no SDK at all.
Outlook Express, like a standard Windows app, has its toolbar and menus hooked by addins. For instance, PGP uses this technique :
__declspec(dllexport) void AttachOutlookExpressPlugin(HWND hwnd)
{
PluginInfo *plugin;
char szWndClass[1024];
GetClassName(hwnd, szWndClass, 1023);
plugin = CreatePluginInfo(hwnd);
if (plugin == NULL)
return;
SetProp(hwnd, "oldproc",
(HANDLE) GetWindowLong(hwnd, GWL_WNDPROC));
if (!strcmp(szWndClass, "ThorBrowserWndClass"))
SetWindowLong(hwnd, GWL_WNDPROC, (DWORD) MainWndProc);
else if (!strcmp(szWndClass, "Outlook Express Browser Class"))
{
plugin->bOE5 = TRUE;
SetWindowLong(hwnd, GWL_WNDPROC, (DWORD) MainWndProc);
}
else if (!strcmp(szWndClass, "ATH_Note"))
SetWindowLong(hwnd, GWL_WNDPROC, (DWORD) UnknownWndProc);
SavePluginInfo(hwnd, plugin);
return;
}
There are articles on Cp about hooking windows based on classnames, etc.
|
|
|
|
|
would you believe outlook express uses COM? But not for any extensilibity like visual additons to menu/toolbar - atleast in whatever undocumented stuff I know.
Hush,hush...
thought I heard you call my name now.
Kula Shaker.
Amit Dey
Latest articles at CP - PocketPC New menu
Office addin
|
|
|
|
|
Amit Dey wrote:
would you believe outlook express uses COM? But not for any extensilibity like visual additons to menu/toolbar
Let me rephrase then.
Outlook express exposes an underlying API known as MAPI to allow someone to send/retrieve emails and stuff. In fact Outlook express is a MAPI client, like Eudora, Outlook, ...
There is no other API. Adding toolbars or menu options is only the result of a general windows hooking technique.
|
|
|
|
|
Hi Stephane,
I thought Outlook Express uses Simple MAPI(SMAPI).But you are so wrong, because this is not documented. SO I don't really blame you. COM acces apart from SMAPI/MAPI is also possible, cause OE is programmed as a bunch of COM servers. I have been working on this for sometime.
If the topic interests you,let me know(and your email)
Hush,hush...
thought I heard you call my name now.
Kula Shaker.
Amit Dey
Latest articles at CP - PocketPC New menu
Office addin
|
|
|
|
|
Amit Dey wrote:
SO I don't really blame you
Thanks, that's nice.
Amit Dey wrote:
COM acces apart from SMAPI/MAPI is also possible, cause OE is programmed as a bunch of COM servers.
Yes, even though that's off-topic. Has this anything to do with the original poster request ?
|
|
|
|
|
Outlook Express consists of msimn.exe(the client),msoert2.dll(run time string anf other util stuff),msoeacct.dll(accounts),msoe.dll(the main OE com server), msoeres.dll,msacctres.dll(account dialog resources) etc.
Most of Outlook Express's folders and mail access is thru CLSID_StoreNamespace.
{E70C92A9-4BFD-11d1-8A95-00C04FB951F3}
IID_IStoreFolder - {E70C92AC-4BFD-11d1-8A95-00C04FB951F3}
IID_IStoreNamespace - {E70C92AA-4BFD-11d1-8A95-00C04FB951F3}
Outlook Express client(msimn.exe)uses these system interfaces(Outlook Express is a system component in a certain sense) and folder/mail and notifications are available just as for MS Outlook.
Not surprisingly,MS Outlook also uses some of these interfaces! (esp account,transport etc).
other common system interfaces include message transport, MIME message creation/encoding/decoding, account related interfaces . inetcomm.dll among other things,contains the encapsulation for mail transport(HTTP/SMTP/IMAP) for MIME messages and other TNEF specific stuff)mlang is for multi lingual features as documented.
The interfaces I'm talking about are very old(97) and a lot of other changes and newer implementations are inlcuded in later versions(5.5x+)like msn integration. probably these newer interfaces are never going to be documented as well.
This is how I can launch the client thru undocumented means.
#define MSOEAPI_START_SHOWSPLASH 0x00000001
#define MSOEAPI_START_MESSAGEPUMP 0x00000002
#define MSOEAPI_START_ALLOWCOMPACTION 0x00000004
#define MSOEAPI_START_INSTANCEMUTEX 0x00000008
#define MSOEAPI_START_SHOWERRORS 0x00000010
#define MSOEAPI_START_APPWINDOW 0x00000020
typedef HRESULT (APIENTRY *PFNSTART)(DWORD dwFlags, LPCSTR pszCmdLine, INT nCmdShow);
HINSTANCE hMod = LoadLibrary("C:\\Program Files\\Outlook Express\\msoe.dll");
if(hMod)
{
PFNSTART pfn = (PFNSTART)GetProcAddress(hMod,"CoStartOutlookExpress");
//combination of other flags -
//MSOEAPI_START_MESSAGEPUMP|MSOEAPI_START_SHOWERRORS|MSOEAPI_START_APPWINDOW|MSOEAPI_START_SHOWSPLASH
DWORD dwFlags = MSOEAPI_START_INSTANCEMUTEX;
//set nShow to SW_XXX
int nShow = SW_SHOW;
LPTSTR szCmdLine = {"/2"};
HRESULT hr = pfn (dwFlags,szCmdLine,nShow);
if(FAILED(hr))
return FALSE;
}
Is it off topic? Actually, I'd like you to check out my little SDK here.. I know you are a COM programmer and am looking for beta testers/programmers for more ideas etc. Thanks in advance.
Hush,hush...
thought I heard you call my name now.
Kula Shaker.
Amit Dey
Latest articles at CP - PocketPC New menu
Office addin
|
|
|
|
|
Amit Dey wrote:
Is it off topic?
I am afraid that it is. The poster wants to customize Outlook express toolbars and menus.
I have just given a glance at the OE SDK you refer to and that's a good job. However, the COM layer you add to it makes it nice for anyone who would like to drive Outlook express from an external app. But this does not bring much for the purpose of building an Outlook express addin.
|
|
|
|
|
you are quite correct in the sense of a visual addin for outlook express. no, the ms docs do not seem to suggest this - although there are certain IOEExtension and IOEExtensionMenu interfaces, but I do not think such an extensibility is possible. So I'd like my SDK also to have some means of visually addin menu entries/toolbars. I need some help with this.
Hush,hush...
thought I heard you call my name now.
Kula Shaker.
Amit Dey
Latest articles at CP - PocketPC New menu
Office addin
|
|
|
|
|
Amit Dey wrote:
but I do not think such an extensibility is possible. So I'd like my SDK also to have some means of visually addin menu entries/toolbars. I need some help with this.
The code I have posted above is an excerpt from PGP, which actually plugs itself in Outlook Express, along with a toolbar button and a menu option. This exemplifies how window hooking techniques can gain access to an arbitrary app.
|
|
|
|
|
I have just posted another update here(ugh! html!?!) and you can take a look at the interface declarations and how to access everything thru raw OE object model.
Interesting,huh!
Hush,hush...
thought I heard you call my name now.
Kula Shaker.
Amit Dey
Latest articles at CP - PocketPC New menu
Office addin
|
|
|
|
|
Thank you very much.
I will go through your OESDK and try to solve my problem.
Thank you once again.
|
|
|
|
|
This is more than nice.
Unless you intend to make business out of it, what about a Cp article ? After all, what people want is a way to drive the client email regardless of what the machine is configured to use. Since a lot of users end up with either Outlook or Outlook Express, what would be blasting is a common object model. Something even MS couldn't make (or actually didn't want to, only to promote a commercial product rather than a free product).
[Edit]Be sure to get referenced so that a google search reaches you when anyone is searching for Outlook Express programming related stuff.[/Edit]
|
|
|
|
|
I intend to write an article on CP with such headers and with some of my sample code snippets. It's as yet in the works, and I'm on it.
But you must tell me, which month YOU are not publishing anything heavyweight - atleast that way my article stands a chance in the CP contest.
Hush,hush...
thought I heard you call my name now.
Kula Shaker.
Amit Dey
Latest articles at CP - PocketPC New menu
Office addin
|
|
|
|
|
Amit Dey wrote:
I intend to write an article on CP with such headers and with some of my sample code snippets. It's as yet in the works, and I'm on it.
Do it if you feel like doing it. That's will be certainly welcome especially if you add custom outlook express toolbar techniques, but you don't need to feel entitled to produce anything only as a consequence of our discussion.
Amit Dey wrote:
which month YOU are not publishing anything heavyweight
Sadly, I have never won any competition, so I don't think I would prevent you from winning anything anyway.
|
|
|
|
|
What I understand is first find the Window whose classname = "ThorBrowserWndClass" - Outlook Express 4 main window
"Ath_Note" - each new message you create or read OE is this class
"Outlook Express Browser Class" - main OE window for all ver.
Then you subclass the windows WindowProc. The XXXPluginInfo calls save and store information with regards to your your plugin information - toolbar/menu that is implemented in a dll(__declspec(dllexport)!!).
But please tell us more as how to specifically add toolband items?
I have tried using some very old code here on CP, that specifically drills down the OE window. Using Spy++ you could see that you need to use FindWindow() and FindWindowEx() API's to find-
Outlook Express Browser Class
|
SizeableRebar
|
RebarWindow32(this is the parent band?)
|
3 ToolbarWindow' s - i.e. OE's menu,toolband/rebarband/statusbar.
But although I can get OE's main band, any addition to the band(as in Nick Hodapp's rebarband code on CP) does not show a new toolbar button or menu next to the last item, as expected.
Please show us the way!
Hush,hush...
thought I heard you call my name now.
Kula Shaker.
Amit Dey
Latest articles at CP - PocketPC New menu
Office addin
|
|
|
|
|
What does you addin do? if you need any of Outlook Express's functionality, then the SDK might be of help.
|
|
|
|
|
I am trying to programatically get the ProcessID for a running COM+ application. I am using Windows 2000 (COM+ 1.0) so there is no ApplicationInstances object in the COM Admin library to use, but Component Services in Windows 2000 somehow gets the Process ID anyway. I have been looking all over in the MSDN Library, the web, and microsoft's site trying to find out how to retrieve this. I can get the application's name (just like you can see it in Component Services) and through the same administration object i can get the GUID. What I need is a way to get the actual Process ID of the DLLHOST.EXE that is associated with a specific running instance. I am hoping there is some fairly easy way to do this using mostly API Calls, but I haven't been able to come up with anything. Any help would be greatly appreciated. Thanks.
|
|
|
|
|
UPDATE: I just found a command line utility that will give the command line of any running process, given its ProcessID. Using the command line, you can see the switch given to DLLHOST.EXE which looks like this:
/ProcessID:{CLSID_HERE}
which can be matched up to the Key property of the Application. The problem now, is that there is no source code with this utlity I found. Does anyone know how it might work? It seems like it is making calles to OpenProcess, CreateRemoteThread, etc.
|
|
|
|
|
MSDN sample "Taking a Snapshot and Viewing Processes"
|
|
|
|
|