M Mostez Well-Known Member Licensed User Longtime User Feb 15, 2021 #1 I would like to know how to call c++ sub with B4R object , I want to call drawHLine sub from another c++ sub (draw) in other words here, how to convert array to B4R object and pass it to drawHLine sub void draw(){ drawHLine //?? } B4X: Copy void drawHLine(B4R::Object* o){ B4R::Array* b = (B4R::Array*)B4R::Object::toPointer(o); char* c = (char*)b->data; int x = (c[0]); int y = (c[1]); int l = (c[2]); ... ... }
I would like to know how to call c++ sub with B4R object , I want to call drawHLine sub from another c++ sub (draw) in other words here, how to convert array to B4R object and pass it to drawHLine sub void draw(){ drawHLine //?? } B4X: Copy void drawHLine(B4R::Object* o){ B4R::Array* b = (B4R::Array*)B4R::Object::toPointer(o); char* c = (char*)b->data; int x = (c[0]); int y = (c[1]); int l = (c[2]); ... ... }