|
hi,
i am using visual studio 2003, coding in c++. i would like to be able to select a function and find out which functions call the selected one, and then which functions call these, and so on.. is there any way to do this in VS, or does anyone know of an add-in that does this? thanks a lot =)
jay
|
|
|
|
|
see this[^] thread.
I am currently testing the DevPartner Profiler Community Edition
and am impressed by it so far.
I Dream of Absolute Zero
|
|
|
|
|
thanks a lot! that was one of the programs i was looking at, but i didn't realize there was a free version.
|
|
|
|
|
I wrote a simple DLL to smoothly stretch a supplied GDI HBITMAP using the GDI+ bilinear stretch algorithm. ( since GDI stretchblit with halftone is not good enough ) The Dll stretch function uses the drawimage command to write the stretched image directly to the device context of a window in another process. This works fine but it seems the drawimage command sends WM_NCPAINT and WM_ERASEBKGND messages to that window which causes flickering!!!
I could stretch to a memory device context and then bitblit the contents of the memory device context to the window, but the extra bitblt causes an unacceptable increase in CPU processing power.
Another solution would require injecting code into the other process to be able to subclass the window handler but this seems complex and may make the application susceptable to crashes.
Is there a simpler solution??? Any ideas or c++ source code of an image stretch routine with the same quality and speed of the gdiplus bilinear stretch?
VSKSTRETCH_API int WINAPI fnGdiPlusStretch(HBITMAP hBitmap,HDC hDest,int iXpos,int iYpos,int iWidth,int iHeight)
{
Bitmap* pBitMap = NULL;
CPalette Palette;
// +------------+
// | Gdi+ stuff |
// +------------+
HPALETTE hPalette = (HPALETTE)GetCurrentObject( hDest, OBJ_PAL) ;
//Palette.CreateHalftonePalette(hDest);
pBitMap = Bitmap::FromHBITMAP(hBitmap, (HPALETTE)Palette);
Graphics graphics(hDest); // Create Graphics object
graphics.SetInterpolationMode(InterpolationModeBilinear);
graphics.DrawImage(pBitMap,iXpos,iYpos,iWidth,iHeight);
delete pBitMap;
pBitMap = NULL;
return 0;
}
|
|
|
|
|
Okay, I have a question for you...
The MSDN states about the WNDCLASS.cbWndExtra the following:
"Specifies the number of extra bytes to allocate following the window instance. The system initializes the bytes to zero. If an application uses WNDCLASS to register a dialog box created by using the CLASS directive in the resource file, it must set this member to DLGWINDOWEXTRA."
So for example... If I want to store a pointer to some internal structure I need to store associated with a HWND, I can set this cbWndExtra member to sizeof(MyInternalStruct) with RegisterClass... But how can this extra memory be accessed as the HWND is declared as VOID* in windows.h?
|
|
|
|
|
See MSDN on GetClassLongPtr using GCL_CBCLSEXTRA then:
nIndex
[in] Specifies the value to retrieve. To retrieve a value from the extra class memory, specify the positive, zero-based byte offset of the value to be retrieved. Valid values are in the range zero through the number of bytes of extra class memory, minus eight; for example, if you specified 24 or more bytes of extra class memory, a value of 16 would be an index to the third integer.
|
|
|
|
|
Oh yeah, make sure your data structure is pragma packed to be on the boundary size of an integer, since the GetClassLongPtr only returns integers.
|
|
|
|
|
hello,
i use the ATl write a word2000 addin,and add a button into the word toolbars,and now i want to add a picture into the word document when i hit the button,this picture can be a bmp or jpeg.after i insert the picture i can drag it to a proper location.
i tried a long time,but in vain,who can help me?
|
|
|
|
|
Plz tell how to declare and use dynamic arrays in VC.
give example..
thanks
|
|
|
|
|
Raza5680 wrote:
Plz tell how to declare and use dynamic arrays in VC.
Rather then creating your own, Use plenty of Collection classes offered in MFC or STL.
Here are some link that will give more info regarding it:-
http://www.codeproject.com/vcpp/stl/
"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
|
|
|
|
|
Creating your own would be done this way:
int* prgYourArray = new int[YourSize];
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Raza5680 wrote:
Plz tell how to declare and use dynamic arrays in VC.
A classic[^]
|
|
|
|
|
My program has to get the message from Windows, if user writes to hard disk. How program can to get message from Windows, if user wants to write on hard disk?
|
|
|
|
|
Take a look at this link about directory management functions:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/directory_management_functions.asp
|
|
|
|
|
Hi: How can I change CPropertyPage's caption at runtime?
|
|
|
|
|
Try m_YourPropertyPage.SetWindowText("NewName");
Regards,
Eli
|
|
|
|
|
I have tried!But the text doesn't appears at the caption bar!
|
|
|
|
|
Use SetItem[^]
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
What about setting the wizard style properpage's caption?
|
|
|
|
|
ModifyStyleEx[^]
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
How to ignore the style of colspan of tablecells,using the interface of IHTMLTableCell?Does it need any custom namespace? Thank you very much!
|
|
|
|
|
Push up the problem for help by myself,thx a lot^_^
|
|
|
|
|
Greetings.
I have the problem that my OnPrint-methode don't print my Bitmap. It's shown in the printpreview, but not printed. I didn't see the fault, cause it goes well. Without changing anything now it isn't printing the picture.....
Thx for help
Puppet
_____________________________________________________________________________-
Here the source:
void COutput2::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
int nSavedDC = pDC->SaveDC();
// Fussnoten setzen
CFont* pOldFont = pDC->SelectObject(&m_fontSet);
pDC->SetTextAlign(TA_LEFT|TA_BASELINE);
pDC->TextOut(HORZ_MARGIN,VERT_MARGIN,srkChange.strStatus);
// Tree initialisieren
CTreeCtrl& Tree = m_TreeWnd.GetTreeCtrl();
HTREEITEM hItem=Tree.GetRootItem();
int maxItemCnt = (prntY-VERT_MARGIN*2)/m_nRowHeight-2;
// Position im Tree ermitteln
for(int pos=0; pos<maxitemcnt*(pinfo->m_nCurPage-1); pos++)
{
Tree.Expand(hItem,TVE_EXPAND);
hItem = Tree.GetNextItem(hItem,TVGN_NEXTVISIBLE);
}
// Bildquelle übergeben
bm.LoadBitmap(IDB_TREE_ICON);
BITMAP bmpInfo;
bm.GetBitmap(&bmpInfo);
// Speicher anlegen und alten sichern
CDC SpeicherDC;
SpeicherDC.CreateCompatibleDC(pDC);
CBitmap * oldbm = SpeicherDC.SelectObject(&bm);
int ItemCnt=0;
do
{
ItemCnt++;
// Position ermitteln
int x = HORZ_MARGIN+CalculateRootCnt(hItem)*20;
int y = VERT_MARGIN+m_nRowHeight*(ItemCnt+1);
// Bild ermitteln
int nImage, nSelectedImage;
Tree.GetItemImage(hItem,nImage,nSelectedImage);
// Bild transparent machen (rosa->weiss)
for(int picx=0;picx<bmpinfo.bmwidth;picx++)
for(int="" picy="0;picy<bmpInfo.bmHeight;picy++)
" if(speicherdc.getpixel(picx,picy)="=RGB(255,0,255))
" speicherdc.setpixel(picx,picy,rgb(255,255,255));=""
="" bild="" an="" dc="" übergeben
="" pdc-="">BitBlt(x,y,bmpInfo.bmWidth/4,bmpInfo.bmHeight,
&SpeicherDC,bmpInfo.bmWidth/4*nImage,0,SRCCOPY);
// Tree-Text verarbeiten
CString text = Tree.GetItemText(hItem);
char tmp[256];
strcpy(tmp,text);
text = strtok( tmp, "\t" );
pDC->TextOut(x+25,y+BIAS,text);
text = strtok( NULL, "\t" );
pDC->TextOut(x+25+300,y+BIAS,text);
// Tree "aufklappen", nächstes Item
Tree.Expand(hItem,TVE_EXPAND);
hItem = Tree.GetNextItem(hItem,TVGN_NEXTVISIBLE);
}
while(hItem && ItemCnt<maxitemcnt);
fusszeile="" -=""> Seitenanzahl
CString nPage;
nPage.Format(" %d",pInfo->m_nCurPage);
nPage = UINTtoCString(IDS_OUT_PAGE) + nPage;
pDC->TextOut(prntX/2-nPage.GetLength(),prntY-20,nPage);
// alte Objekte zurücksetzen
pDC->SelectObject(pOldFont);
//pDC->SelectObject(oldbm);
pDC->RestoreDC(nSavedDC);
}
//OnPrint///////////////////////////////////////////////////////////////////
|
|
|
|
|
|
I wrote a Web Browsing Program,there are several problems I can not solve,so please help,thanks a lot
Here is my program's picture(sorry that the language is in Chinese,but it has nothing to do with my questions)
http://pic.lyglyg.com/yourpic/2005/08/05/c4db079c35bdd1843a4ad893a4016ab8.jpg[^]First ,what the black arrow points is a CComboxBox Control which is located on my CToolbar,My problem is how can I set my url address directly into the edit control of the Combobox control,It seems to me that I can only do this through 2 ways,first add the url into the listbox of combobox and select it so the url will appear in edit box ,or use clipboard to first copy url to clipboard and use combobox's paste function to add it to edit box(without add it to list box),but can I do it directly
Second,can I achieve this like type in address in the edit box and press ENTER,then Show the page.It seems to me that the combobox didn't respond the Enter in edit box.Is there some ways to do that
Third:the red arrow pointed is CHtmlView Class,it handles page showing well,but how can I deal with this : when I clicked an address,it will pop up a new window,what I want to do is show the address of the new window just in the origin window,Is that possible
|
|
|
|
|