Solved

return two hwnds

Posted on 2007-12-04
6
199 Views
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
0
Comment
Question by:Troudeloup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 

Author Comment

by:Troudeloup
ID: 20408292
or rather,

how do I return more than one HWND is one function and how do I receive it ?
0
 
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);
0
 

Author Comment

by:Troudeloup
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.
0
Industry Leaders: 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

by:
Jaime Olivares earned 500 total points
ID: 20408374
no problem with my suggestion
0
 

Author Comment

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

got it :)
0
 

Author Comment

by:Troudeloup
ID: 20408412
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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Template syntax for variable length arrays 9 79
DCT of  2D array using fftw in c++ 9 134
Indy 10 not Receiving UDP broadcast 3 56
C++ Code Issue 4 48
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

751 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