Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

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
0
Troudeloup
Asked:
Troudeloup
  • 4
  • 2
1 Solution
 
TroudeloupAuthor Commented:
or rather,

how do I return more than one HWND is one function and how do I receive it ?
0
 
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);
0
 
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.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Jaime OlivaresSoftware ArchitectCommented:
no problem with my suggestion
0
 
TroudeloupAuthor Commented:
ohhh i get it, you pass it be reference to the function and so no return is required

got it :)
0
 
TroudeloupAuthor Commented:
would you take a look of the lastest two posts of this?

http://www.experts-exchange.com/Programming/Languages/CPP/Q_22983831.html
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now