uifw/AknGlobalUI/AknCapServer/src/AknCapServerEntry.cpp
changeset 67 5f6e7f84c9d1
parent 65 b959e31f70b5
child 69 8cba18227181
--- a/uifw/AknGlobalUI/AknCapServer/src/AknCapServerEntry.cpp	Wed Sep 29 10:43:28 2010 +0800
+++ b/uifw/AknGlobalUI/AknCapServer/src/AknCapServerEntry.cpp	Fri Oct 01 17:27:56 2010 +0800
@@ -19,6 +19,7 @@
 #include <uikon/eikdefconst.h>
 #include <uikon/eikenvinterface.h>
 #endif
+#include <e32uid.h>
 #include <eikstart.h>
 #include <AknDef.h>
 #include <barsread.h>
@@ -73,10 +74,6 @@
     #include <akntranseffect.h> // for Transition effect enumerations
 #endif
 
-#ifdef SYMBIAN_BUILD_GCE
-    #include <goommonitor.h>
-#endif 
-
 
 #ifdef RD_INTELLIGENT_TEXT_INPUT
 #include <AvkonInternalCRKeys.h>
@@ -231,11 +228,33 @@
     me->iEikSrv.Close(); // currently there is no use to keep this session alive.
 
 #ifdef SYMBIAN_BUILD_GCE
-   TRAP( err, CreateGOOMWatcherThreadL());
-   if (err != KErrNone)
-       {
-       RDebug::Print(_L("Creating out of graphics mem thread failed with err %d"), err);
-       }
+    const TInt KOOMWatcherDllUid = 0x10282DBF;
+    _LIT(KOOMWatcherDll, "goommonitor.dll");
+
+    RLibrary lib; // we don't need to push to stack because there is no leaving in following operations.
+    TUidType uidType(KDynamicLibraryUid, KSharedLibraryUid, TUid::Uid(KOOMWatcherDllUid));
+
+    err = lib.Load(KOOMWatcherDll, uidType);
+    if (KErrNone == err)
+        {
+        TLibraryFunction func = lib.Lookup(2); /* CreateGOOMWatcherThreadL */
+        if (func)
+            {
+            TRAP(err, (*func)());
+            if (err != KErrNone)
+                {
+                RDebug::Print(_L("Creating out of graphics mem thread in capserver failed with err %d"), err);
+                }
+            }
+        else
+            {
+            RDebug::Print(_L("Lookup function entry in goommonitor.dll return NULL, the entry number may be wrong!"));
+            }
+        }
+    else
+        {
+        RDebug::Print(_L("Dynamically Loading goommonitor.dll failed with err %d, it's ok!"), err);
+        }
 #endif 
 
     return err;