|
In a function i am doing following things
Function starts
<br />
CBitmap *pWFRBitmap = pDoc->m_Analyzer.GetWFRBitmap();<br />
pWFRBitmap->CreateCompatibleBitmap(&ClientDC, 860, 1100);<br />
ClientDC.SetMapMode(MM_LOENGLISH);<br />
<br />
CDC MemDC;<br />
MemDC.CreateCompatibleDC(&ClientDC);<br />
MemDC.SelectObject(pWFRBitmap);<br />
MemDC.SetMapMode(MM_TEXT);<br />
MemDC.SetMapMode(MM_LOENGLISH);<br />
Function ENds
1.0 What exactly will happen. To the bitmap in CAnalyser and MemDC. Will the content of MemDC will be written to CBitmap which is attached to MemDC.
2.0 What will happen if every thing remains same and i make CDC MemDC global?
3.0 I want to make another function in CAnalyser like SetBitmap and want to assign the content of the CDC MemDC (global) to assigned to that CBitmap member of CAnalyser m_WFRBitmap so that i can draw the bitmap again whenever my screen get redrawn instead of carrying out complete drawing process again and again.
How to do this?
Leave your mark wherever you go
|
|
|
|
|
1.0 Yes! Because MemDC contains your bitmap and therefore is draw on your bitmap. Before calling CreateCompatibleBitmap() make sure that the bitmap does not already exist or you will have problems. DO NOT for get to restore the origanal bitmap to the MemDC after drawing to it.
2.0 & 3.0 The only reason for making MemDC global is so you will not have to call CreateCompatibleDC() more than once. You will still need to clean it up after evey usage though. That is call SelectObject(pOldBitmap) after drawing to bitmap or using MemDC to blit the image to the client area.
Lookup CDC::CreateCompatibleDC() in the MSDN library (there is sample code there)
INTP
|
|
|
|
|
How to detect that background under child window is changed?
Problem is following:
I use owner-drown CStatic ( rectanule) as
surround rectangle, but fill the background under it.
In CDialog:: OnEraseBackground,
I call that CStatic::OnEraseBackground.
At first time all controls appears,
but next, if I move some window around that CStatic:
controls are under backgrounf - do not know that background is filled and
not redraw self - so thay are hide under filling.
How for child windows to know that background is changed ?
I use a collection of controls that placed within filled CStatic rectangle,
so I can command
Invalidate(0);
UpdateWindow(); for each.
But this is not helps.
How to renew controls when background owner-drawn change
(in CStatic::OnEraseBackground ) ?
Helps if I command to renew full CDialog, but it happens at too much cost of renewing all controls , not within desired rectangle,
but result need as in that case.
How to achieve it ?
thanks you.
|
|
|
|
|
I have server with several network card. I need to route messages (in my server software) from one of them to another. And I need to include my server machine ip in the messages. How to obtain interface ip from destination ip ?
Thank you in advance.
|
|
|
|
|
If you use winsock and ping (echo request) the destination the echo reply will have the IP of your i/f in its destination address of the tcp packet.
Ant.
|
|
|
|
|
I think you want GetBestInterface , from the IP Helper API. You can then use GetIpAddrTable to determine the set of IP addresses for that interface.
If you're designing this protocol, though, I recommend that you don't include the IP address in the message. Your protocol won't work across Network Address Translation (for example, from a private to a public network), and it won't work on IPv6 networks. The client should already know which server it's connecting to.
If the server needs to know the IP address of the client, you should pass a sockaddr_in structure to accept (for TCP connections), or use recvfrom for UDP-based protocols. Use sockaddr_in6 for an IPv6 socket.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi all,
I just want to change the mouse cursor of the entire SDI to special (custom) cursor.
I tried a lot of thing, but it doesnt work. Any ideas?
Thanks,
Paul
|
|
|
|
|
Hi
1)Override OnSetCursor of CView
2)Add ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
3)Remove the base class call CView::OnSetCursor
4)Add return TRUE;
rgds ...mil10
|
|
|
|
|
Hi,
I'm interested in porting some mac c++ code to PC. I use al lot of heavy vector math. There are, probably, libraries for this. But how do you use them all, so you don't have to create new applications or new code for every processor? (p3, p4, athlon, athlon xp, etc.)
Does anyone know if there are templates, macros or something for this?
I just looked at OptiVec (http://www.optivec.com/), does anyone have some experience with this?
Great to hear something, some pointers/url/etc,
Best Regards,
Aram
|
|
|
|
|
I can't understand how C++ vector math can be different under different processors.
Ant.
|
|
|
|
|
The only difference could be when you use SIMD instructions.
Don't try it, just do it!
|
|
|
|
|
OK, I'll put it like this.
I'm using SIMD instructions, are there some libaries which will convert my high-level code to the proper (processor dependent) low-level machine code, in order to get the fastest vector math possible on every PC processor?
Or do I need to build this in my self, checking which processor and then applying the right optimized vector code for that one?
what about www.optivec.com, could this be where I am looking for?
thanks!
|
|
|
|
|
Hi,
Does someone knows how to make a subst programmaticaly in c++ under WNT4 ?
Thanks
|
|
|
|
|
I've not ever used the DOS subst command, but are you needing WNetAddConnection() , or maybe WNetUseConnection() ?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I was talking about the subst.exe command.
I had a response : it's the DefineDosDevice(...) function.
Thanks
|
|
|
|
|
how to detect the change in the address bar of IE from VC++ program.
|
|
|
|
|
May be BHO can give you more control. For capturing that..
greatest thing is to do wot others think you cant suhredayan@omniquad.com>
messenger :suhredayan@hotmail.com
|
|
|
|
|
|
how to monitor new generated process from vc++ program
|
|
|
|
|
|
how do i set the code so that the .exe file will have the icon instead of the MFC icon?
|
|
|
|
|
go into the "Resource View" tab of your project and change both IDR_MAINFRAME icons to whatever icons you want
|
|
|
|
|
i did that but that only show in the title bar of the program, not on the .exe file that list under windows explorer.
|
|
|
|
|
Did you change them both ?
BTW - there is an MSDN article on this subject also.
__________________________________________
a two cent stamp short of going postal.
|
|
|
|
|
Hi
go to Resource View
Click ICOn
click IDR_MAINFRAME icon
Set the icon say your to both
small (16 * 16)
and Standard(32 * 32)
from the combo box in resource views side view above icon display
|
|
|
|