Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Edit User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

6.8 Serializing Settings to the Registry

Objective Edit doesn't have a separate function that performs serialization. However, if you would like to serialize the current font and color settings of the language to the registry, several Objective Edit functions enable saving the settings into the registry in customized ways.

6.8.1 Saving Settings

  1. Specify where the language will be saved by calling SECEDIT_REG_WRITER(key).

  2. From then on, anytime you call SECEditLangConfig::WriteLanguage(language), the information will be saved into your registry.


    SECEDIT_REG_WRITER only modifies the memory and calls a new(); it does not actually save anything until WriteLanguage() is called.

6.8.2 Reading Settings Back

Assume you need to read from a registry with key name KEY1 and you want to write to a registry with key name KEY2 at the end. The language you are using is named Custom. Here's what you can do:

  1. In your CMyApp::InitInstance(), register this language at any point before the ShowWindow() function call:

  2. To read the information back from the registry, in your Document class

    will invoke reading language from KEY1.

    Also

    will invoke writing language to KEY2.


    In other classes, you will have to use GetEdit() instead of m_Edit.

The second parameter of SECEDIT_REGISTER_LANGUAGE can be any of the Reader macros. (Refer to Table 9.) The third parameter can be any of the Writer macros (Table 8). For example, if you want to read from an .ini file named ''reader.ini'' instead of KEY1, you can say:

You can also specify that if the registry does not have such entry, it should use your custom language resource/file instead. If you want to specify two sources to read from at the same time, for example, read from file first, if that fails, then read from a registry, you can call one of the combinational macros (Table 10):

(Use this as the second parameter for SECEDIT_REGISTER_LANGUAGE.)

6.8.3 SECEDIT Macros

Other similar macros you may be interested in are:

Table 8: Writer Macros

Writer Macros Definition
SECEDIT_INI_WRITER(file) write to .ini file
SECEDIT_BIN_WRITER(file) write to bin
SECEDIT_REG_WRITER(key) write to registry

Table 9: Reader Macros

Reader Macros Definition
SECEDIT_INI_READER(file) read from .ini file
SECEDIT_BIN_READER(file) read from bin
SECEDIT_REG_READER(key) read from registry
SECEDIT_RES_READER(resid) read from resource

Table 10: Composite Reader Macros

Composite Reader Macros Definition
SECEDIT_INI_REG_READER (file,key) read from .ini first, then registry
SECEDIT_BIN_REG_READER (file,key) read bin first, then registry
SECEDIT_RES_REG_READER (resid,key) read resource first, then registry

Obtain more information about using these macros from the SECEditLangConfig.h header file that contains them.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.