I'm directly copying functions from the IncrementTextTool example into my code. One function calls textBlock->FindText()
private: bool IsSelectionValid(TextBlockPtr& textBlock) { if (textBlock.IsNull()) return false; WString regEx; TextBlock::FindTextParametersPtr findParams; // Setup for 'Find'-to search numbers in the string of the Text block using regular expression. SetupForFind(regEx, findParams); // Check if the string of the Text block has numbers. return (textBlock->FindText(regEx.c_str(), findParams.get(), textBlock->CreateStartCaret().get(), nullptr)).IsValid(); }
However, it doesn't link:
1> Creating library C:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\mdlapps_development/srs_changeFont.lib and object C:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\mdlapps_development/srs_changeFont.exp 1>ChangeFontTool.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class Bentley::RefCountedPtr<struct Bentley::DgnPlatform::TextBlock::FindTextMatch> __cdecl Bentley::DgnPlatform::TextBlock::FindTextW(wchar_t const *,struct Bentley::DgnPlatform::TextBlock::FindTextParameters const *,struct Bentley::DgnPlatform::Caret const *,struct Bentley::DgnPlatform::Caret const *)const " (__imp_?FindTextW@TextBlock@DgnPlatform@Bentley@@QEBA?AV?$RefCountedPtr@UFindTextMatch@TextBlock@DgnPlatform@Bentley@@@3@PEB_WPEBUFindTextParameters@123@PEBUCaret@23@2@Z) 1>C:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\mdlapps_development/srs_changeFont.dll : fatal error LNK1120: 1 unresolved externals
but when I build the example from the BMAKE file, it links and works fine. Why?? Could it have something to do with the a linker setting? It's obviously there in the .lib file... I've confirmed that I am including all the same lib files as the BMAKE is calling for.
Bruce