库缺少需要的入口点,功能名:ufusr
本帖最后由 lzhyi 于 2017-2-14 11:32 编辑请问出现如下问题,是什么原因:库缺少需要的入口点,功能名:ufusr
代码如下:
#include "Shrinkage.hpp"
using namespace NXOpen;
using namespace NXOpen::BlockStyler;
Session *(Shrinkage::theSession) = NULL;
UI *(Shrinkage::theUI) = NULL;
Shrinkage *theShrinkage;
Shrinkage::Shrinkage()
{
try
{
// Initialize the NX Open C++ API environment
Shrinkage::theSession = NXOpen::Session::GetSession();
Shrinkage::theUI = UI::GetUI();
theDialogName = "Shrinkage.dlx";
theDialog = Shrinkage::theUI->CreateDialog(theDialogName.c_str());
// Registration of callback functions
theDialog->AddApplyHandler(make_callback(this, &Shrinkage::apply_cb));
theDialog->AddOkHandler(make_callback(this, &Shrinkage::ok_cb));
theDialog->AddUpdateHandler(make_callback(this, &Shrinkage::update_cb));
theDialog->AddFilterHandler(make_callback(this, &Shrinkage::filter_cb));
theDialog->AddInitializeHandler(make_callback(this, &Shrinkage::initialize_cb));
theDialog->AddFocusNotifyHandler(make_callback(this, &Shrinkage::focusNotify_cb));
theDialog->AddKeyboardFocusNotifyHandler(make_callback(this, &Shrinkage::keyboardFocusNotify_cb));
theDialog->AddDialogShownHandler(make_callback(this, &Shrinkage::dialogShown_cb));
}
catch(exception& ex)
{
throw;
}
}
Shrinkage::~Shrinkage()
{
if (theDialog != NULL)
{
delete theDialog;
theDialog = NULL;
}
}
#if USER_EXIT_OR_MENU
extern "C" DllExport voidufusr(char *param, int *retcod, int param_len)
{
try
{
theShrinkage = new Shrinkage();
// The following method shows the dialog immediately
theShrinkage->Show();
}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
delete theShrinkage;
}
#endif//USER_EXIT_OR_MENU
#if USER_EXIT
//------------------------------------------------------------------------------
// MUST NOT use this option since it will UNLOAD your NX Open application image
// from the menubar.
//------------------------------------------------------------------------------
extern "C" DllExport int ufusr_ask_unload()
{
//return (int)Session::LibraryUnloadOptionExplicitly;
return (int)Session::LibraryUnloadOptionImmediately;
//return (int)Session::LibraryUnloadOptionAtTermination;
}
//------------------------------------------------------------------------------
// This method is automatically called by NX.
//------------------------------------------------------------------------------
extern "C" DllExport void ufusr_cleanup(void)
{
try
{
//---- Enter your callback code here -----
}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
}
#endif//USER_EXIT
int Shrinkage::Show()
{
try
{
theDialog->Show();
}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
return 0;
}
#if CALLBACK
void Shrinkage::Show_Shrinkage()
{
try
{
theShrinkage = new Shrinkage();
theShrinkage->Show();
}
catch(exception& ex)
{
Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
delete theShrinkage;
}
#endif//CALLBACK
void Shrinkage::initialize_cb()
{
try
{
group0 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("group0"));
face_select0 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("face_select0"));
face_select01 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("face_select01"));
group01 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("group01"));
bodySelect0 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("bodySelect0"));
bodySelect01 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("bodySelect01"));
group = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("group"));
string0 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("string0"));
label0 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("label0"));
string01 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("string01"));
label01 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("label01"));
label02 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("label02"));
}
catch(exception& ex)
{
Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
}
//------------------------------------------------------------------------------
void Shrinkage::dialogShown_cb()
{
try
{
//---- Enter your callback code here -----
}
catch(exception& ex)
{
Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
}
int Shrinkage::apply_cb()
{
int errorCode = 0;
try
{
//---- Enter your callback code here -----
}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
errorCode = 1;
Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
return errorCode;
}
int Shrinkage::update_cb(NXOpen::BlockStyler::UIBlock* block)
{
try
{
if(block == face_select0)
{
//---------Enter your code here-----------
}
else if(block == face_select01)
{
//---------Enter your code here-----------
}
else if(block == bodySelect0)
{
//---------Enter your code here-----------
}
else if(block == bodySelect01)
{
//---------Enter your code here-----------
}
else if(block == string0)
{
//---------Enter your code here-----------
}
else if(block == label0)
{
//---------Enter your code here-----------
}
else if(block == string01)
{
//---------Enter your code here-----------
}
else if(block == label01)
{
//---------Enter your code here-----------
}
else if(block == label02)
{
//---------Enter your code here-----------
}
}
catch(exception& ex)
{
Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
return 0;
}
int Shrinkage::ok_cb()
{
int errorCode = 0;
try
{
errorCode = apply_cb();
}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
errorCode = 1;
Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
return errorCode;
}
//------------------------------------------------------------------------------
//Callback Name: filter_cb
//------------------------------------------------------------------------------
int Shrinkage::filter_cb(NXOpen::BlockStyler::UIBlock*block, NXOpen::TaggedObject* selectObject)
{
return(UF_UI_SEL_ACCEPT);
}
//------------------------------------------------------------------------------
void Shrinkage::focusNotify_cb(NXOpen::BlockStyler::UIBlock* block, bool focus)
{
try
{
//---- Enter your callback code here -----
}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
}
//------------------------------------------------------------------------------
void Shrinkage::keyboardFocusNotify_cb(NXOpen::BlockStyler::UIBlock* block, bool focus)
{
try
{
//---- Enter your callback code here -----
}
catch(exception& ex)
{
Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
}
页:
[1]