Finally found the answer!
Any Javascript function which has to be called from function evaluateJavaScript is supposed to defined in an html file read by the C++ source as shown below:
Now instead of creating a new add marker function, I have added its code in the Open function defined below:
Code:
var map;
function initialize()
{
if (GBrowserIsCompatible())
{
map = new GMap2(document.getElementById("map"));
map.setCenter( new GLatLng(0,0),1 );
}
}
function Open (x,y)
{
map.setCenter (new GLatLng(x,y), 13);
var point = new GLatLng (x,y);
map.addOverlay (new GMarker(point));
}