Go Premium for a chance to win a PS4. Enter to Win


return two hwnds

Posted on 2007-12-04
Medium Priority
Last Modified: 2010-04-01
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
Question by:Troudeloup
  • 4
  • 2

Author Comment

ID: 20408292
or rather,

how do I return more than one HWND is one function and how do I receive it ?
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20408341
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);

Author Comment

ID: 20408347
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.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 55

Accepted Solution

Jaime Olivares earned 2000 total points
ID: 20408374
no problem with my suggestion

Author Comment

ID: 20408388
ohhh i get it, you pass it be reference to the function and so no return is required

got it :)

Author Comment

ID: 20408412
would you take a look of the lastest two posts of this?


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question