「Euroscope」というプログラムのプラグインをかなり前からやり始めようとしていますが、まだ何もできません。私は C++ の本を読んだことさえありますが、何も始めるのが難しすぎます。これからする質問は少し具体的で、説明するのが難しいでしょうが、自分でこれを解決しようとするのにうんざりしているので、ここに来ます.
「EuroscopePlugIn」というヘッダーに一連の関数プロトタイプをインポートしたクラスがあります。
私のプリンシパル.cppはこれです:
void CPythonPlugInScreen::meu()
{
//loop over the planes
EuroScopePlugIn::CAircraft ac;
EuroScopePlugIn::CAircraftFlightPlan acfp;
CString str;
CPythonPlugIn object;
for(ac=GetPlugIn()->AircraftSelectFirst();
ac.IsValid();
ac=GetPlugIn()->AircraftSelectNext(ac))
{
EuroScopePlugIn::CAircraftPositionData acpos=ac.GetPosition();
const char *c=ac.GetCallsign();
object.printtofile_simple_char(*c);
object.printtofile_simple_int(ac.GetState());
};
object.printtofile_simple_int(ac.GetVerticalSpeed());
object.printtofile_simple_int(acfp.GetFinalAltitude());
cout<<acfp.GetAlternate();
}
「printtofile_simple_int」と「printtofile_simple_char」が定義されているのは、次のようなクラス CPythonPlugIn です。
void printtofile_simple_int(int n){
ofstream textfile;
textfile.open("FP_simple_int.txt");
textfile<<(n);
textfile.close();
だから私はプログラムを開き、Build->Solution で作成した .dll をロードしますが、何もしません。.txt ファイルも作成されず、cout でさえ何も生成しません。私のマイクロ プログラムを理解するために必要な場合に備えて、ヘッダー ファイル "EuroScopePlugIn.h" のプロトタイプ情報をいくつか提供します。他に必要な場合は、私に尋ねてください。ここに入れます。
//---GetPlugIn-----------------------------------------------------
inline CPlugIn * GetPlugIn ( void )
{
return m_pPlugIn ;
} ;
&
CAircraft AircraftSelectFirst ( void ) const ;
//-----------------------------------------------------------------
// Return :
// An aircraft object instance.
//
// Remark:
// This instance is only valid inside the block you are querying.
// Do not save it to a static place or into a member variables.
// Subsequent use of an invalid extracted route reference may
// cause ES to crash.
//
// Description :
// It selects the first AC in the list.
//-----------------------------------------------------------------
&
int GetFinalAltitude ( void ) const ;
//-----------------------------------------------------------------
// Return :
// The final requested altitude.
//-----------------------------------------------------------------
プラグインの作成から始めるには助けが必要です。その時点から、試行錯誤の方法論で私は道を進んでいきます。ただ、始めるのは非常に難しいと思います...
助けてくれてどうもありがとう