Insert & Keyword in XML or Include & in XML

To include ‘&’ in XML. Following should be use –

Use &app; instead of &

Example –

Suppose if you want to write Right&Left in XML file, then just replace & with &app;

Means you have to write Right&app;Left in XML file.

Posted in Uncategorized. Leave a Comment »

Declare Shared Variable in VC++

Shared Variable – Shared variables are those variables which can be shared in multiple instance of the same application. Suppose we are running three instance of an exe, then the value of shared variable will be same in all three instances. If any instance change the value of shared variable then it will be reflect in all instance.

In short shared variable is same as static variable, the only difference is that static variable contain same value for all instance of class and shared variable contains same value for all instance of application.

To declare shared variable in VC++, following code can be use in .cpp file

// shared data
#pragma data_seg(“.SHARED”)
int IsHomePageSet = -1;
#pragma data_seg()
#pragma comment(linker, “/section:.SHARED,RWS”)
// end shared data

In above code, IsHomePageSet is declared as a shared variable. This variable will be use as normal variable. Value of this variable will be same in all the instance of application.

Posted in Uncategorized. Leave a Comment »