|
Hi,
I have 2 objects derived from RECT
as RECT normal_rect;
RECT zoomed_rect;
There is an image displayed in normal_rect area.
same image in zoomed state will be displayed in zoomed_rect area.If i resize the zoomed_rect.it should be reflected in the normal image.
I would like to know is there way to map between 2 RECTs?
Regards
Neha
|
|
|
|
|
zoomed_rect.left=NORMAL_RECT.left*ratio
zoomed_rect.top=NORMAL_RECT.top*ratio
zoomed_rect.right=NORMAL_RECT.right*ratio
zoomed_rect.bottom=NORMAL_RECT.bottom*ratio
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Do you really mean *= ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
OOps!!!!
Thanks.
I'll go edit it now
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
How would you go about setting a background brush of a checkbox button?
WM_CTLCOLORBTN doesn't work with checkboxes and i can't seem to find any other way beside drawing a checkbox myself.
|
|
|
|
|
Override OnCtlColor and do this inside that :-
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(pWnd->GetDlgCtrlID()==IDC_CHECK1)
{
pDC->SetBkColor(RGB(255,0,0));
}
return hbr;
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
|
mfc just traps the wm_ctlcolor message afaik so do the same thing in that handler i would assume
---
"every year we invent better idiot proof systems and every year they invent better idiots ... and the linux zealots still aren't being sterilized"
|
|
|
|
|
There is no wm_ctlcolor message. There's WM_CTLCOLORBUTTON, WM_CTLCOLOREDIT, WM_CTLSOLORSTATIC.......
|
|
|
|
|
WM_CTLCOLOR has the value 0x0019.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I'm still trying to learn this whole device context stuff in windows.
Here is my Visual C++ 6.0 problem with an MFC application: I've got some DC that has some stuff drawn to it, and I want to output said DC (or actually just a portion of it) to a .bmp file. How in the world would I do this?
|
|
|
|
|
You actually want to output the bitmap that is selected into the DC, and the answer is in the FAQ.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I used SQL server to design database for my application,I use this line of code to make connection:
hr = m_pConnection->Open(L"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Name;",L"",L"",-1);
and everythings work properly.
Because I want to use this application on another computer and deploy a package for it,
I think I should changed the "Open" function .I used this but it does not work:
hr = m_pConnection->Open(L"Provider=SQLOLEDB.1;Data Source=D:\\MSSQL7\\Data\\Name_Data.MDF;",L"",L"",-1);
(SQL server make "Name_Data.mdf" for my database).Should I use this file?What should I change in my code
to use my application in another computer?
|
|
|
|
|
i use odbc links on the client machines ... can your method not use the same?
---
"every year we invent better idiot proof systems and every year they invent better idiots ... and the linux zealots still aren't being sterilized"
|
|
|
|
|
i am doing an assignment related to ftpclient appication..
as a download manager.. like getright or download accelerator plus..
i have problem regarding multiple dialog box opening per thread.
if only one dialog box is opened it it is working fine,
but for multiple dialog box data of one dialog box is mixing with another one.
have any solution?
|
|
|
|
|
What do you mean by one dialog is mixing with another?
I'd be very curious in such a phenomenon.
You mean they fuse at pixel level??????
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
The declaration of CArray class is as follows ..
template< class TYPE, class ARG_TYPE > class CArray
why do we need two template parameters TYPE and ARG_TYPE?
What is the significance of the ARG_TYPE ?
vimal
|
|
|
|
|
The ARG_TYPE determines the type used when adding and returning elements from the array. This is usually a reference to the element type, to avoid an extra copy constructor call.
--Mike--
My really out-of-date homepage
He who laughs last, didn't get the punchline and is just laughing so he won't look silly.
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
Ok, I'm want to copy the contents of one double array into another; ie
double *topArray;
double *Array;
...
...
topArray = new double[foo];
Array = new double[foo*4];
...
...
memcpy( Array[0], topArray, sizeof(double)*foo );
I thought that using memcpy() would work, but it doesn't. I guess because the arrays aren't chars
Is there any way to do this other than using for loops? as the arrays are both contiguous in memory it seems that memcpy() or similar would do the job quicker and neater.
TIA,
Pete
|
|
|
|
|
memcpy actually copies bytes. so it should work with double too.
try :-
memcpy(Array,topArray,sizeof toArray)
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
or in your syntax (i think):
memcopy(&array[0],&toparray[0],sizeof(double) * foo);
---
"every year we invent better idiot proof systems and every year they invent better idiots ... and the linux zealots still aren't being sterilized"
|
|
|
|
|
When an ActiveX control is the parent window of a modeless dialog box the TAB key, ToolTips don't work as expected. The problem with the TAB key could be solved using ::SetWindowsHookEx function, though it is quite dangerous.
But I still can't enable tooltips. Does anybody has any idea how to do this?
Thank you in advance,
Ruslan
|
|
|
|
|
Hey Guys
Does anybody know how to declare your own size variables in c++ for instance i want to make my own variable that is say 4bits or is 5 bytes big.
I guess this would have to be done in assembler.
Cheers
Peter
|
|
|
|
|
|
I'm not sure I fully understand the question at hand.
However you can create custom data types using structs or classes.
struct CustomType{
char theBytes[5]; //5 byte data type
unsigned theBits : 2; //*** : *** allows bit control
};
with the above code it's now possible to create an instance of your custom data type which holds 5 bytes instead of the built-in generic char, int, long, etc...
CustomType newType; //new datatype
unsigned char Type; //built-in datatype
Hope this helps
"An expert is someone who has made all the mistakes in thier field" - Niels Bohr
|
|
|
|