nsresult rv = nsComponentManager::CreateInstance(kDeviceContextCID, nsnull, NS_GET_IID(nsIDeviceContext), (void **)&dx);
nsresult rv = CallCreateInstance(kDeviceContextCID, &dx);
int main(int argc, char** argv){#if 0  // Create test document and presentation context  MyDocument *myDoc = new MyDocument();  nsPresContext* presContext;  nsIDeviceContext *dx;    static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);  nsresult rv = nsComponentManager::CreateInstance(kDeviceContextCID, nsnull, NS_GET_IID(nsIDeviceContext), (void **)&dx);  if (NS_OK == rv) {    dx->Init(nsull);     dx->SetDevUnitsToAppUnits(dx->DevUnitsToTwips());     dx->SetAppUnitsToDevUnits(dx->TwipsToDevUnits());  }  NS_NewGalleyContext(&presContext);  presContext->Init(dx, nsnull);  // Test basic reflowing of unmapped children  if (!TestReflowUnmapped(presContext)) {    return -1;  }  // Test the case where the frame max size is too small for even one child frame  if (!TestChildrenThatDontFit(presContext)) {    return -1;  }  if (!TestOverflow(presContext)) {    return -1;  }  if (!TestPushingPulling(presContext)) {    return -1;  }  if (!TestSplittableChildren(presContext)) {    return -1;  }  if (!TestMaxElementSize(presContext)) {    return -1;  }  /*  if (!TestIncremental(presContext)) {    return -1;  }  if (!TestBorderPadding(presContext)) {    return -1;  }  if (!TestChildMargins(presContext)) {    return -1;  }  if (!TestAlignment(presContext)) {    return -1;  }  if (!TestDisplayNone(presContext)) {    return -1;  }  if (!TestRelativePositioning(presContext)) {    return -1;  }  if (!TestAbsolutePositiong(presContext)) {    return -1;  }  */  presContext->Release();  myDoc->Release();#endif  return 0;}