The Infomercial King Challenge
-
I develop on Windows 98 using Visual Studio 6 I noticed that the code below will NOT create a link on Windows 2000. Since I do NOT have Windows 2000 I can't debug this code so i am wondering if anyone has a solution to how to get the code below to create a lInk on windows 2000? Where UINT uLinkLoc = CSIDL_DESKTOP; Is there a way to write a SINGLE class that can create a link on the Desktop in both Windows 98 and Windows 2000 without compiling 2 separate versions(one UNICODE and one ASCII)??? bool CInstall::CreateShortCut( LPCSTR lpszSourceFile, LPCSTR lpszSourceDir, UINT uLinkLoc, LPCSTR lpszDesc, bool IsFolder ) { HRESULT hResult = NULL; IShellLink* pShellLink = NULL; bool rc = false; LPCSTR lpszDestination = NULL; ITEMIDLIST *id = NULL; TCHAR szLinkLoc[MAX_PATH] = ""; TCHAR szShellPath[MAX_PATH] = ""; CString sLinkLoc; sLinkLoc.Empty(); CString sLink; sLink.Empty(); // Initialize IShellLink interface hResult = CoInitialize(NULL); // Get pointer to IShellLink Interface hResult = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void**) &pShellLink); if (SUCCEEDED(hResult)) { //Cache, Fonts, History, NetHood, Personal, Printhood, Programs, // Recent, SendTo, Start Menu, Startup, Templates, ShellNew if (uLinkLoc == CSIDL_APPDATA) { sLinkLoc = "AppData"; } else if (uLinkLoc == CSIDL_COOKIES) { sLinkLoc = "Cookies"; } else if (uLinkLoc == CSIDL_DESKTOP) { sLinkLoc = "Desktop"; } else if (uLinkLoc == CSIDL_STARTMENU) { sLinkLoc = "Start Menu"; } else if (uLinkLoc == CSIDL_STARTUP) { sLinkLoc = "Startup"; } else if (uLinkLoc == CSIDL_FAVORITES) { sLinkLoc = "Favorites"; } if (sLinkLoc.GetLength()>0) { GetShellFolderPath(sLinkLoc, szShellPath); sLink = szShellPath; } else { SHGetSpecialFolderLocation(NULL, uLinkLoc, &id); SHGetPathFromIDList(id, szLinkLoc); sLink = szLinkLoc; } sLink += "\\"; sLink += lpszDesc; sLink += ".lnk"; lpszDestination = (LPCSTR)sLink; if (IsFolder) { // Requies: #Include hResult = _mkdir(lpszDestination); // Clean up pShellLink->Release(); CoUninitialize(); if (SUCCEEDED(hResult)) { return true; } else { return false; } } IPersistFile* ppf = NULL; // Set path to shortcut target pShellLink->SetPath(lpszSourceFile); // Add Start Directory if(lpszSourceDir)
-
I develop on Windows 98 using Visual Studio 6 I noticed that the code below will NOT create a link on Windows 2000. Since I do NOT have Windows 2000 I can't debug this code so i am wondering if anyone has a solution to how to get the code below to create a lInk on windows 2000? Where UINT uLinkLoc = CSIDL_DESKTOP; Is there a way to write a SINGLE class that can create a link on the Desktop in both Windows 98 and Windows 2000 without compiling 2 separate versions(one UNICODE and one ASCII)??? bool CInstall::CreateShortCut( LPCSTR lpszSourceFile, LPCSTR lpszSourceDir, UINT uLinkLoc, LPCSTR lpszDesc, bool IsFolder ) { HRESULT hResult = NULL; IShellLink* pShellLink = NULL; bool rc = false; LPCSTR lpszDestination = NULL; ITEMIDLIST *id = NULL; TCHAR szLinkLoc[MAX_PATH] = ""; TCHAR szShellPath[MAX_PATH] = ""; CString sLinkLoc; sLinkLoc.Empty(); CString sLink; sLink.Empty(); // Initialize IShellLink interface hResult = CoInitialize(NULL); // Get pointer to IShellLink Interface hResult = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void**) &pShellLink); if (SUCCEEDED(hResult)) { //Cache, Fonts, History, NetHood, Personal, Printhood, Programs, // Recent, SendTo, Start Menu, Startup, Templates, ShellNew if (uLinkLoc == CSIDL_APPDATA) { sLinkLoc = "AppData"; } else if (uLinkLoc == CSIDL_COOKIES) { sLinkLoc = "Cookies"; } else if (uLinkLoc == CSIDL_DESKTOP) { sLinkLoc = "Desktop"; } else if (uLinkLoc == CSIDL_STARTMENU) { sLinkLoc = "Start Menu"; } else if (uLinkLoc == CSIDL_STARTUP) { sLinkLoc = "Startup"; } else if (uLinkLoc == CSIDL_FAVORITES) { sLinkLoc = "Favorites"; } if (sLinkLoc.GetLength()>0) { GetShellFolderPath(sLinkLoc, szShellPath); sLink = szShellPath; } else { SHGetSpecialFolderLocation(NULL, uLinkLoc, &id); SHGetPathFromIDList(id, szLinkLoc); sLink = szLinkLoc; } sLink += "\\"; sLink += lpszDesc; sLink += ".lnk"; lpszDestination = (LPCSTR)sLink; if (IsFolder) { // Requies: #Include hResult = _mkdir(lpszDestination); // Clean up pShellLink->Release(); CoUninitialize(); if (SUCCEEDED(hResult)) { return true; } else { return false; } } IPersistFile* ppf = NULL; // Set path to shortcut target pShellLink->SetPath(lpszSourceFile); // Add Start Directory if(lpszSourceDir)
The include file ARE: #include "direct.h" #include "objbase.h" #include "shlguid.h" #include "wchar.h" tHIS SHOULD BE THE only INCLUDE FILES YOU NEED. "DIRECT.H" IS NEEDED for making directories in teh shell. the code works fine on windows 95, 98 and Windows XP. But it FAILS on windows 2000. Bill SerGio, The Infomercial King
-
I develop on Windows 98 using Visual Studio 6 I noticed that the code below will NOT create a link on Windows 2000. Since I do NOT have Windows 2000 I can't debug this code so i am wondering if anyone has a solution to how to get the code below to create a lInk on windows 2000? Where UINT uLinkLoc = CSIDL_DESKTOP; Is there a way to write a SINGLE class that can create a link on the Desktop in both Windows 98 and Windows 2000 without compiling 2 separate versions(one UNICODE and one ASCII)??? bool CInstall::CreateShortCut( LPCSTR lpszSourceFile, LPCSTR lpszSourceDir, UINT uLinkLoc, LPCSTR lpszDesc, bool IsFolder ) { HRESULT hResult = NULL; IShellLink* pShellLink = NULL; bool rc = false; LPCSTR lpszDestination = NULL; ITEMIDLIST *id = NULL; TCHAR szLinkLoc[MAX_PATH] = ""; TCHAR szShellPath[MAX_PATH] = ""; CString sLinkLoc; sLinkLoc.Empty(); CString sLink; sLink.Empty(); // Initialize IShellLink interface hResult = CoInitialize(NULL); // Get pointer to IShellLink Interface hResult = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void**) &pShellLink); if (SUCCEEDED(hResult)) { //Cache, Fonts, History, NetHood, Personal, Printhood, Programs, // Recent, SendTo, Start Menu, Startup, Templates, ShellNew if (uLinkLoc == CSIDL_APPDATA) { sLinkLoc = "AppData"; } else if (uLinkLoc == CSIDL_COOKIES) { sLinkLoc = "Cookies"; } else if (uLinkLoc == CSIDL_DESKTOP) { sLinkLoc = "Desktop"; } else if (uLinkLoc == CSIDL_STARTMENU) { sLinkLoc = "Start Menu"; } else if (uLinkLoc == CSIDL_STARTUP) { sLinkLoc = "Startup"; } else if (uLinkLoc == CSIDL_FAVORITES) { sLinkLoc = "Favorites"; } if (sLinkLoc.GetLength()>0) { GetShellFolderPath(sLinkLoc, szShellPath); sLink = szShellPath; } else { SHGetSpecialFolderLocation(NULL, uLinkLoc, &id); SHGetPathFromIDList(id, szLinkLoc); sLink = szLinkLoc; } sLink += "\\"; sLink += lpszDesc; sLink += ".lnk"; lpszDestination = (LPCSTR)sLink; if (IsFolder) { // Requies: #Include hResult = _mkdir(lpszDestination); // Clean up pShellLink->Release(); CoUninitialize(); if (SUCCEEDED(hResult)) { return true; } else { return false; } } IPersistFile* ppf = NULL; // Set path to shortcut target pShellLink->SetPath(lpszSourceFile); // Add Start Directory if(lpszSourceDir)
You shoudl probably put this in the Collaboration/Testing forum or the VC++ one. You'll get a better response ion there ;-)
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks] "It's The Soapbox; topics are optional" Shog 9
-
You shoudl probably put this in the Collaboration/Testing forum or the VC++ one. You'll get a better response ion there ;-)
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks] "It's The Soapbox; topics are optional" Shog 9
When I posted this I was NOT aware of the other sections and you are right in that i should have placed it in a more appropriate place but I have never wasted time worrying about such insignificant things. Keep your eye upon the donut and NOT upon the hole. Bill SerGio, The Infomercial King
-
When I posted this I was NOT aware of the other sections and you are right in that i should have placed it in a more appropriate place but I have never wasted time worrying about such insignificant things. Keep your eye upon the donut and NOT upon the hole. Bill SerGio, The Infomercial King
Bill SerGio wrote: I have never wasted time worrying about such insignificant things. Accepted rules of conduct (including a BIG RED warning saying not to post PROGRAMMING questions here) are "insignificant"? Wow, do you tell that to the judges too? --Mike-- Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer My really out-of-date homepage Sonork-100.19012 Acid_Helm
-
When I posted this I was NOT aware of the other sections and you are right in that i should have placed it in a more appropriate place but I have never wasted time worrying about such insignificant things. Keep your eye upon the donut and NOT upon the hole. Bill SerGio, The Infomercial King
Bill SerGio wrote: Keep your eye upon the donut and NOT upon the hole. I would, but I don't like dohnuts ;-)
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks] "It's The Soapbox; topics are optional" Shog 9
-
I develop on Windows 98 using Visual Studio 6 I noticed that the code below will NOT create a link on Windows 2000. Since I do NOT have Windows 2000 I can't debug this code so i am wondering if anyone has a solution to how to get the code below to create a lInk on windows 2000? Where UINT uLinkLoc = CSIDL_DESKTOP; Is there a way to write a SINGLE class that can create a link on the Desktop in both Windows 98 and Windows 2000 without compiling 2 separate versions(one UNICODE and one ASCII)??? bool CInstall::CreateShortCut( LPCSTR lpszSourceFile, LPCSTR lpszSourceDir, UINT uLinkLoc, LPCSTR lpszDesc, bool IsFolder ) { HRESULT hResult = NULL; IShellLink* pShellLink = NULL; bool rc = false; LPCSTR lpszDestination = NULL; ITEMIDLIST *id = NULL; TCHAR szLinkLoc[MAX_PATH] = ""; TCHAR szShellPath[MAX_PATH] = ""; CString sLinkLoc; sLinkLoc.Empty(); CString sLink; sLink.Empty(); // Initialize IShellLink interface hResult = CoInitialize(NULL); // Get pointer to IShellLink Interface hResult = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void**) &pShellLink); if (SUCCEEDED(hResult)) { //Cache, Fonts, History, NetHood, Personal, Printhood, Programs, // Recent, SendTo, Start Menu, Startup, Templates, ShellNew if (uLinkLoc == CSIDL_APPDATA) { sLinkLoc = "AppData"; } else if (uLinkLoc == CSIDL_COOKIES) { sLinkLoc = "Cookies"; } else if (uLinkLoc == CSIDL_DESKTOP) { sLinkLoc = "Desktop"; } else if (uLinkLoc == CSIDL_STARTMENU) { sLinkLoc = "Start Menu"; } else if (uLinkLoc == CSIDL_STARTUP) { sLinkLoc = "Startup"; } else if (uLinkLoc == CSIDL_FAVORITES) { sLinkLoc = "Favorites"; } if (sLinkLoc.GetLength()>0) { GetShellFolderPath(sLinkLoc, szShellPath); sLink = szShellPath; } else { SHGetSpecialFolderLocation(NULL, uLinkLoc, &id); SHGetPathFromIDList(id, szLinkLoc); sLink = szLinkLoc; } sLink += "\\"; sLink += lpszDesc; sLink += ".lnk"; lpszDestination = (LPCSTR)sLink; if (IsFolder) { // Requies: #Include hResult = _mkdir(lpszDestination); // Clean up pShellLink->Release(); CoUninitialize(); if (SUCCEEDED(hResult)) { return true; } else { return false; } } IPersistFile* ppf = NULL; // Set path to shortcut target pShellLink->SetPath(lpszSourceFile); // Add Start Directory if(lpszSourceDir)
You're missing an include:
#include <post_in_the_right_forum.h>
Eddie Velasquez: A Squeezed Devil
Checkout General Guidelines for C# Class Implementation -
I develop on Windows 98 using Visual Studio 6 I noticed that the code below will NOT create a link on Windows 2000. Since I do NOT have Windows 2000 I can't debug this code so i am wondering if anyone has a solution to how to get the code below to create a lInk on windows 2000? Where UINT uLinkLoc = CSIDL_DESKTOP; Is there a way to write a SINGLE class that can create a link on the Desktop in both Windows 98 and Windows 2000 without compiling 2 separate versions(one UNICODE and one ASCII)??? bool CInstall::CreateShortCut( LPCSTR lpszSourceFile, LPCSTR lpszSourceDir, UINT uLinkLoc, LPCSTR lpszDesc, bool IsFolder ) { HRESULT hResult = NULL; IShellLink* pShellLink = NULL; bool rc = false; LPCSTR lpszDestination = NULL; ITEMIDLIST *id = NULL; TCHAR szLinkLoc[MAX_PATH] = ""; TCHAR szShellPath[MAX_PATH] = ""; CString sLinkLoc; sLinkLoc.Empty(); CString sLink; sLink.Empty(); // Initialize IShellLink interface hResult = CoInitialize(NULL); // Get pointer to IShellLink Interface hResult = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void**) &pShellLink); if (SUCCEEDED(hResult)) { //Cache, Fonts, History, NetHood, Personal, Printhood, Programs, // Recent, SendTo, Start Menu, Startup, Templates, ShellNew if (uLinkLoc == CSIDL_APPDATA) { sLinkLoc = "AppData"; } else if (uLinkLoc == CSIDL_COOKIES) { sLinkLoc = "Cookies"; } else if (uLinkLoc == CSIDL_DESKTOP) { sLinkLoc = "Desktop"; } else if (uLinkLoc == CSIDL_STARTMENU) { sLinkLoc = "Start Menu"; } else if (uLinkLoc == CSIDL_STARTUP) { sLinkLoc = "Startup"; } else if (uLinkLoc == CSIDL_FAVORITES) { sLinkLoc = "Favorites"; } if (sLinkLoc.GetLength()>0) { GetShellFolderPath(sLinkLoc, szShellPath); sLink = szShellPath; } else { SHGetSpecialFolderLocation(NULL, uLinkLoc, &id); SHGetPathFromIDList(id, szLinkLoc); sLink = szLinkLoc; } sLink += "\\"; sLink += lpszDesc; sLink += ".lnk"; lpszDestination = (LPCSTR)sLink; if (IsFolder) { // Requies: #Include hResult = _mkdir(lpszDestination); // Clean up pShellLink->Release(); CoUninitialize(); if (SUCCEEDED(hResult)) { return true; } else { return false; } } IPersistFile* ppf = NULL; // Set path to shortcut target pShellLink->SetPath(lpszSourceFile); // Add Start Directory if(lpszSourceDir)
-
When I posted this I was NOT aware of the other sections and you are right in that i should have placed it in a more appropriate place but I have never wasted time worrying about such insignificant things. Keep your eye upon the donut and NOT upon the hole. Bill SerGio, The Infomercial King
Bill SerGio wrote: but I have never wasted time worrying about such insignificant things. So respect for the rules of conduct in this website is of no meaning to you? :confused::mad: You should get out of here!
Eddie Velasquez: A Squeezed Devil
Checkout General Guidelines for C# Class Implementation -
I develop on Windows 98 using Visual Studio 6 I noticed that the code below will NOT create a link on Windows 2000. Since I do NOT have Windows 2000 I can't debug this code so i am wondering if anyone has a solution to how to get the code below to create a lInk on windows 2000? Where UINT uLinkLoc = CSIDL_DESKTOP; Is there a way to write a SINGLE class that can create a link on the Desktop in both Windows 98 and Windows 2000 without compiling 2 separate versions(one UNICODE and one ASCII)??? bool CInstall::CreateShortCut( LPCSTR lpszSourceFile, LPCSTR lpszSourceDir, UINT uLinkLoc, LPCSTR lpszDesc, bool IsFolder ) { HRESULT hResult = NULL; IShellLink* pShellLink = NULL; bool rc = false; LPCSTR lpszDestination = NULL; ITEMIDLIST *id = NULL; TCHAR szLinkLoc[MAX_PATH] = ""; TCHAR szShellPath[MAX_PATH] = ""; CString sLinkLoc; sLinkLoc.Empty(); CString sLink; sLink.Empty(); // Initialize IShellLink interface hResult = CoInitialize(NULL); // Get pointer to IShellLink Interface hResult = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void**) &pShellLink); if (SUCCEEDED(hResult)) { //Cache, Fonts, History, NetHood, Personal, Printhood, Programs, // Recent, SendTo, Start Menu, Startup, Templates, ShellNew if (uLinkLoc == CSIDL_APPDATA) { sLinkLoc = "AppData"; } else if (uLinkLoc == CSIDL_COOKIES) { sLinkLoc = "Cookies"; } else if (uLinkLoc == CSIDL_DESKTOP) { sLinkLoc = "Desktop"; } else if (uLinkLoc == CSIDL_STARTMENU) { sLinkLoc = "Start Menu"; } else if (uLinkLoc == CSIDL_STARTUP) { sLinkLoc = "Startup"; } else if (uLinkLoc == CSIDL_FAVORITES) { sLinkLoc = "Favorites"; } if (sLinkLoc.GetLength()>0) { GetShellFolderPath(sLinkLoc, szShellPath); sLink = szShellPath; } else { SHGetSpecialFolderLocation(NULL, uLinkLoc, &id); SHGetPathFromIDList(id, szLinkLoc); sLink = szLinkLoc; } sLink += "\\"; sLink += lpszDesc; sLink += ".lnk"; lpszDestination = (LPCSTR)sLink; if (IsFolder) { // Requies: #Include hResult = _mkdir(lpszDestination); // Clean up pShellLink->Release(); CoUninitialize(); if (SUCCEEDED(hResult)) { return true; } else { return false; } } IPersistFile* ppf = NULL; // Set path to shortcut target pShellLink->SetPath(lpszSourceFile); // Add Start Directory if(lpszSourceDir)
:-D :-D :-D :-D :-D :-D :-D :-D Why does all the fun always start when I am out taking a sh!t? ____________________ David Wulff Neil says: dave i am a homosexual and i am in love with your father Dave says: That's okay son, eighteen years ago I was in love with your mother.
-
Bill SerGio wrote: I have never wasted time worrying about such insignificant things. Accepted rules of conduct (including a BIG RED warning saying not to post PROGRAMMING questions here) are "insignificant"? Wow, do you tell that to the judges too? --Mike-- Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer My really out-of-date homepage Sonork-100.19012 Acid_Helm
:laugh: :laugh: :laugh: Did you forget that rules don't apply to the infomerical king? I am glad that I just woke up looks like fun has started. I have never wasted time worrying about such insignificant things. Keep your eye upon the donut and NOT upon the hole. - Bill Sergio in The Lounge - June 23, 2002
-
I develop on Windows 98 using Visual Studio 6 I noticed that the code below will NOT create a link on Windows 2000. Since I do NOT have Windows 2000 I can't debug this code so i am wondering if anyone has a solution to how to get the code below to create a lInk on windows 2000? Where UINT uLinkLoc = CSIDL_DESKTOP; Is there a way to write a SINGLE class that can create a link on the Desktop in both Windows 98 and Windows 2000 without compiling 2 separate versions(one UNICODE and one ASCII)??? bool CInstall::CreateShortCut( LPCSTR lpszSourceFile, LPCSTR lpszSourceDir, UINT uLinkLoc, LPCSTR lpszDesc, bool IsFolder ) { HRESULT hResult = NULL; IShellLink* pShellLink = NULL; bool rc = false; LPCSTR lpszDestination = NULL; ITEMIDLIST *id = NULL; TCHAR szLinkLoc[MAX_PATH] = ""; TCHAR szShellPath[MAX_PATH] = ""; CString sLinkLoc; sLinkLoc.Empty(); CString sLink; sLink.Empty(); // Initialize IShellLink interface hResult = CoInitialize(NULL); // Get pointer to IShellLink Interface hResult = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void**) &pShellLink); if (SUCCEEDED(hResult)) { //Cache, Fonts, History, NetHood, Personal, Printhood, Programs, // Recent, SendTo, Start Menu, Startup, Templates, ShellNew if (uLinkLoc == CSIDL_APPDATA) { sLinkLoc = "AppData"; } else if (uLinkLoc == CSIDL_COOKIES) { sLinkLoc = "Cookies"; } else if (uLinkLoc == CSIDL_DESKTOP) { sLinkLoc = "Desktop"; } else if (uLinkLoc == CSIDL_STARTMENU) { sLinkLoc = "Start Menu"; } else if (uLinkLoc == CSIDL_STARTUP) { sLinkLoc = "Startup"; } else if (uLinkLoc == CSIDL_FAVORITES) { sLinkLoc = "Favorites"; } if (sLinkLoc.GetLength()>0) { GetShellFolderPath(sLinkLoc, szShellPath); sLink = szShellPath; } else { SHGetSpecialFolderLocation(NULL, uLinkLoc, &id); SHGetPathFromIDList(id, szLinkLoc); sLink = szLinkLoc; } sLink += "\\"; sLink += lpszDesc; sLink += ".lnk"; lpszDestination = (LPCSTR)sLink; if (IsFolder) { // Requies: #Include hResult = _mkdir(lpszDestination); // Clean up pShellLink->Release(); CoUninitialize(); if (SUCCEEDED(hResult)) { return true; } else { return false; } } IPersistFile* ppf = NULL; // Set path to shortcut target pShellLink->SetPath(lpszSourceFile); // Add Start Directory if(lpszSourceDir)
I think your post is too small. You should have posted the entire .dsp file as text, .cpp and .h or probably base64 encoding of the .zip file having the entire source:-D I have never wasted time worrying about such insignificant things. Keep your eye upon the donut and NOT upon the hole. - Bill Sergio in The Lounge - June 23, 2002
-
I develop on Windows 98 using Visual Studio 6 I noticed that the code below will NOT create a link on Windows 2000. Since I do NOT have Windows 2000 I can't debug this code so i am wondering if anyone has a solution to how to get the code below to create a lInk on windows 2000? Where UINT uLinkLoc = CSIDL_DESKTOP; Is there a way to write a SINGLE class that can create a link on the Desktop in both Windows 98 and Windows 2000 without compiling 2 separate versions(one UNICODE and one ASCII)??? bool CInstall::CreateShortCut( LPCSTR lpszSourceFile, LPCSTR lpszSourceDir, UINT uLinkLoc, LPCSTR lpszDesc, bool IsFolder ) { HRESULT hResult = NULL; IShellLink* pShellLink = NULL; bool rc = false; LPCSTR lpszDestination = NULL; ITEMIDLIST *id = NULL; TCHAR szLinkLoc[MAX_PATH] = ""; TCHAR szShellPath[MAX_PATH] = ""; CString sLinkLoc; sLinkLoc.Empty(); CString sLink; sLink.Empty(); // Initialize IShellLink interface hResult = CoInitialize(NULL); // Get pointer to IShellLink Interface hResult = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void**) &pShellLink); if (SUCCEEDED(hResult)) { //Cache, Fonts, History, NetHood, Personal, Printhood, Programs, // Recent, SendTo, Start Menu, Startup, Templates, ShellNew if (uLinkLoc == CSIDL_APPDATA) { sLinkLoc = "AppData"; } else if (uLinkLoc == CSIDL_COOKIES) { sLinkLoc = "Cookies"; } else if (uLinkLoc == CSIDL_DESKTOP) { sLinkLoc = "Desktop"; } else if (uLinkLoc == CSIDL_STARTMENU) { sLinkLoc = "Start Menu"; } else if (uLinkLoc == CSIDL_STARTUP) { sLinkLoc = "Startup"; } else if (uLinkLoc == CSIDL_FAVORITES) { sLinkLoc = "Favorites"; } if (sLinkLoc.GetLength()>0) { GetShellFolderPath(sLinkLoc, szShellPath); sLink = szShellPath; } else { SHGetSpecialFolderLocation(NULL, uLinkLoc, &id); SHGetPathFromIDList(id, szLinkLoc); sLink = szLinkLoc; } sLink += "\\"; sLink += lpszDesc; sLink += ".lnk"; lpszDestination = (LPCSTR)sLink; if (IsFolder) { // Requies: #Include hResult = _mkdir(lpszDestination); // Clean up pShellLink->Release(); CoUninitialize(); if (SUCCEEDED(hResult)) { return true; } else { return false; } } IPersistFile* ppf = NULL; // Set path to shortcut target pShellLink->SetPath(lpszSourceFile); // Add Start Directory if(lpszSourceDir)
Bill please check out my artice on this, its pretty well documented. Regardz Colin J Davies
Sonork ID 100.9197:Colin
More about me :-)
-
:laugh: :laugh: :laugh: Did you forget that rules don't apply to the infomerical king? I am glad that I just woke up looks like fun has started. I have never wasted time worrying about such insignificant things. Keep your eye upon the donut and NOT upon the hole. - Bill Sergio in The Lounge - June 23, 2002
Ricku wrote: I am gald that I just woke up looks like fun has started And I'm just finished my day's work!! I don't think this'll turn into a flame war. not unless we move it to the soapbox.. but I can't see sergio moving with us.
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks] "It's The Soapbox; topics are optional" Shog 9
-
:-D :-D :-D :-D :-D :-D :-D :-D Why does all the fun always start when I am out taking a sh!t? ____________________ David Wulff Neil says: dave i am a homosexual and i am in love with your father Dave says: That's okay son, eighteen years ago I was in love with your mother.
David Wulff wrote: Why does all the fun always start when I am out taking a sh!t? We plan it that way ;-)
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks] "It's The Soapbox; topics are optional" Shog 9
-
I think your post is too small. You should have posted the entire .dsp file as text, .cpp and .h or probably base64 encoding of the .zip file having the entire source:-D I have never wasted time worrying about such insignificant things. Keep your eye upon the donut and NOT upon the hole. - Bill Sergio in The Lounge - June 23, 2002
Don't encourgae that man!!!! ;P
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks] "It's The Soapbox; topics are optional" Shog 9
-
:-D :-D :-D :-D :-D :-D :-D :-D Why does all the fun always start when I am out taking a sh!t? ____________________ David Wulff Neil says: dave i am a homosexual and i am in love with your father Dave says: That's okay son, eighteen years ago I was in love with your mother.
-
Bill please check out my artice on this, its pretty well documented. Regardz Colin J Davies
Sonork ID 100.9197:Colin
More about me :-)
Hi, Thank you for at least offerring a suggestion, i appreciate it. I am unable to find the article you refer to? Can you provide a link to the article? Your product "Sonork" looks very interesting and I will have to check it out when i get a chance. why didn't you include a Peer-to-Peer file sharing system in it? I can get a minimum of $25 per 1,000 opt in email address per day if you generate opt in addressesfrom your customer base. Thank you again, and let me know where i can find your article. The problem is more interesting than I thought at first since I can get it to work if I compile with a UNICODE SWITCH turn on but then i would need 2 version of the code which is not acceptable or elegant. Bill Bill SerGio, The Infomercial King
-
Ricku wrote: I am gald that I just woke up looks like fun has started And I'm just finished my day's work!! I don't think this'll turn into a flame war. not unless we move it to the soapbox.. but I can't see sergio moving with us.
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks] "It's The Soapbox; topics are optional" Shog 9
DO you have the Power to move it, or must I start using expletives. :-) Regardz Colin J Davies
Sonork ID 100.9197:Colin
More about me :-)
-
DO you have the Power to move it, or must I start using expletives. :-) Regardz Colin J Davies
Sonork ID 100.9197:Colin
More about me :-)
Colin Davies wrote: DO you have the Power to move it, or must I start using expletives. I don't have the Power... unfortunatly. :(( Anyway's, i'm off. See ye soon :-)
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks] "It's The Soapbox; topics are optional" Shog 9