mycommandlineinfo.cpp

来自「一个2D电磁场FEM计算的VC++源程序」· C++ 代码 · 共 74 行

CPP
74
字号
// MyCommandLineInfo.cpp: implementation of the CMyCommandLineInfo class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "femmview.h"
#include "MyCommandLineInfo.h"
#include "afxwin.h"
#include "lua.h"

extern lua_State * lua;
extern int m_luaWindowStatus;

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

extern CString luascriptname;

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CMyCommandLineInfo::CMyCommandLineInfo()
{
m_luaWindowStatus=SW_SHOW; // default unless otherwise 
}

CMyCommandLineInfo::~CMyCommandLineInfo()
{

}

void CMyCommandLineInfo::ParseParam (LPCTSTR lpszParam,BOOL bFlag,BOOL bLast )
{
	CString theparam;
	theparam.Format("%s",lpszParam);
	theparam.MakeLower();

	if(theparam.Left(11)=="lua-script=" && bFlag ==1)
	{
		luascriptname=theparam.Mid(11);
	}

	if (theparam=="windowhide" && bFlag==1)
	{
		m_luaWindowStatus=SW_MINIMIZE;
	}

	if (theparam.Left(8)=="lua-var=" && bFlag==1)
	{
		CString varname;
		CString vardata;
		for (int pos=8;pos<theparam.GetLength();pos++)
		{
			if (theparam.Mid(pos,1)=="=")
			{
				varname=theparam.Mid(8,pos-8);
				vardata=theparam.Mid(pos+1,theparam.GetLength()-pos+1);
				if(lua!=NULL)
				{
				lua_pushstring(lua,vardata);
				lua_setglobal(lua,varname);
				}
				pos=theparam.GetLength()+1;
			}	
		}
	}

	CCommandLineInfo::ParseParam(lpszParam,bFlag,bLast);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?