|
To get an image associated with the cell use
LVITEM litem;
litem.mask = LVIF_IMAGE;
litem.iSubItem = 2;// the subitem number
litem.iItem = 2;// the item number
litem.iImage = -1;
GetItem( &litem );
after u have called the GetItem function, the litem.iImage member of the LVITEM will contain the image index.
This function will return the image number only if u have set the LVS_EX_SUBITEMIMAGES extended style....
nave
|
|
|
|
|
You have no leave today...!
- NS -
|
|
|
|
|
|
near home
- NS -
|
|
|
|
|
Hello,
I have this variable in the Doc class.
CTypedPtrList<coblist, cobjdata*=""> m_objectsList;
Suppose at present it has 5 entries.
I want to delete 3rd record. then how to achieve it?
I tried.
POSITION pos = m_objectsList.GetHeadPosition();
UINT cnt=0;
while(pos!=NULL)
{
CObjData *objFmList = m_objectsList.GetNext(pos);
cnt++;
if(cnt==3)
delete objFmList;
}
but then if next time I go to read this m_objectsList, program gives memory related error. How to do it safe way?
thanks
Leya
|
|
|
|
|
You forgot to remove the item from the list. So at the next time you are deleting the object, which is previously deleted.
- NS -
|
|
|
|
|
|
I have a C++ agent that accesses an HTTP proxy that requires NTLM authentication.
Is there a way I can format the NTLM Type 3 message NTLM/NTLMv2 response using the password the user entered to logon without asking the user to re-enter the password?
I do not want to know the actual password for security reasons and possible liability if the password gets compromised.
Is there such an API that I can use to format these fields by supplying the user and domain names?
I'm on-line therefore I am.
JimmyRopes
|
|
|
|
|
wrote: Is there such an API that I can use to format these fields by supplying the user and domain names?
Are you using AcquireCredentialsHandle() ? If so, you can set pvAuth to be NULL to specify default credentials.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thank you Ryan.
AcquireCredentialsHandle looks like exactly what I need.
I'm on-line therefore I am.
JimmyRopes
|
|
|
|
|
|
Thank you for the link
I'm on-line therefore I am.
JimmyRopes
|
|
|
|
|
Hello Ryan,
I have just gotten around to implementing the AcquireCredentialsHandle code and am running into something strange.
In the code I have
if(SEC_E_OK == EnumerateSecurityPackages(&nPackages,&pPackages)){
to see if the security package is installed on the system because this will be distributed to clients where I do not have control over the system configuration
and then to get the cerdentials
if(SEC_E_OK == AcquireCredentialsHandle(<br />
_T('\0'),
szPackageName,
SECPKG_CRED_OUTBOUND,
NULL,
NULL,
NULL,
NULL,
&shCredential,
&ts)){
I get a link errors
NTLMDlg.obj : error LNK2019: unresolved external symbol _AcquireCredentialsHandleW@36
NTLMDlg.obj : error LNK2019: unresolved external symbol _EnumerateSecurityPackagesW@8
When I hover the cursor over the function name I see a #define without the leading underscore.
Do you have any idea what is going on?
I'm on-line therefore I am.
JimmyRopes
|
|
|
|
|
Are you linking against secur32.lib ?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thank you Ryan.
My problem was caused because I did not specify secur32.lib as an additional dependency for the linker.
I'm on-line therefore I am.
JimmyRopes
|
|
|
|
|
I draw white border when mouse on button,i want to erase it when mouse leave
|
|
|
|
|
All painting should happen in a WM_PAINT handler. Call Invalidate() to force a paint message, and just capture the mouse and track it's movement to know when it leaves your control.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
It is better you go for ownerdrawn button...
You can track mouse enter like this...
bool m_bMouseInside = false;
void MyButton::OnMouseMove( UINT nFlags, CPoint point )
{
if( !m_bMouseInside )
{
m_bMouseInside = true;
TRACKMOUSEEVENT stTME = { 0 };
stTME.cbSize = sizeof( stTME );
stTME.dwFlags = TME_LEAVE;
stTME.hwndTrack = m_hWnd;
_TrackMouseEvent( &stTME );
Invalidate( FALSE );
}
CButton::OnMouseMove( nFlags, point );
}
<pre>
Then you will get a mouse leave message. You have to map it like...
<pre>
BEGIN_MESSAGE_MAP(LinkButton, CButton)
ON_MESSAGE( WM_MOUSELEAVE, OnMouseLeave )
END_MESSAGE_MAP()
LRESULT LinkButton::OnMouseLeave( WPARAM, LPARAM )
{
m_bMouseInside = false;
Invalidate( FALSE );
return 0;
}
So your DrawItem will be called when the mouse enters and leaves the button. You should check the m_bMouseInside flag to draw the border.
Good Luck!
- NS -
|
|
|
|
|
Obviously you know when the mouse cursor is within your buttons boundaries. In that function use can capture the mouse, which will send you a message telling you when it has left the button window (a button is just another window). At which point you can reset things to normal and release the mouse cursor.
INTP
“Testing can show the presence of errors, but not their absence.”
Edsger Dijkstra
|
|
|
|
|
if you derived CButton and use WM_DRAWITEM you can declare this case
for constant focus or select and else focus for buttons.
|
|
|
|
|
I want to get thread I have post.
-- modified at 22:44 Friday 21st April, 2006
|
|
|
|
|
go to following link
http://codeproject.com/script/profile/whos_who.asp[^]
type your name in filter by name and select order by "message count". and click Refresh
Now click on Messages posted
Click on your desired message.
Good luck.
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
what characteristics do they have?
Thanks
XKF
|
|
|
|
|
Hey all
I was playing with the CreateWindowEx function, and for the life of me, I can't figure out how to create a completely nude window... meaning nothing is showing but the body of the window (no titlebar, no border, no nothing!)... I was wondering if anyone knew how to do this.
Secondly, I'd like to know how you can do this once you've already called CreateWindowEx, and then after the fact, you want to strip it nude .
|
|
|
|
|
A window without the WM_BORDER OR WM_CAPTION should be a nude window,I suppose
You can use SetWindowLong to modify the styles of a window anytime after you create the window
I am the first one to answer this question.In China,this is called sofa.What is it called in English?
XKF
|
|
|
|