Click here to Skip to main content
15,889,462 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Threads Pin
Prakash Nadar28-Mar-04 23:06
Prakash Nadar28-Mar-04 23:06 
GeneralRe: Threads Pin
Tim Smith29-Mar-04 4:14
Tim Smith29-Mar-04 4:14 
GeneralRe: Threads Pin
Prakash Nadar29-Mar-04 5:44
Prakash Nadar29-Mar-04 5:44 
GeneralRe: Threads Pin
Tim Smith29-Mar-04 4:13
Tim Smith29-Mar-04 4:13 
GeneralRe: Threads Pin
SatyaDY29-Mar-04 17:20
SatyaDY29-Mar-04 17:20 
GeneralCreating shortcuts Pin
Vini Deep28-Mar-04 19:00
Vini Deep28-Mar-04 19:00 
GeneralRe: Creating shortcuts Pin
22491728-Mar-04 19:19
22491728-Mar-04 19:19 
GeneralRe: Creating shortcuts Pin
Milton Karimbekallil28-Mar-04 19:58
Milton Karimbekallil28-Mar-04 19:58 
hi,

you can use the following code to create a shortcut instead of copying an existing one. below code will create a shortcut for notepad in c:\ . Change the path accordingly.

	CString strFile("notepad.exe");<br />
    IShellLink* pLink;<br />
    IPersistFile* pPersistFile;<br />
<br />
<br />
    if(FAILED(CoInitialize(NULL))) throw CString("Failed to initialize COM Library.");<br />
<br />
    if(FAILED(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **) &pLink)))<br />
		throw CString("Failed to initialize COM Library.");<br />
<br />
    pLink->SetPath((LPCTSTR)strFile);<br />
    pLink->SetDescription("Notepad fooooooooooo");<br />
    pLink->SetShowCmd(SW_SHOW);<br />
    if(FAILED(pLink->QueryInterface(IID_IPersistFile, (void **)&pPersistFile))) <br />
		throw CString("Failed to query IID_IPersistFile.");<br />
	CString str("c:\\notepad.lnk");<br />
	CComBSTR path;<br />
	path = str.AllocSysString(); <br />
    pPersistFile->Save(path, true);<br />
    pPersistFile->Release();<br />
	pLink->Release();<br />
<br />
	CoUninitialize();


rgds... mil10.
GeneralRe: Creating shortcuts Pin
Vini Deep28-Mar-04 20:37
Vini Deep28-Mar-04 20:37 
QuestionRe[2]: Creating shortcuts Pin
sysop@HAL9K.com4-Feb-10 4:55
sysop@HAL9K.com4-Feb-10 4:55 
GeneralPrinting question Pin
Peter Mares28-Mar-04 18:26
Peter Mares28-Mar-04 18:26 
GeneralRe: Printing question Pin
Steve S29-Mar-04 0:34
Steve S29-Mar-04 0:34 
QuestionHow to draw a filled triangle Pin
vamsy krishna28-Mar-04 16:15
vamsy krishna28-Mar-04 16:15 
AnswerRe: How to draw a filled triangle Pin
Christian Graus28-Mar-04 16:27
protectorChristian Graus28-Mar-04 16:27 
GeneralRe: How to draw a filled triangle Pin
vamsy krishna28-Mar-04 16:49
vamsy krishna28-Mar-04 16:49 
GeneralRe: How to draw a filled triangle Pin
Christian Graus28-Mar-04 16:52
protectorChristian Graus28-Mar-04 16:52 
GeneralRe: How to draw a filled triangle Pin
Rick York28-Mar-04 20:06
mveRick York28-Mar-04 20:06 
GeneralRe: How to draw a filled triangle Pin
Steve S29-Mar-04 0:36
Steve S29-Mar-04 0:36 
GeneralRe: How to draw a filled triangle Pin
Antony M Kancidrowski29-Mar-04 2:26
Antony M Kancidrowski29-Mar-04 2:26 
GeneralRe: How to draw a filled triangle Pin
Christian Graus29-Mar-04 9:55
protectorChristian Graus29-Mar-04 9:55 
Generalending strings Pin
kfaday28-Mar-04 15:39
kfaday28-Mar-04 15:39 
GeneralRe: ending strings Pin
Christian Graus28-Mar-04 16:28
protectorChristian Graus28-Mar-04 16:28 
GeneralRecursion in Visual C++ Pin
Iceberg7628-Mar-04 15:34
Iceberg7628-Mar-04 15:34 
GeneralRe: Recursion in Visual C++ Pin
kfaday28-Mar-04 15:45
kfaday28-Mar-04 15:45 
GeneralRe: Recursion in Visual C++ Pin
Steve S29-Mar-04 0:38
Steve S29-Mar-04 0:38 

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.