增加导出DLL工程。

This commit is contained in:
TAO Cheng
2014-04-13 23:30:50 +08:00
parent a71aa9182f
commit 4bfd0a6a4c
32 changed files with 1154 additions and 146 deletions
@@ -1,7 +1,6 @@
#include "StdAfx.h"
#include <WinDef.h>
#include <WinBase.h>
#include <math.h>
#include "DLL.h"
#include "EF8000_Interface.h "
@@ -29,6 +28,32 @@ CEF8000_Interface::~CEF8000_Interface()
}
//******************************************************************************
void CEF8000_Interface::GetAppPath(CString &Path)
{
Path=_T(""); // Speed optimization - noticed slow in GlowCode
if (Path.IsEmpty())
{
CString tmpPath;
GetModuleFileName(NULL,tmpPath.GetBuffer(255),255);
tmpPath.ReleaseBuffer();
tmpPath.TrimRight();
int nLastSlash = tmpPath.ReverseFind('\\');
if (nLastSlash >= 0)
tmpPath = tmpPath.Left(nLastSlash);
else
tmpPath.Empty();
Path=tmpPath;
}
};
BOOL CEF8000_Interface::OpenMotorDat()
{
CString csAppPath;
GetAppPath(csAppPath);
CString csMotorDatFile =csAppPath+_T("\\motor.dat");
return OpenSpeedParameter(csMotorDatFile);
}
BOOL CEF8000_Interface::SaveSpeedParameter(CString _FileName)
{
FILE* iFileHandle=NULL;
@@ -84,7 +109,8 @@ FILE* CEF8000_Interface::FileOpen(const CString filename,const int Mode)
case fmOpenWrite: fileMode =_T("wb"); break;
case fmOpenReadWrite:fileMode =_T("wb+"); break;
}
FILE *FileStream = _tfopen(filename, fileMode);
FILE *FileStream = NULL;
_tfopen_s(&FileStream,filename, fileMode);
return FileStream;
};