//头文件
#include <Windows.h>
#include <iostream>
#include <NXOpen/ListingWindow.hxx>
//定义函数
string GetNXPath();
//获取NX主程序路径
string MyClass::GetNXPath()
{
char NXPath[MAX_PATH];
GetModuleFileNameA(NULL, NXPath, MAX_PATH);
string NX_path = NXPath;
return NX_path;
}
void MyClass::do_it()
{
// 打开信息窗口
theSession->ListingWindow()->Open();
string NXFullPath = GetNXPath();
//输出路径到信息窗口
theSession->ListingWindow()->WriteLine(NXFullPath);
}