c++ - Can't return the POINT to use in another function -


got 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, firstly goes clicksemulationmove, saves pt getcursorpos (i need pt, cos must before moving mouse, return there then.) , pass clicksemulationclick use in mousereturn.
got following errors:
c2511: fb::variant testpluginapi::clicksemulationmove(point &) overloaded member function not found in "testpluginapi" , error c2665: fb::variant_detail::conversion::convert_variant: none of 5 overloads can convert parameter (this error got bunch of code , parameters below, post if needed) sounds pretty simple, doing wrong?

2 problems here; first can't pass arguments reference npapi method , can't firebreath method either. second, can't use arbitrary type.

you have few options:

  1. for input, recommend pass int x, int y function.
  2. for output, can either pass string decode or fb::variantlist values need become javascript array. return fb::variantmap become javascript object allowing pass named x , y values.
  3. if want able pass things reference pass in fb::jsobjectptr need javascript object or array ({} or []) have saved in javascript. make changes calling ->setproperty("x", xval) etc or ->setproperty(0, xval) if used array. call ->invoke("push", fb::variant_list_of(xval)) push onto array.

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -