Unterschied CMainWindow CMainFrame



  • Hallo,

    ich hab hier ein Besispielprojek was mit Visual C++6.0 erstellt wurde. Ich denke es war ein SDI und hat als Window Klasse CMainWindow.

    nun programmier ich hier aber mit Visual Studio .Net 2003 ein C++ Projekt, ein SDI.

    In dieses soll ein Teil des Beispiels mit einfließen.

    In dem Beispiel stand es so:

    CMainWindow::CMainWindow()
    {
      bSerie = FALSE;
      bShow = FALSE;
      bChangeLut = FALSE;
      bTimerAktiv = FALSE;
      bViewCol = FALSE;
      bChangeCam = FALSE;
      bNewPic = FALSE;
    
      LoadFrame(IDR_MAINFRAME);
      Bild = NULL;                         // assign image handle to NULL
      mydc = new CPaintDC(this);
      mymemdc = new CDC();
      mymemdc->CreateCompatibleDC(mydc);
      Cam = new CSensi(mydc,mymemdc);      // create camera object
      Cam->Init();                         // initialize camera and low level software
    
      hTimer = timeSetEvent(10,10,Timer,(unsigned long) this,TIME_PERIODIC|TIME_CALLBACK_FUNCTION);
    }
    

    und wenn ich das dann für mein Projekt in die MainFrame.cpp hole:

    CMainFrame::CMainFrame()
    {
    
    	//Init der Geräte
    
    	//IRO
    	if(ComPortInit("Com1",9600,8,NOPARITY,ONESTOPBIT) == TRUE)
    	{
    		bPortopen = true;
    		if(bPortopen == true && (SendChar(0x12) != 0))
    		{
    			bPortopen = true;
    		}
    		else
    		{
    			bPortopen = false;
    		}
    	}
    	else
    	{
    		bPortopen = false;
    
    	}
    
    	//Kamera
    	bPortopen = false;
    	bSerie = FALSE;
    	bShow = FALSE;
    	bChangeLut = FALSE;
    	bTimerAktiv = FALSE;
    	bViewCol = FALSE;
    	bChangeCam = FALSE;
    	bNewPic = FALSE;
    
    	LoadFrame(IDR_MAINFRAME);
    	Bild = NULL;                         // assign image handle to NULL
    	mydc = new CPaintDC(this);
    	mymemdc = new CDC();
    	mymemdc->CreateCompatibleDC(mydc);
    	Cam = new CSensi(mydc,mymemdc);      // create camera object
    	Cam->Init();                        // initialize camera and low level software
    
    	hTimer = timeSetEvent(10,10,Timer,(unsigned long) this,TIME_PERIODIC|TIME_CALLBACK_FUNCTION);
                                          // create timer function
    
    	//Spectrograph
    
    }
    

    steigt er bei LoadFrame(IDR_MAINFRAME) aus. Es funzt auch nicht, wenn das und Bild = NULL auskomentiere. Irgendwas ist nicht falsch bzw. kompatibel, aber ich komm nicht drauf. 😞

    Für einen Tip wäre ich sehr dankbar. 🙂

    Gruß


Anmelden zum Antworten