Porting to Series 60 3rd Edition: Part 2, edit your source code

| No Comments | No TrackBacks

In your source code the macro __SERIES60_30__ is defined, you can use this to create a portable code. Ok, lets start changing the code (this is the essential part of the source code change, you should ).

The most important change is in the function E32Dll, you must change it to E32Main:

#ifdef __SERIES60_30__
GLDEF_C TInt E32Main()
{
    return EikStart::RunApplication( NewApplication );
}
# else
GLDEF_C TInt E32Dll( TDllReason )
{
     return KErrNone;
}
#endif

but you must include this header:

#ifdef __SERIES60_30__
#include <eikstart .h>
#endif

Since we use different UIDs, use different constants:


#ifdef __SERIES60_30__
const TUid KUidS60BibleApp = {0xF0201077};
const TUid KUidS60BibleUi = {0xF0201079};
#else
const TUid KUidS60BibleApp = {0x10201077};
const TUid KUidS60BibleUi = {0x10201079};
#endif

If you use application path for storing data, like c:\\system\\apps\\s60bible\\data.txt, you must change it to \\private\\\\data.txt. This code will set iDataPath (defined as TFileName) on 1st, 2nd, and 3rd:


HBufC *appDll = HBufC::NewLC(KMaxFileName);*appDll = iDocument->Application()->AppFullName();
TParse parsa;
User::LeaveIfError(parsa.SetNoWild(*appDll, NULL, NULL));

#ifdef __SERIES60_30__
CEikonEnv::Static()->FsSession().PrivatePath(iDataPath);
#else
iDataPath = parsa.DriveAndPath();
// If the application is in ROM (drive Z:), put settings on C:
if ( (iDataPath[0] == 'Z') || (iDataPath[0] == 'z') ) {
     iDataPath[0] = 'C';
}
#endif
Enable skin support:
On the
ConstructL of your class:

#ifdef __SERIES60_30__
BaseConstructL(EAknEnableSkin);
#else
BaseConstructL();
#endif

No TrackBacks

TrackBack URL: http://symbian.compactbyte.com/mt/mt-tb.cgi/14

Leave a comment

About this Entry

This page contains a single entry by Yohanes Nugroho published on November 23, 2006 11:33 AM.

Porting to Series 60 3rd Edition: Part 1, edit build files was the previous entry in this blog.

Porting to Series 60 3rd Edition: Part 3, build and install is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.