// GigaCam_TLI.h : main header file for the GIGACAM_TLI application
//

#if !defined(AFX_GIGACAM_TLI_H__12CB1D18_B0F6_49C6_8D54_340CEDCB1672__INCLUDED_)
#define AFX_GIGACAM_TLI_H__12CB1D18_B0F6_49C6_8D54_340CEDCB1672__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifndef __AFXWIN_H__
	#error include 'stdafx.h' before including this file for PCH
#endif

#include "..\resource.h"       // main symbols
//#include "clAPI.h"
//#include "flash.h"
//#include "Device.h"
//#include "Sslifx.h"
//#include "errormanagerapi.h"


/////////////////////////////////////////////////////////////////////////////
// CGigaCamTLIApp:
// See GigaCam_TLI.cpp for the implementation of this class
//
BOOL static ShowErrorMngrHistory(/*CDevice *m_GIGEDevice = NULL*/)
{
	//char errormsg[4096];
	CString message = " GigaCam last errors: \n********************* \n", temp;
	BOOL GotError = FALSE;
	int counter = 0;
	//CNICManager * theNIC = NULL;
	//	
	////CSystemFactory *theFactory = GetSystemFactory(); //new CSystemFactory();
	//if(m_GIGEDevice!= NULL)
	//	theNIC = m_GIGEDevice->GetTheNIC();
	//if(theNIC != NULL)
	//{
	//	// Check for no link
	//	if(!theNIC->IsLinkUp())
	//	{
	//		AfxMessageBox("Error - No Ethernet Link, Check Connections");
	//		return TRUE;
	//	}
	//	// Check for Link up but after a change in state - Discovery is needed
	//	if(theNIC->LinkStateChanged())
	//	{
	//		// Message already given, just exit
	//		return TRUE;
	//	}

	//}

	//while(TLI_GetLastErrorInfo(errormsg, 4096))
	//{
	//	if(!strcmp("Error - No Ethernet Link, Check Connections", errormsg))
	//	{
	//			AfxMessageBox(errormsg);
	//			return TRUE;
	//	}
	//	if(!strcmp("Error - No Turbolinx-supported NIC is installed", errormsg))
	//	{
	//			AfxMessageBox(errormsg);
	//			return TRUE;
	//	}
	//	if(!strcmp("Error - No Device was found", errormsg))
	//	{
	//			AfxMessageBox(errormsg);
	//			return TRUE;
	//	}

	//	if(!strstr("board\'s flash", errormsg))
	//	{
	//			AfxMessageBox(errormsg);
	//			return TRUE;
	//	}


	//	GotError = TRUE;
	//	temp.Format(errormsg);
	//	message+=temp;
	//	message+="\n---------------------------------------------\n";
	//	if(counter++>5)
	//	{
	//		message+="\n  more errors on next message box  \n";
	//		if(IDCANCEL==AfxMessageBox(message, MB_OKCANCEL))
	//			return FALSE;
	//		message = " GigaCam last errors: \n********************* \n";
	//		counter = 0;
	//	}
	//}
	//
	//if(GotError)
	//	AfxMessageBox(message);
	//else
	//	AfxMessageBox("Unknown Error");
	//return FALSE; 

	return FALSE; 
}

class CGigaCamTLIApp : public CWinApp
{
public:
	CGigaCamTLIApp();
	
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CGigaCamTLIApp)
	public:
	virtual BOOL InitInstance();
	//}}AFX_VIRTUAL

// Implementation
	//{{AFX_MSG(CGigaCamTLIApp)
	afx_msg void OnAppAbout();
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};


/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_GIGACAM_TLI_H__12CB1D18_B0F6_49C6_8D54_340CEDCB1672__INCLUDED_)
