|
Here is the function I settled on. Unfortunately, I copied most of the code from another source on the internet, and lost my link to it. Therefore I cannot properly cite that source. If you recognize the code as yours, then please accept my thanks for it.
void CLabeledBitmap::CopyBitmapSection(CBitmap &bmpSrc, CBitmap &bmpDest, CRect &rectSection, CDC* pDC)
{
int nWidth = rectSection.Width();
int nHeight = rectSection.Height();
CDC destDC, srcDC;
CBitmap *pOldBmp = NULL;
CBitmap *pOldSrcBmp = NULL;
destDC.CreateCompatibleDC(pDC);
srcDC.CreateCompatibleDC(pDC);
bmpDest.DeleteObject();
bmpDest.CreateCompatibleBitmap(pDC, nWidth, nHeight);
pOldSrcBmp = srcDC.SelectObject(&bmpSrc);
pOldBmp = destDC.SelectObject(&bmpDest);
destDC.StretchBlt(0, 0, nWidth, nHeight, &srcDC, rectSection.left, rectSection.top,
rectSection.Width(), rectSection.Height(), SRCCOPY);
bmpDest.SetBitmapDimension(nWidth, nHeight);
destDC.SelectObject(pOldBmp);
srcDC.SelectObject(pOldSrcBmp);
}
-- modified at 1:38 Wednesday 5th October, 2005
|
|
|
|
|
Hi,
Can u suggest some links, related with info on packets sent by the yahoo messenger for its activities like OM, comference, File Transfer etc.
|
|
|
|
|
|
Hi,
I gone through this site, and is a nice one.But this site represent a packet sniffer tool.
I think I did not mention much in my query posted earlier.
what I needed is that after catching the packet, I want some info about the contents in those packet.As I am getting prob. in file transfer(for latest version 7) only, as some of field are not clear.
Can u suggest some more links.
Regs
-- modified at 1:34 Monday 3rd October, 2005
|
|
|
|
|
Hi
Can anybody help me. i am using ADO for the first time. i got examples on that. but they are using other than Oracle databse. i have to connect to Oracle using ADO and use stored procedures. I dont know how to use ConnectionString to connect to Oracle. Plz help me in this regard.
bye
|
|
|
|
|
snprani wrote:
I dont know how to use ConnectionString to connect to Oracle. Plz help me in this regard.
here is the list :-
http://www.codeproject.com/database/connectionstrings.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hi
i used <new> in my dll and when loasing it i encountered some problems.
am i able to allocate memory in a dll??
|
|
|
|
|
Can you briefly explain how you are allocating the memory in the dll?
-prakash
|
|
|
|
|
it in my dll
USHORT * myfunc()
{
USHORT *pt = new USHORT[length];
return pt;
}
and i want to return pt to the application which uses the dll.
its in my app
USHORT *xx = myfunc();
|
|
|
|
|
There is nothing wrong with the allocation. What problem are you experiencing?
John
|
|
|
|
|
Be sure that the memory allocated in the dll is freed by the dll and not by the application ! If you try to delete this pointer inside your application, it will crash.
|
|
|
|
|
Hi,
I am busting my brain trying to get my parent dialog to have topmost priority over a child dialog. I have a fullscreen child dialog that I want to sit behind the parent dlg but the parent is continuously behind it. I have used MSDN and tried SetWindowPos.... however, in MSDN library there are 7 parameters for this function.... When I use SetWindowPos, I only have 6?
My SetWindowPos();
BOOL SetWindowPos(const *CWnd pWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags);
MSDN SetWindowPos();
BOOL SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags);
Its starting to really confuse me.... if anyone can help, it would be greatly appreciated.
Thanks
Ashman
I'm normally not a praying man, but if you're up there, please save me Superman.
|
|
|
|
|
BOOL SetWindowPos(const *CWnd pWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags) is a methode of CWnd class, so when calling it, it positions the object that is an instance of that class.
::SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags) needs a parameter to identify the window to be positioned (hWnd )
SkyWalker
|
|
|
|
|
Mircea Puiu wrote:
SkyWalker
SkyWalker getting very Fast ....
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
SkyWalker
|
|
|
|
|
Ashman wrote:
BOOL SetWindowPos(const *CWnd pWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags);
this MFC based version of SetWindowPos.. here the Detail of current Window Handle is hidden from user ... oops concept ..
Ashman wrote:
BOOL SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags);
this api version of SetWindowPos function.. now to access this function in mfc based application you have to use '::' scope resolution operator...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi all..
I want to perform copy paste operations on the items of the tree Ctrl.Can any one provide me with the code.
|
|
|
|
|
|
Hi guys and girls. Short question. Does ANYBODY know how to add an item to a Windows standard context menu after subclassing it? I would like to do that with one of the context menus of the system but without tampering with the registry. It's something related to sending some commands to that menu after the WM_INITMENU message.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Axonn Echysttas wrote:
I would like to do that with one of the context menus of the system but without tampering with the registry.
How about InsertMenuItem() api
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Yeap, sounds like a great place to start. Thanks Alok, my old friend ::- D.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
I want to work on images in VC++. Is it possible to load bmp,jpg,png and tiff image types?
I have heard of IPicture class that uses OLELoadPicture() through which it is possible to load jpg and bmp, but I don't have any idea whether they work on pixel levels like returning and setting pixel values.
Can u help me out?
|
|
|
|
|
|
considering useing GDI+
-prakash
|
|
|
|
|
Hye
I am new to VC++ so I don't have much idea about GDI+. Using GDI+ would I be able to work on pixel values of images of different types.
Please help me out
|
|
|
|
|