return two hwnds

int main ()
HWND handles[2] = return_two_handle();
return 0;

HWND return_two_handle()
HWND handles[2];
  return handles;

this pops up:

.cpp: In function `int main()':
.cpp:57: error: invalid initializer
.cpp: In function `HWND__* sign_in_two()':
.cpp:152: error: cannot convert `HWND__**' to `HWND__*' in return
Who is Participating?
Jaime OlivaresConnect With a Mentor Software ArchitectCommented:
no problem with my suggestion
TroudeloupAuthor Commented:
or rather,

how do I return more than one HWND is one function and how do I receive it ?
Jaime OlivaresSoftware ArchitectCommented:
will be better to do this way:

void  return_two_handle(HWND &h1, HWND &h2)
  h1  = ....;
   h2 = ....;

so you can call this way:

HWND handle1, handle2;
return_two_handle(handle1, handle2);
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

TroudeloupAuthor Commented:
just one little detail,

the function would create those two handles and return it.

it's afunction that starts things and then i need those two handles returned to use them elsewhere.
TroudeloupAuthor Commented:
ohhh i get it, you pass it be reference to the function and so no return is required

got it :)
TroudeloupAuthor Commented:
would you take a look of the lastest two posts of this?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.