Hallo,
ich arbeite mit Microsoft Visual C++ 6.0 und WinXP. Ich versuche mit einer Bibliothek von Matrox (Matrox Imaging Library) eine Kamera anzubinden. Die Allozierung von der Applikation, System, Display funktioniert ohne Probleme. Bei der Allozierung des Digitizers (Kamera) kommt nun folgende Fehlermeldung:
Ich glaube es liegt an dem Pfad zum DCF File für die Kamera. Aber ich komme da auf keinen grünen Zweig.
Hier mal der gesamte Code:
Ich bin für jede Hilfestellung Dankbar!
ich arbeite mit Microsoft Visual C++ 6.0 und WinXP. Ich versuche mit einer Bibliothek von Matrox (Matrox Imaging Library) eine Kamera anzubinden. Die Allozierung von der Applikation, System, Display funktioniert ohne Probleme. Bei der Allozierung des Digitizers (Kamera) kommt nun folgende Fehlermeldung:
Code:
Unbehandelte Ausnahme in MilGrab.exe (Mil.DLL): 0xC0000005: Access Violation
Hier mal der gesamte Code:
Code:
// MilGrab.cpp : Definiert den Einsprungpunkt für die Konsolenanwendung. // #include "stdafx.h" #include <iostream.h> #include <mil.h> #include <conio.h> typedef char * STRING; void main(void) { // Mil used ID's MIL_ID MilApplication = M_NULL, MilSystem = M_NULL, MilDisplay = M_NULL, MilDigitizer = M_NULL, MilImageBuffer = M_NULL; STRING DCF_File_Path = "D:\Programme\MIL-Lite 8.0\Solios_DCF"; long SizeX = 0, SizeY = 0, Type = 0; // Allocate Defaults MilApplication = MappAlloc(M_DEFAULT, M_NULL); MilSystem = MsysAlloc(M_SYSTEM_SOLIOS, M_DEV0, M_COMPLETE, M_NULL); MilDisplay = MdispAlloc(MilSystem, M_DEFAULT, "M_DEFAULT", M_WINDOWED, M_NULL); MilDigitizer = MdigAlloc(MilSystem, M_DEV0,(MIL_TEXT_PTR) (*DCF_File_Path), M_DEFAULT, M_NULL); MbufAlloc2d(MilSystem, MdigInquire(MilDigitizer, M_SIZE_X, &SizeX), MdigInquire(MilDigitizer, M_SIZE_Y, &SizeY), MdigInquire(MilDigitizer, M_TYPE, &Type), M_IMAGE + M_DISP + M_GRAB + M_PROC, &MilImageBuffer); if (MappGetError(M_GLOBAL, M_NULL)) printf("\n Alloc is abortive. Please close this application and restart it again.\n"); else printf("\n Allocation was succesfull.\n"); // Grab continuously MdigGrabContinuous(MilDigitizer, MilImageBuffer); // When a key is pressed, halt. printf("\n\t DIGITIZER (CEDIP SILVER) ACQUISITION:"); printf("\n\t -------------------------------------\n"); printf("\n\t Continuous Image grabbing in process."); printf("\n\t Press <Enter> to stop.\n\n"); getch(); // Stop continuous grab. MdigHalt(MilDigitizer); // Show result. printf("\t Continous grab stopped."); printf("\n\t Press <Enter> to do a single image grab.\n\n"); getch(); // Monoshot grab. MdigGrab(MilDigitizer, MilImageBuffer); // Show result. printf("\t Displaying the grabbed image.\n"); printf("\t Press <Enter> to end.\n\n"); getch(); // Release defaults. MbufFree(MilImageBuffer); MdigFree(MilDigitizer); MdispFree(MilDisplay); MsysFree(MilSystem); MappFree(MilApplication); }
Comment