×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jul 2003
    Location
    Finland, Tampere
    Posts
    1,113

    Conditional compilation: managing set of modules

    I need to develop an application with lots of version variations.
    In fact it is not even an application, but rather a framwork to create other apps by selecting modules to use.

    Hence, I need to be able to include/exclude modules to/from compilation. This is no big deal, I can use compiler #defines. However, I cannot find a way to somehow register included set of modules. I.e. I want a list of included modules to be accessible via some library class.

    On desktop I would write in modules source files static section something like:
    Code:
    CLibrary::GetInstance()->RegisterModule(CSpecificModule::GetInstance());
    However, I can't use static code in Symbian.

    Could you advice any other way of registering included modules?

    P.S.
    ECom is not available

  2. #2
    Registered User
    Join Date
    Mar 2003
    Location
    Bucharest, Romania
    Posts
    41
    You can't use static varaibles in Symbian (well, sometimes you can). Static methodes are quite ok, if that helps you!

  3. #3
    Registered User
    Join Date
    Jul 2003
    Location
    Finland, Tampere
    Posts
    1,113
    tomutal, I meant not static methods, but static module code... maybe I use incorrect term.

    You know, that in desktop programming you can include into any file code, that is executed, when your app is loaded. Sometimes I used such code for initialization of global variables, that are unlikely to change:
    Code:
    TCHAR* CElement::TAG_CLOSE		= TEXT(">");
    TCHAR* CElement::SPACE			= TEXT(" ");
    TCHAR* CElement::ENDLINE		= TEXT("\n");
    TCHAR* CElement::TAB			= TEXT("\t");
    TCHAR* CElement::DELIMITER		= TEXT("\\");
    As you see, this code sets static class variables (allowed in Symbian) and is executed when app is loaded (as far as I undestand, not allowed in Symbian, because all the apps must be able to run "in place", without actual loading)

    This is the problem. I can perform initialization in E32Main(), but this means, that I'll have to rewrite E32Main every time I add or remove a module to/from compilation

  4. #4
    Registered User
    Join Date
    Mar 2003
    Location
    Bucharest, Romania
    Posts
    41
    This ideea of yours is chalenging but:
    1) are you sure this works on desktop apps?
    I have tried and I get compilation error (C2143: syntax error : missing ';' before '->') on

    CLibrary::GetInstance()->...

    since the compiler expects a method implementation after CLibrary::GetInstance()

    Or am I missing something? (I'm not a C++ guru ... yet

    2) On Symbian dlls you can't have static variables (members or global).

    This means that CElement::TAG_CLOSE and the others would not get pass by PETRAN.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×