myComp would be a reference to your comp object. You might get it from the activeItem if your comp is open and selected:
var myComp = app.project.activeItem;
If not, you'll have to loop through the project items until you find a comp item with the name of the comp you're looking for (not tested, but should be close):
var myCompName = "Main Comp";
var myComp = null;
for (var i = 1; i <= app.project.numItems; i++){
if ((app.project.item(i).name == myCompName) && (app.project.item(i) instanceof CompItem)){
myComp = app.project.item(i);
}
}
if (myComp != null){
var w = myComp.width;
var h = myComp.height;
}else{
alert("Can't find comp " + myCompName);
}
Dan