Click here to Skip to main content
15,913,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C++: pls help me to choose or suggest me a new one Pin
Chris Meech21-Jun-06 2:33
Chris Meech21-Jun-06 2:33 
AnswerRe: C++: pls help me to choose or suggest me a new one Pin
HakunaMatada21-Jun-06 2:49
HakunaMatada21-Jun-06 2:49 
GeneralRe: C++: pls help me to choose or suggest me a new one Pin
Sarath C21-Jun-06 3:14
Sarath C21-Jun-06 3:14 
GeneralRe: C++: pls help me to choose or suggest me a new one Pin
HakunaMatada21-Jun-06 18:18
HakunaMatada21-Jun-06 18:18 
AnswerRe: C++: pls help me to choose or suggest me a new one Pin
led mike21-Jun-06 7:37
led mike21-Jun-06 7:37 
Questionhow to embed controls in mail merge Pin
karthik Tamizhmathi21-Jun-06 0:22
karthik Tamizhmathi21-Jun-06 0:22 
AnswerRe: how to embed controls in mail merge Pin
NiceNaidu21-Jun-06 0:44
NiceNaidu21-Jun-06 0:44 
QuestionGDI Region in a Class... Pin
nermsk20-Jun-06 23:59
nermsk20-Jun-06 23:59 
Hi everyone.

I have a problem, and no ideas...

<br />
class municipality<br />
{<br />
private:<br />
	...<br />
<br />
	HRGN the_region;<br />
        ...<br />
}<br />



I work with the array of type municipality, in C++ declared as GLOBAL variable.

<br />
municipality* g_my_municipalities;<br />
<br />
g_my_municipalities = new municipality[size];<br />


Then I loop through the array to do the 'hit tests' etc...

The problem appears when I attempt to transform the regions (HRGN).

I used the following routine to transform it:

   <br />
void municipality::Transform(float factor, POINT offset)<br />
{               <br />
WORD size;<br />
<br />
LPRGNDATA pData;<br />
<br />
XFORM xfr;<br />
	   <br />
xfr.eM11 = factor;<br />
xfr.eM12 = 0;<br />
xfr.eM21 = 0;<br />
xfr.eM22 = factor;<br />
xfr.eDx = offset.x;<br />
xfr.eDy = offset.y;<br />
<br />
size = GetRegionData(the_region, 0,0);<br />
		<br />
pData = new RGNDATA[size];<br />
		<br />
GetRegionData(the_region, size, pData);<br />
<br />
the_region = ExtCreateRegion(&xfr, size, pData);<br />
		<br />
delete pData;<br />
}<br />


The problem is that there is a memory leak, but I thought of a following concept:

1) To create and keep the original array of municipalities, preserving the original (untransformed regions),
2) To create temporary array of municipalities and then to fill it with the original values (regions) and then to apply the transformation to this array,
3) To erase the temporary array 'delete [] temp_municipality (go arround the memory leak) in order to free the memory.

The thing is that I do not have an idea on how to design the copy constructor for the municipality class, for the member HRGN.

I would appreciate the help on this!

Thanks in advance...
AnswerRe: GDI Region in a Class... Pin
NiceNaidu21-Jun-06 0:07
NiceNaidu21-Jun-06 0:07 
GeneralRe: GDI Region in a Class... Pin
nermsk21-Jun-06 0:13
nermsk21-Jun-06 0:13 
GeneralRe: GDI Region in a Class... Pin
NiceNaidu21-Jun-06 0:38
NiceNaidu21-Jun-06 0:38 
GeneralRe: GDI Region in a Class... Pin
nermsk21-Jun-06 1:39
nermsk21-Jun-06 1:39 
AnswerRe: GDI Region in a Class... Pin
Weiye Chen21-Jun-06 0:15
Weiye Chen21-Jun-06 0:15 
Questionregarding CTime Pin
happy_ram20-Jun-06 23:32
happy_ram20-Jun-06 23:32 
AnswerRe: regarding CTime Pin
jhwurmbach20-Jun-06 23:48
jhwurmbach20-Jun-06 23:48 
AnswerRe: regarding CTime Pin
toxcct20-Jun-06 23:50
toxcct20-Jun-06 23:50 
AnswerRe: regarding CTime Pin
NiceNaidu20-Jun-06 23:56
NiceNaidu20-Jun-06 23:56 
AnswerRe: regarding CTime Pin
Weiye Chen21-Jun-06 0:03
Weiye Chen21-Jun-06 0:03 
QuestionBreak point Pin
Anu_Bala20-Jun-06 23:13
Anu_Bala20-Jun-06 23:13 
AnswerRe: Break point Pin
Cedric Moonen20-Jun-06 23:22
Cedric Moonen20-Jun-06 23:22 
GeneralRe: Break point Pin
Anu_Bala20-Jun-06 23:32
Anu_Bala20-Jun-06 23:32 
GeneralRe: Break point Pin
NiceNaidu20-Jun-06 23:48
NiceNaidu20-Jun-06 23:48 
GeneralRe: Break point Pin
kakan20-Jun-06 23:55
professionalkakan20-Jun-06 23:55 
GeneralRe: Break point Pin
Sarath C21-Jun-06 1:00
Sarath C21-Jun-06 1:00 
QuestionShared DLL Pin
arunperi20-Jun-06 23:03
arunperi20-Jun-06 23:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.