Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/ap/apsetcontext.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/ap/apsetcontext.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/ap/apsetcontext.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/ap/apsetcontext.html on line 8

ApSetContext()

Set the PhAB context

Synopsis:

#include <Ap.h>

ApContext_t *ApSetContext( ApContext_t *context );

Arguments:

context
A pointer to the context you want to set the current PhAB context to. This argument should be the address of AbContext, a global data strcuture that PhAB puts into abmain.c, or NULL for no context.

Library:

Ap

Description:

ApSetContext() makes the given context current, and returns the previous current context. Both can be NULL; but if you pass a non-NULL pointer, it must point to a registered context.

At program startup, the program's PhAB context AbContext is made current. You can unset it or change it to a different context by calling ApSetContext(). You may want to do this in a DLL which calls Ap*() functions that use the current context.

In an application that doesn't involve DLLs, you can use this function to set the context to NULL when you're calling ApOpenDBaseFile(), to prevent the database from using your application's language translations if the file happens to contain widgets with the same name as one of your widgets.

Returns:

A pointer to the previous current context.

Examples:

This example sets the program's current context to NULL so that the widget database opened by ApOpenDBaseFile() doesn't use the current language translation:

 
ApContext_t *old = ApSetContext( NULL );
ApDBase_t *db = ApOpenDBaseFile( fname );
ApSetContext( old ); // Restore the program's context

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

Making a DLL out of a PhAB application in the Generating, Compiling, and Running Code chapter of the Photon Programmer's Guide


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/ap/apsetcontext.html on line 127

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/ap/apsetcontext.html on line 127