I can answer part of the problem myself. Adding #define WS_BUILD_DLL to the head of the file stops the dllimport issue.
Best regards…Paul
From: Paul Offord
Sent: 26 November 2015 22:37
To: 'wireshark-dev@xxxxxxxxxxxxx' <wireshark-dev@xxxxxxxxxxxxx>
Subject: plugin_if menu problems
Hi,
I am experimenting with the plugin_if menu functions. I’m creating the code in VS2013 and I have two stubborn errors that I can’t seem to resolve. The code is:
#include <plugin_if.h>
extern int proto_tmsvc;
void menu_setup()
{
ext_menu_t * ext_menu, *os_menu = NULL;
ext_menu = ext_menubar_register_menu(
proto_tmsvc, "TestMenu", TRUE);
ext_menubar_add_entry(ext_menu, "Jump 55",
"This button causes Wireshark to jump to packet 55", menu_cb, "55");
}
WS_DLL_PUBLIC_DEF void menu_cb(gpointer user_data)
{
}
I get two errors:
IntelliSense: argument of type "void (*)(gpointer user_data)" is incompatible with parameter of type "ext_menubar_action_cb" – referring to the menu_cb parameter in the call to ext_menubar_add_entry
IntelliSense: a function declared 'dllimport' may not be defined – referring to the menu_cb function definition
Any advice much appreciated.
Thanks and regards…Paul