Re: IMailRuleClient wont work!!!
From: Michael J. Salamone [eMVP] (mikesa#at#entrek#dot#com)
Date: 04/07/04
- Next message: Mur: "Re: Can I build a front end application for Pocket Access(CDB) databases using VB.NE"
- Previous message: Sam: "Re: Pocket Explorer API question for Pocket PC."
- In reply to: Anders Carlberg: "IMailRuleClient wont work!!!"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 6 Apr 2004 22:29:05 -0700
Does your DLL properly export DllRegisterServer and DllGetClassObject?
IMailRulesClient absolutely works. I've used the same code on both SP2003
and PPC2003. Works like a champ on both. Follow the sample included in the
SDK for guidelines on implementing and registering.
You can debug, too. Attach to tmail.exe before sending any messages. Your
DLL won't be loaded until a message comes in. You can have breakpoints set
in DllGetClassObject and whereever else you need.
If tmail.exe doesn't load your DLL, it's one of these reasons: 1) Your DLL
is not registered, 2) Your DLL is registered, but it not present in the
registered location (or one of its dependencies is not available), 3) Your
DLL and any dependencies are there, but returns FALSE from its DllMain, 4)
your DLL doesn't export DllGetClassObject, 4) DllGetClassObject is exported,
but fails when it's called.
So those are things you can easily verify.
Note on Smartphone, you also have to be signed with a privileged
certificate.
--
Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com
"Anders Carlberg" <anonymous@discussions.microsoft.com> wrote in message
news:F1376F47-4A0F-408F-A6C2-FD47995081D2@microsoft.com...
> Hi,
> I have not tested IMailRuleClient on both SmartPhone 2003 and PocketPC
2003 PhoneEdition, and i dont
> get it to work..
>
> I have created a COM and registered in the device.
> Im using eVC++ 4.0, and when the console says:
> SMSTest.dll - 0 error(s), 0 warning(s)
> Downloading files
> Checking remote file: \Windows\SMSTest.dll.
> Downloading file c:\projects\smstest\armv4dbg\smstest.dll.
> Successfully registered \Windows\SMSTest.dll to the device
> Finished downloading.
>
> I have a messagebox in the DllRegisterServer interface in the COM, and i
do get the popdialog.. (so it's registered then?!)
> But I cant find anything that about this in the register,
>
> So i have tested manually register the COM.
> (i have also downloaded a tool (like regsrv32) running on the device, and
try use that to register the COM, but still nothing in registry.
>
> well well, maby it supose to be that way. I continue..
>
> added this..
> [HKEY_LOCAL_MACHINE\Software\Microsoft\Inbox\Svc\SMS\Rules]
> {0ADF692D-E88D-4C07-9774-07C28232B543} = dword: 1
>
> Restarted the device.
> And test sending a SMS.. Nothing happends.. No MessageBox. ... Why?!
Please help me!!
>
> Im a totally newbie on eVC.. so...
>
> Cheers.
> /Anders
>
> my code :
>
> --------------------------------------SMSRule.cpp-------------------------
---------------------
> #include "stdafx.h"
> #include "SMSTest.h"
> #include "SMSRule.h"
>
> #include <windows.h>
> #include <stdlib.h>
> #include <cemapi.h>
>
>
////////////////////////////////////////////////////////////////////////////
/
> // CSMSRule
>
> HRESULT Initialize(IMsgStore *pMsgStore, MRCACCESS *pmaDesired)
> {
>
> //MessageBox(NULL, _T("Initialize"), _T("Initialize"), MB_OK);
>
> return S_OK;
> }
>
> HRESULT ProcessMessage(IMsgStore *pMsgStore,
> ULONG cbMsg,
> LPENTRYID lpMsg,
> ULONG cbDestFolder,
> LPENTRYID lpDestFolder,
> ULONG *pulEventType,
> MRCHANDLED *pHandled)
> {
>
> MessageBox(NULL, _T("ProcessMessage"), _T("ProcessMessage"), MB_OK);
>
> return S_OK;
> }
> --------------------------------------------------------------------------
-----------------
> ----------------------------------SMSTest.cpp-----------------------------
-------------
> #include "stdafx.h"
> #include "resource.h"
> #include "initguid.h"
> #include "SMSTest.h"
>
> #include "SMSTest_i.c"
> #include "SMSRule.h"
>
>
> CComModule _Module;
>
> BEGIN_OBJECT_MAP(ObjectMap)
> OBJECT_ENTRY(CLSID_SMSRule, CSMSRule)
> END_OBJECT_MAP()
>
>
////////////////////////////////////////////////////////////////////////////
/
> // DLL Entry Point
>
> extern "C"
> BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID
/*lpReserved*/)
> {
> if (dwReason == DLL_PROCESS_ATTACH)
> {
> _Module.Init(ObjectMap, (HINSTANCE)hInstance);
> #ifndef UNDER_CE
> DisableThreadLibraryCalls((HINSTANCE)hInstance);
> #endif
> }
> else if (dwReason == DLL_PROCESS_DETACH)
> _Module.Term();
> return TRUE; // ok
> }
>
>
////////////////////////////////////////////////////////////////////////////
/
> // Used to determine whether the DLL can be unloaded by OLE
>
> STDAPI DllCanUnloadNow(void)
> {
> return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
> }
>
>
////////////////////////////////////////////////////////////////////////////
/
> // Returns a class factory to create an object of the requested type
>
> STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
> {
> return _Module.GetClassObject(rclsid, riid, ppv);
> }
>
>
////////////////////////////////////////////////////////////////////////////
/
> // DllRegisterServer - Adds entries to the system registry
>
> STDAPI DllRegisterServer(void)
> {
> MessageBox(NULL, _T("DllRegisterServer"), _T("DllRegisterServer"), MB_OK);
> // registers object, typelib and all interfaces in typelib
> return S_OK;
> }
>
>
////////////////////////////////////////////////////////////////////////////
/
> // DllUnregisterServer - Removes entries from the system registry
>
> STDAPI DllUnregisterServer(void)
> {
>
> MessageBox(NULL, _T("DllUnregisterServer"), _T("DllUnregisterServer"),
MB_OK);
>
> _Module.UnregisterServer();
> return S_OK;
> }
> --------------------------------------------------------------------------
----------------------
>
- Next message: Mur: "Re: Can I build a front end application for Pocket Access(CDB) databases using VB.NE"
- Previous message: Sam: "Re: Pocket Explorer API question for Pocket PC."
- In reply to: Anders Carlberg: "IMailRuleClient wont work!!!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|