title: QGIS: Default constructor for QgsVectorLayer and QgsRasterLayer?
body: <p>I'm trying to create a Windows Forms control using the QGIS API and a pre-defined QGIS project file, so that I can set X and Y properties on the Windows Forms control and the QGIS API will show the predefined map data in the Control, focused at the supplied coordinates.</p>
  
  <p>Using QgsProject::instance()->read() seems to cause an unhandled exception (Access violation reading location 0x00000000), so I'm trying to pick through the actual code line by line.  There's a portion of qgsproject.cpp that deals with extracting layers from a project file and then adding them to the map canvas that says:</p>
  
  <pre><code>QgsMapLayer *mapLayer = null;
  if(type=="vector")
      mapLayer = new QgsVectorLayer;
  else if(type==""raster")
      mapLayer = new QgsRasterLayer;
  </code></pre>
  
  <p>Where type is the value of the  element 'type' attribute.</p>
  
  <p>When I try to compile this in my Visual Studio project, it complains that there is no default constructor for either type of map layer.  The only constructors avaiable to me require paths and basenames, and don't seem to actually work (hence trying to use the same methods as the gui given that the project file does load in the full application gui).</p>
  
  <p>The default constructor for the QgsRasterLayer doesn't even seem to be a private member function.  Does anyone know how aI would go about making this compile?</p>
  
  <p>Thanks,
  Rik</p>