Hi !
When running yak spec command on a freshly built MFC dll plug-in, yak correctly finds the RhinoPlugInName and RhinoPlugInVersion defined with RHINO_PLUG_IN_NAME and RHINO_PLUG_IN_VERSION but fails to retrieve other values, although defined.
Here is an example of output:
---
name: PluginName
version: 1.2.3.4
authors:
- <author>
description: <description>
url: <url>
Would it be possible to fix this, please ? Am I missing something ?
Thank you @dale !
I just wanted to let you know that I’ve developed a custom “yak spec” tool for Rhino’s MFC plug-ins, and it works fine. Here’s the code snippet that loads the appropriate symbols.
Regards
#include <stdio.h>
#include <windows.h>
#include <string>
#include <vector>
typedef const wchar_t* (*FnW)(void);
typedef const char* (*FnA)(void);
struct PluginInfo {
std::wstring name;
std::string version;
std::vector<std::wstring> authors;
std::wstring description;
std::wstring url;
std::vector<std::wstring> keywords;
std::wstring icon;
};
// main function
int wmain(int argc, wchar_t* argv[])
{
// arguments
...
// load rhp module
...
HMODULE hModule = LoadLibraryExW(
rhpPath.c_str(),
NULL,
DONT_RESOLVE_DLL_REFERENCES | LOAD_WITH_ALTERED_SEARCH_PATH
);
if (hModule)
wprintf(L"Loaded %ls\n", rhpPath.c_str());
else
{
PrintLastError();
wprintf(L"Failed to load %ls\n", rhpPath.c_str());
return 1;
}
// retrieve plugin info
FnW RhinoPlugInName = (FnW)GetProcAddress(hModule, "RhinoPlugInName");
FnA RhinoPlugInVersion = (FnA)GetProcAddress(hModule, "RhinoPlugInVersion");
FnW RhinoPlugInDeveloperOrganization = (FnW)GetProcAddress(hModule, "RhinoPlugInDeveloperOrganization");
FnW RhinoPlugInDescription = (FnW)GetProcAddress(hModule, "RhinoPlugInDescription");
FnW RhinoPlugInDeveloperWebsite = (FnW)GetProcAddress(hModule, "RhinoPlugInDeveloperWebsite");
// fill info struct
PluginInfo pInfo;
pInfo.name = RhinoPlugInName ? RhinoPlugInName() : GetFileNameWithoutExtension(rhpPath);
pInfo.description = RhinoPlugInDescription ? RhinoPlugInDescription() : L"<description>";
...
// free library
FreeLibrary(hModule);
...
return 0;
}