Fehler beim ausführen



  • Kann den Fehler selbst nicht genau finden.

    Hier mal der callstack:

    CClientDC::CClientDC(CWnd * 0x0012f64c {dlltestView hWnd=???}) line 981 + 42 bytes
    dlltestView::OnInitialUpdate() line 207 + 12 bytes
    ReadPosition(int * 0x0012f704, float * 0x0012f71c, float * 0x0012f708) line 127
    CDLLOffenDlg::OnButton1() line 204 + 17 bytes
    _AfxDispatchCmdMsg(CCmdTarget * 0x0012fe68 {CDLLOffenDlg}, unsigned int 1000, int 0, void (void)* 0x00401069 CDLLOffenDlg::OnButton1(void), void * 0x00000000, unsigned int 12, AFX_CMDHANDLERINFO * 0x00000000) line 88
    CCmdTarget::OnCmdMsg(unsigned int 1000, int 0, void * 0x00000000, AFX_CMDHANDLERINFO * 0x00000000) line 302 + 39 bytes
    CDialog::OnCmdMsg(unsigned int 1000, int 0, void * 0x00000000, AFX_CMDHANDLERINFO * 0x00000000) line 97 + 24 bytes
    CWnd::OnCommand(unsigned int 1000, long 852516) line 2088
    CWnd::OnWndMsg(unsigned int 273, unsigned int 1000, long 852516, long * 0x0012f96c) line 1597 + 28 bytes
    CWnd::WindowProc(unsigned int 273, unsigned int 1000, long 852516) line 1585 + 30 bytes
    AfxCallWndProc(CWnd * 0x0012fe68 {CDLLOffenDlg hWnd=???}, HWND__ * 0x000e0220, unsigned int 273, unsigned int 1000, long 852516) line 215 + 26 bytes
    AfxWndProc(HWND__ * 0x000e0220, unsigned int 273, unsigned int 1000, long 852516) line 368
    USER32! 77e02ca8()
    USER32! 77e04764()
    USER32! 77e04720()
    NTDLL! 778a15ef()
    USER32! 77e04925()
    USER32! 77e0ce0f()
    USER32! 77e16321()
    USER32! 77e02ca8()
    USER32! 77e02dc5()
    USER32! 77e02f0f()
    USER32! 77e1637d()
    CWnd::IsDialogMessageA(tagMSG * 0x005e8574 {msg=0x00000202 wp=0x00000000 lp=0x00090033}) line 182
    CWnd::PreTranslateInput(tagMSG * 0x005e8574 {msg=0x00000202 wp=0x00000000 lp=0x00090033}) line 3424
    CDialog::PreTranslateMessage(tagMSG * 0x005e8574 {msg=0x00000202 wp=0x00000000 lp=0x00090033}) line 92
    CWnd::WalkPreTranslateTree(HWND__ * 0x000e0220, tagMSG * 0x005e8574 {msg=0x00000202 wp=0x00000000 lp=0x00090033}) line 2667 + 18 bytes
    CWinThread::PreTranslateMessage(tagMSG * 0x005e8574 {msg=0x00000202 wp=0x00000000 lp=0x00090033}) line 672 + 18 bytes
    CWinThread::PumpMessage() line 848 + 30 bytes
    CWnd::RunModalLoop(unsigned long 4) line 3478 + 19 bytes
    CDialog::DoModal() line 539 + 12 bytes
    CDLLOffenApp::InitInstance() line 59 + 11 bytes
    AfxWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x001339e0, int 1) line 39 + 11 bytes
    WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x001339e0, int 1) line 30
    WinMainCRTStartup() line 198 + 54 bytes
    KERNEL32! 77e787f5()
    


  • welche der funktionen sind von dir?
    die? CDLLOffenDlg::OnButton1()
    die? dlltestView::OnInitialUpdate()

    falls ja mach mal n rechtsklick->gehe zu code und poste die zeile der jeweiligen funktion

    ausserdem noch die letzte zeile in
    CClientDC::CClientDC(CWnd * 0x0012f64c {dlltestView hWnd=???}) line 981 + 42 bytes



  • Die ==>> sind die Genaue Position wo der Verlauf hinzeigt

    Die letzte Zeile:

    CClientDC::CClientDC(CWnd* pWnd)
    {
    ==>>	ASSERT(pWnd == NULL || ::IsWindow(pWnd->m_hWnd));
    
    	if (!Attach(::GetDC(m_hWnd = pWnd->GetSafeHwnd())))
    		AfxThrowResourceException();
    }
    

    dlltestView

    if( ob->canRender() == true)
    	{
    		// Make sure, the overlay bitmap is enabled
    		ob->setEnable(true);
    ==>>		CClientDC dc(this); 
    		HDC hdc = dc.GetSafeHdc();
    		for(y=0;y<PICY;y++)
    		{
    			for(x=0;x<PICX;x++)
    			{
    				rgb = GetPixel(hdc,x,y);
    				rot[x][y]=GetRValue(rgb);
    				blau[x][y]=GetBValue(rgb);
    				gruen[x][y]=GetGValue(rgb);
    			}
    		}
    	}
    

    CDLLOffenDlg::OnButton1()

    ptr_pderrs1[1]=  ptr_cderrs1[1] = m_ptr_cderrs;
    ==>>	m_readposition = ReadPosition(&ptr_ncolours,ptr_pderrs1,ptr_cderrs1);
    
    	m_ptr_ncolours=ptr_ncolours;
    


  • blind schrieb:

    Die ==>> sind die Genaue Position wo der Verlauf hinzeigt

    ==>> ASSERT(pWnd == NULL || ::IsWindow(pWnd->m_hWnd));

    ==>> CClientDC dc(this);

    was sagt uns das?
    der this zeiger, den du dem konstruktor mit CClientDC dc(this); übergibst ist kein gültiges fenster (ASSERT(pWnd == NULL || ::IsWindow(pWnd->m_hWnd));)



  • und wie kann ich das umgehen da ich ja schlecht in einer dll ein Fenster öffnen kann.



  • poste mal die klasse: dlltestView



  • Hier zumindest der anfang der Funktion:

    //	CView::OnInitialUpdate();
    
    	// TODO: Speziellen Code hier einfügen und/oder Basisklasse aufrufen
    	DShowLib::Grabber::tVidCapDevListPtr pVidCapDevList = m_pGrabber->getAvailableVideoCaptureDevices();
      if( pVidCapDevList == 0 )
      {
    		if( m_pGrabber->getLastError() )
        {
          return;
        }
    		else
        {
          CString errMsg( "The list of all available video capture devices " );
          errMsg += ( "could not be generated!" );
          return;
        }
      }
    
      if( pVidCapDevList->empty() )
      {
        AfxMessageBox( "There are is no video capture device available!" );
        return;
      }
    
      // Generate a string which contains the index and the name of each available
      // video capture device
      CString message( "Available video capture devices: \n\n" );
      int index=0;
    
      // open the device which is defined by the entry specified by "deviceIndex"
      int deviceIndex;
    
      deviceIndex = 0; // the first device in the list
      if( deviceIndex < pVidCapDevList->size() )
      {
        m_pGrabber->openDev( (*pVidCapDevList)[deviceIndex] );
      }
    	DShowLib::Grabber::tVidFmtListPtr pVideoFormats = m_pGrabber->getAvailableVideoFormats();
      int formatIndex = 3; // select the first format // ab 1 bis 4 sind Farbbilder // 4= RGB24
      if( formatIndex < pVideoFormats->size())
      {
    		m_pGrabber->setSinkType( DShowLib::FrameGrabberSink(DShowLib::FrameGrabberSink::tFrameGrabberMode::eSNAP, DShowLib::eRGB24 ) );
    		m_pGrabber->setVideoFormat( (*pVideoFormats)[formatIndex]);
            m_pGrabber->setHWND( GetSafeHwnd() );    
      }
      else
      {
        AfxMessageBox("No video formats available");
      }
    
    	m_pGrabber->setSinkType( FrameGrabberSink( FrameGrabberSink::tFrameGrabberMode::eSNAP, eRGB24 ) );  
    
      // Set a MemBufferCollection.  
      Grabber::tMemBufferCollectionPtr pMemBuffColl = m_pGrabber->newMemBufferCollection( NUM_BUFFERS );  
      m_pGrabber->setActiveMemBufferCollection( pMemBuffColl );  
    
      m_pGrabber->startLive( false );               // Start the grabber. 
    	m_pGrabber->setProperty((DShowLib::Grabber::tCameraPropertyEnum)CameraControl_Exposure,(long)-7);
    //	Sleep(2280);
    	COLORREF rgb;
    	smart_ptr<DShowLib::OverlayBitmap> ob;
    	ob = m_pGrabber->getOverlay();
    	ob->beginPaint();
    	if( ob->canRender() == true)
    	{
    		// Make sure, the overlay bitmap is enabled
    		ob->setEnable(true);
    		CClientDC dc(this); 
    		HDC hdc = dc.GetSafeHdc();
    		for(y=0;y<PICY;y++)
    		{
    			for(x=0;x<PICX;x++)
    			{
    				rgb = GetPixel(hdc,x,y);
    				rot[x][y]=GetRValue(rgb);
    				blau[x][y]=GetBValue(rgb);
    				gruen[x][y]=GetGValue(rgb);
    			}
    		}
    	}
    	ob->endPaint();
    	m_pGrabber->snapImages( NUM_BUFFERS ); // Grab NUM_BUFFERS images.  
    	m_pGrabber->stopLive();                    // Stop the grabber.   
    /* 
    	pMemBuffColl->getBuffer( 0 )->save("TESTMEM.BMP");
    	BYTE *pImageData = m_pGrabber->getActiveMemBuffer()->getPtr();
    
    	//  Nun irgendwas pImageData[i]  machen. Farbanordnung bei RGB24 ist BGR. Jeweils drei Byte->ein Pixel 
    
    	// Das Overlay wird hier garnicht mehr gebraucht, da es erst auf dem
    	// nächsten Frame, den wir aber nicht sehen, dargestellt wird. Hier kann direkt
    	// in den FensterDC gezeichnet werden.
    
    	UpdateData(FALSE);
    	//ob->setEnable(true);
    
    	CClientDC dc(this); 
    
    //	HDC hdc = dc.GetSafeHdc();
    	//	xmax==640 ymax==480
    .
    .
    .
    .
    


  • // CView::OnInitialUpdate();

    was machst du mit dem cview?
    is das cview in der dll?
    wenn ja... warum?
    wann wird create aufgerufen?

    ... was machst dein programm/deine dll überhaupt?



  • Ich brauche das CView um auf eine Kammera, die über FireWire angeschlossen ist, zuzugreifen. Also ist das CView auch in der DLL es brauch aber nichts anzeigen sondern nur die Verbindung mit der Kammera aufbauen.

    creat wird soweit ich das Projekt im Kopfhabe garnicht aufgerufen da ich ja nichts anzeigen lassen will.

    In code steht nur diese Zeile mit creat:

    IMPLEMENT_DYNCREATE(dlltestView, CView)
    

    was mein Prog macht sind einige berechnungen mit Kammera Bildern.



  • zeig mal alle zeilen in denen du das cview benötigst und warum
    meiner meinung nach brauchst du absolut kein cview um zur kamera zu verbinden und die pixeldaten abzugreifen (is directshow oder?)


Anmelden zum Antworten