Solved

[windows] what type of variable is an handle ?

Posted on 2007-11-28
4
187 Views
Last Modified: 2010-04-01
how do I create an array of handles?
0
Comment
Question by:Troudeloup
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 400 total points
ID: 20367975
Juat use

HANDLE array1[42];

or

HWND array2[42];

Jandles are opaque data structures that pretend to be "complex", but in fact they aren't. Basically, they represent an index into an internal table that windows uses to store more information.
0
 

Author Comment

by:Troudeloup
ID: 20368010
0
 
LVL 86

Assisted Solution

by:jkr
jkr earned 400 total points
ID: 20368040
No, in that case, you'd use

vector<HWND> array2;

or

vector<HANDLE> array1;

Then yozu can use 'array1.size();' to find out about the size.
0
 
LVL 53

Assisted Solution

by:Infinity08
Infinity08 earned 100 total points
ID: 20368043
>> does array.size()
>> 
>> work?

Not if array is defined like jkr showed. You might want to use a vector instead.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now