Click here to Skip to main content
16,008,075 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: fstream + vector Pin
Programm3r17-Oct-06 20:34
Programm3r17-Oct-06 20:34 
GeneralRe: fstream + vector Pin
Link200617-Oct-06 21:08
Link200617-Oct-06 21:08 
JokeRe: fstream + vector Pin
Programm3r17-Oct-06 21:12
Programm3r17-Oct-06 21:12 
GeneralRe: fstream + vector Pin
Christian Graus17-Oct-06 21:55
protectorChristian Graus17-Oct-06 21:55 
QuestionHow to create Internet shortcut link? Pin
kiranin17-Oct-06 18:04
kiranin17-Oct-06 18:04 
QuestionRe: How to create Internet shortcut link? Pin
prasad_som17-Oct-06 19:19
prasad_som17-Oct-06 19:19 
AnswerRe: How to create Internet shortcut link? Pin
kiranin17-Oct-06 19:27
kiranin17-Oct-06 19:27 
AnswerRe: How to create Internet shortcut link? Pin
prasad_som17-Oct-06 19:51
prasad_som17-Oct-06 19:51 
I got this code from MSDN,
#include <windows.h>
#include <shlobj.h>
#include <intshcut.h>

/**************************************************************************

   CreateInternetShortcut()

   pszShortcut - Path and file name of the Internet shortcut file. This 
   must have the URL extension for the shortcut to be used correctly.

   pszURL - URL to be stored in the Internet shortcut file.
   
**************************************************************************/ 

HRESULT CreateInternetShortcut(LPTSTR pszShortcut, LPTSTR pszURL)
{
IUniformResourceLocator *purl;
HRESULT                 hr; 

hr = CoInitialize(NULL);

if(SUCCEEDED(hr)) 
   { 
   //Get a pointer to the IShellLink interface. 
   hr = CoCreateInstance(  CLSID_InternetShortcut, 
                           NULL, 
                           CLSCTX_INPROC_SERVER, 
                           IID_IUniformResourceLocator, 
                           (LPVOID*)&purl); 
   
   if(SUCCEEDED(hr)) 
      { 
      IPersistFile* ppf;

      hr = purl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf);

      if(SUCCEEDED(hr)) 
         {
         hr = purl->SetURL(pszURL, 0);

         if(SUCCEEDED(hr))
            {
            WCHAR wszShortcut[MAX_PATH];

#ifdef UNICODE
            lstrcpyn(wszShortcut, pszShortcut, MAX_PATH);
#else
            MultiByteToWideChar( CP_ACP, 
                                 0, 
                                 pszShortcut, 
                                 -1, 
                                 wszShortcut, 
                                 MAX_PATH); 
#endif

            hr = ppf->Save(wszShortcut, FALSE);
            }
           
         ppf->Release(); 
         }
       
       purl->Release(); 
       }

   CoUninitialize();
   }

return hr;
}





GeneralRe: How to create Internet shortcut link? Pin
kiranin17-Oct-06 20:10
kiranin17-Oct-06 20:10 
QuestionRe: How to create Internet shortcut link? Pin
prasad_som17-Oct-06 20:21
prasad_som17-Oct-06 20:21 
AnswerRe: How to create Internet shortcut link? Pin
kiranin17-Oct-06 20:23
kiranin17-Oct-06 20:23 
GeneralRe: How to create Internet shortcut link? Pin
prasad_som17-Oct-06 20:31
prasad_som17-Oct-06 20:31 
GeneralRe: How to create Internet shortcut link? Pin
kiranin17-Oct-06 20:33
kiranin17-Oct-06 20:33 
GeneralRe: How to create Internet shortcut link? Pin
prasad_som17-Oct-06 20:42
prasad_som17-Oct-06 20:42 
QuestionRe: How to create Internet shortcut link? Pin
kiranin17-Oct-06 21:51
kiranin17-Oct-06 21:51 
GeneralRe: How to create Internet shortcut link? Pin
Hamid_RT18-Oct-06 8:56
Hamid_RT18-Oct-06 8:56 
Questionhow to add ATl new object Pin
With_problem17-Oct-06 16:36
With_problem17-Oct-06 16:36 
AnswerRe: how to add ATl new object Pin
prasad_som17-Oct-06 19:33
prasad_som17-Oct-06 19:33 
QuestionWhat is the right language for these interfaces development? Pin
David L.S.17-Oct-06 16:36
David L.S.17-Oct-06 16:36 
AnswerRe: What is the right language for these interfaces development? Pin
Mark Salsbery17-Oct-06 17:03
Mark Salsbery17-Oct-06 17:03 
GeneralRe: What is the right language for these interfaces development? Pin
David L.S.17-Oct-06 17:15
David L.S.17-Oct-06 17:15 
GeneralRe: What is the right language for these interfaces development? Pin
Mark Salsbery17-Oct-06 17:42
Mark Salsbery17-Oct-06 17:42 
GeneralRe: What is the right language for these interfaces development? Pin
David L.S.17-Oct-06 17:58
David L.S.17-Oct-06 17:58 
QuestionHyperlink control Pin
jamni17-Oct-06 16:18
jamni17-Oct-06 16:18 
AnswerRe: Hyperlink control Pin
Mark Salsbery17-Oct-06 17:13
Mark Salsbery17-Oct-06 17:13 

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.