Crgn variable is required for execution.

CombineRgn(Crgn, hRgn1, hRgn2, RGN_AND); 

It got it. He was shut up with CreateRectRgn (0,0,0,0) ; By absurdity and inexperience, he considered that CombineRgn itself would create a region. Thanks to all.

  • Thank. But it is not clear how it is. If can be an example. - Dimka
  • Take a look here . Perhaps this example will help. They combine 2 regions, replacing the first one. - avp
  • @avp, you do not quite read the text? Where is CRgn::CombineRgn ?! - karmadro4
  • @ karmadro4, there is just another interface to the same small-scale functions that the author tries to use. In fact, he does not understand how to get the handle. In the dock (to which you give the link) about it is silent. Here, let him look at the analogue and understand the idea. - avp
  • @avp, I reveal where to get the handle from the line below. Read. MFCish wrapper class, which for some reason you referred to, creates a descriptor in constructors. - karmadro4

1 answer 1

Read mana , they rulez!

hrgnDest [in]

Combining two other regions. ( This region must exist before CombineRgn is called .)

My fatness Regions are created Create<shape>Rgn .


Naturally, initialization is required because destination region descriptor - parameter "in". The result of the operation is recorded in this region (the current content will be overwritten). The apparent illogicality with "in" and "out" arises because the API gives access only to opaque descriptors, and not to the data structures themselves.

In my opinion, the function (or macro) of HRGN CreateNullRgn(void) .

  • :))))) I did not say that the problem is in the creation of the region. Now I wanted to build them, but IDEShka requires everything and everyone to initialize. If at creation it was still possible then with this function is not clear. But thanks anyway! Manov to hell, but I still do not understand, I do not see the usual examples. - Dimka
  • one
    @ Dimka, added, I hope, it became clearer. In your case, there is no difference how to create a destination region, because the function will overwrite the content anyway. Compare descriptors with pointers, it uses the same in / out logic. - karmadro4 2:51 pm