Click here to Skip to main content
15,899,314 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: SetWindowContextHelpId always fails, Pin
led mike7-Mar-08 4:17
led mike7-Mar-08 4:17 
Questionhow to wait for a file to be free? Pin
VCsamir7-Mar-08 2:33
VCsamir7-Mar-08 2:33 
AnswerRe: how to wait for a file to be free? Pin
CPallini7-Mar-08 2:34
mveCPallini7-Mar-08 2:34 
GeneralRe: how to wait for a file to be free? Pin
Hamid_RT9-Mar-08 0:58
Hamid_RT9-Mar-08 0:58 
AnswerRe: how to wait for a file to be free? Pin
Chris Meech7-Mar-08 3:01
Chris Meech7-Mar-08 3:01 
AnswerRe: how to wait for a file to be free? Pin
Hamid_RT9-Mar-08 0:57
Hamid_RT9-Mar-08 0:57 
GeneralLink file path from target path Pin
john56327-Mar-08 2:32
john56327-Mar-08 2:32 
GeneralRe: Link file path from target path Pin
Chris Losinger7-Mar-08 4:20
professionalChris Losinger7-Mar-08 4:20 
CString CDropEdit::ExpandShortcut(CString &inFile)
{
    CString outFile;

    // Make sure we have a path
    ASSERT(inFile != _T(""));

    IShellLink* psl;
    HRESULT hres;
    LPTSTR lpsz = inFile.GetBuffer(MAX_PATH);

    // Create instance for shell link
    hres = ::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*) &psl);

    if (SUCCEEDED(hres))
    {
        // Get a pointer to the persist file interface
        IPersistFile* ppf;

        hres = psl->QueryInterface(IID_IPersistFile, (LPVOID*) &ppf);
        if (SUCCEEDED(hres))
        {
            // Make sure it's ANSI
            WORD wsz[MAX_PATH];
            ::MultiByteToWideChar(CP_ACP, 0, lpsz, -1, wsz, MAX_PATH);

            // Load shortcut
            hres = ppf->Load(wsz, STGM_READ);

            if (SUCCEEDED(hres)) 
			{
				WIN32_FIND_DATA wfd;

				// find the path from that
				HRESULT hres = psl->GetPath(outFile.GetBuffer(MAX_PATH), 
								MAX_PATH,
								&wfd, 
								SLGP_UNCPRIORITY);

				outFile.ReleaseBuffer();
            }

            ppf->Release();
        }

        psl->Release();
    }

	inFile.ReleaseBuffer();

	// if this fails, outFile == ""
    return outFile;
}


from CDropEdit[^]


GeneralRe: Link file path from target path Pin
john56327-Mar-08 5:45
john56327-Mar-08 5:45 
GeneralRe: Link file path from target path Pin
Chris Losinger7-Mar-08 6:03
professionalChris Losinger7-Mar-08 6:03 
GeneralRe: Link file path from target path Pin
john56327-Mar-08 6:10
john56327-Mar-08 6:10 
GeneralRe: Link file path from target path Pin
Chris Losinger7-Mar-08 6:27
professionalChris Losinger7-Mar-08 6:27 
GeneralRe: Link file path from target path Pin
Maxwell Chen7-Mar-08 6:32
Maxwell Chen7-Mar-08 6:32 
GeneralRe: Link file path from target path Pin
Chris Losinger7-Mar-08 6:47
professionalChris Losinger7-Mar-08 6:47 
Generalconverting code from vc6 to vc2005 Pin
neha.agarwal277-Mar-08 1:21
neha.agarwal277-Mar-08 1:21 
GeneralRe: converting code from vc6 to vc2005 Pin
Cedric Moonen7-Mar-08 1:29
Cedric Moonen7-Mar-08 1:29 
GeneralRe: converting code from vc6 to vc2005 Pin
CPallini7-Mar-08 2:12
mveCPallini7-Mar-08 2:12 
GeneralRe: converting code from vc6 to vc2005 Pin
toxcct7-Mar-08 2:26
toxcct7-Mar-08 2:26 
GeneralNope. Pin
CPallini7-Mar-08 2:33
mveCPallini7-Mar-08 2:33 
GeneralRe: converting code from vc6 to vc2005 Pin
neha.agarwal277-Mar-08 18:16
neha.agarwal277-Mar-08 18:16 
GeneralRe: converting code from vc6 to vc2005 Pin
CPallini8-Mar-08 0:47
mveCPallini8-Mar-08 0:47 
Questionanyone can help me to explain code below? Pin
gentleguy7-Mar-08 0:41
gentleguy7-Mar-08 0:41 
AnswerRe: anyone can help me to explain code below? Pin
toxcct7-Mar-08 0:47
toxcct7-Mar-08 0:47 
GeneralRe: anyone can help me to explain code below? Pin
Cedric Moonen7-Mar-08 0:50
Cedric Moonen7-Mar-08 0:50 
GeneralRe: anyone can help me to explain code below? Pin
toxcct7-Mar-08 0:53
toxcct7-Mar-08 0:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.