|
|
Thank you so much guys.
Saadhinchaali
|
|
|
|
|
You're welcome.
|
|
|
|
|
This is my code for the Getting the special folder path, which is not working on the Windows 98. ( Same application works well on the Windws XP Pro.
1. Is anything remainig in my code?
2.any better way to do this task?
I have also tried following function on Windows 98, but still unable to get proper result.
SHGetSpecialFolderLocation
SHGetFolderPath
SHGetFolderLocation
Code =>
<br />
BOOL bRet ; <br />
char spath[MAX_PATH];<br />
bRet = SHGetSpecialFolderPath(NULL, (LPSTR)spath, CSIDL_PROGRAM_FILES, 0); <br />
AfxMessageBox(spath);
|
|
|
|
|
According to the MSDN[^] CSIDL_PROGRAM_FILES is not supported before version 5.0 (Windows XP)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Then how to get the Program files and other folder which are not supported in that version?
|
|
|
|
|
How about this.
You're program was probably installed there?
If so, use GetModuleFilename() to figure out where you run from and therefore where program files are.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
According to the MSDN-page for SHGetFolderPath
"[SHGetFolderPath] is a superset of SHGetSpecialFolderPath, included with earlier versions of the Shell. On systems preceeding those including Shell32.dll version 5.0 (Windows Millennium Edition (Windows Me) and Windows 2000), SHGetFolderPath was obtained through SHFolder.dll, distributed with Microsoft Internet Explorer 4.0 and later versions. SHFolder.dll always calls the current platform's version of this function. If that fails, it will try to simulate the appropriate behavior. SHFolder.dll continues to be included for backward compatibility, though the function is now implemented in Shell32.dll."
And CSIDL_PROGRAM_FILES is specifically mentioned as supported. That sounds as if this would work with Win98!
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Another tip (from David Crow, actually):
Look at your environment variable ProgramFiles .
Is it there? Does it point to something reasonable?
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Take the driver letter returned from GetSystemDirectory() or GetWindowsDirectory() , and append "\\Program Files" to it.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hmmmpf.
IIRC, Windows 98 did localize its program path.
In Germany, we already had "\\Programme".
But I do not have a Windows98 ready to check it.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
What is the value of your ProgramFiles environment variable?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have no Win98 bootable here, but I remember hassles with the translation back then.
Here in the company I am currently working on a US WinXP with German locale settings. So I couldn't even tell for German WinXPs...
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
I just looked it up for a German W2K:
There its pointing to "C:\Programme"
Not that this does help the OP, though.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
jhwurmbach wrote: Not that this does help the OP, though.
Why not?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
He asked specifically for Win98.
That is software-archeology!
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
jhwurmbach wrote: He asked specifically for Win98.
Does the ProgramFiles environment variable exist on that OS?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
As I said, I don't have Win98 bootable here.
All I have are German WinXP and W2k, and both have %ProgramFiles, and it points to "C:\Program Files"
But MSDN says:
"SHGetFolderPath is a superset of SHGetSpecialFolderPath, included with earlier versions of the Shell. On systems preceeding those including Shell32.dll version 5.0 (Windows Millennium Edition (Windows Me) and Windows 2000), SHGetFolderPath was obtained through SHFolder.dll, distributed with Microsoft Internet Explorer 4.0 and later versions. SHFolder.dll always calls the current platform's version of this function. If that fails, it will try to simulate the appropriate behavior. SHFolder.dll continues to be included for backward compatibility, though the function is now implemented in Shell32.dll."
And CSIDL_PROGRAM_FILES is specifically mentioned as supported. That sounds as if this would work with Win98!
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
jhwurmbach wrote: As I said, I don't have Win98 bootable here.
All I have are German WinXP and W2k, and both have %ProgramFiles, and it points to "C:\Program Files"
Ok, but what does this have to do with my suggestion not being a possible solution for the OP? The only way it would not help is if that OS did not have the ProgramFiles environment variable. Since you cannot confirm one way or the other, how can you claim that it is not a viable solution?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: The only way it would not help is if that OS did not have the ProgramFiles environment variable.
OK, you are right. All I have to say in my defence is I am just starting the eleventh hour at work.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Hi Experts,
How can I add icon to ListView?
|
|
|
|
|
You can use of SetImageList .
|
|
|
|
|
I used like this
<br />
CImageList ImageList;<br />
ImageList.Create(16, 16, CLR_NONE, 0, 255);<br />
ImageList.Add(sfi.hIcon);
ListCtrl.SetImageList(&ImageList, LVSIL_SMALL);<br />
<br />
ListCtrl.InsertItem(ListCtrl.GetItemCount(),finder.GetFileName(),0);<br />
But this code is giving exception at
ImageList.Add(sfi.hIcon);//HICON
Could you please me?
|
|
|
|
|
Explain the exception that you see -- is it stopping on an ASSERT?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|