Got this code:
(I'm using FireBreath)
TestPluginAPI.h
FB::variant ClickSemulationMove(POINT);
FB::variant ClickSemulationClick(POINT);
TestPluginAPI.cpp
FB::variant TestPluginAPI::ClickSemulationClick(POINT pt)
{
ShowCursor(true);
MouseLeft();
MouseReturn(pt.x, pt.y);
ShowCursor(true);
return 0;
}
FB::variant TestPluginAPI::ClickSemulationMove(POINT &pt)
{
MouseMove(-325, 605);
POINT pt;
GetCursorPos(&pt);
return 0;
}
The idea is, that firstly goes ClickSemulationMove
, saves pt
from GetCursorPos
(i need exactly this pt, cos i must get it before moving the mouse, to return there then.) and then pass it to ClickSemulationClick
to use in MouseReturn
.
But i got following errors:
C2511: FB::variant TestPluginAPI::ClickSemulationMove(POINT &) overloaded member function not found in "TestPluginAPI"
and
error C2665: FB::variant_detail::conversion::convert_variant: none of the 5 overloads can convert all parameter
(this error got bunch of some code and parameters below, will post if needed)
It sounds pretty simple, but what exactly am i doing wrong?
2 problems here; the first is that you can't pass arguments by reference into a NPAPI method and thus you can't into a firebreath method either. Second, you can't use just any arbitrary type.
You have a few options: