|
Hi,
How can I get the directory
"C:\Documents and Settings\Default User\Application Data"
I tried with SHGetSpecialFolderLocation but no result.
|
|
|
|
|
According to this[^], it is no longer supported. Have you tried to use SHGetFolderLocation[^] instead?
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
No i didn't try, Also I don't know how set the Flag to obtient the path.
|
|
|
|
|
SHGetFolderPath() , perhaps.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
How are you calling it? What is it returning? What values are you using for hToken and nFolder ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I tried like this :
HRESULT hRes = SHGetSpecialFolderLocation( NULL, CSIDL_PROFILE, &pidl );
if (SUCCEEDED(hRes))
{
SHGetPathFromIDList(pidl, lpPath );
}
|
|
|
|
|
What is it returning? Shouldn't you be using CSIDL_APPDATA instead (if you are wanting the Application Data folder)? As has already been suggested, use SHGetFolderLocation(NULL, CSIDL_APPDATA, -1, 0, &pidl) instead.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I'm confused with suggestions given
Please can you give just one solution which works
|
|
|
|
|
Ok, it is solved doing as DavidCrow say :
HRESULT hRes = SHGetFolderLocation(NULL, CSIDL_LOCAL_APPDATA, HANDLE(-1), 0, &pidl);
Thank you
|
|
|
|
|
I've just started a new VC++ Form project. I understand that I can manipulate my forms through events on the generated form header file.
However, for better design, I want to be able to update the form from external controlling objects (for instance when new data is generated in the system at large).
The problem is, in the generated main file, Application::Run( gcnew <formname>() ); means that I can't send any commands through (e.g. changing text on a button) because this is constantly running until the form is closed.
How do you typically deal with this? Am I approaching this in the wrong manner?
Many Thanks in advance for your help.
|
|
|
|
|
f9073341 wrote: The problem is, in the generated main file, Application::Run... Is this a C# or managed C++ thing?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
This is Visual C++. I'm using the Express edition, but I don't think that matters. I suspect I'm just going about it the wrong way
|
|
|
|
|
Member 8758134 wrote: This is Visual C++.
But is it managed or unmanaged? That detail does matter.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
David is right... it does matter... when you refer to "forms", you're usually talking about .net based stuff (either C++/CLI or C#). There's another forum for that.
|
|
|
|
|
|
You need to be asking this in the managed C++ forum.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Hi,
I am working with images and computing radon transform for an object. the function that computes the transform accepts vector as input:
pixel p;
vector<pixel> segObj
pixel is a user-defined struct defined as:
struct pixel
{
float x, y;
};
Currently, I am doing an element wise assignment to the vector:
for(int ix=0; ix < element_count; ix++)
{
{
f.x = xCoordArray[ix];
f.y = yCoordArray[ix];
segObj.push_back(f);
}
}
//xCoordArray and yCoordArray are computed separately
The for loop makes it slow when dealing with large images. Is there a way to assign xCoordArray and yCoordArray directly to
vector<pixel>segObj
I am not expereinced with the use of vectors so any help would be appreciated
Thanks
|
|
|
|
|
You might try using reserve[^] before your loop. This will allocate the memory in one go for the vector and prevent the reallocation of memory every time you call push_back .
So try adding
segObj.reserve( element_count ); before the for loop.
0100000101101110011001000111001011101001
|
|
|
|
|
There is a little improvement but for cases with more coordiante values ( > 2000) it is still slow. I am trying to get rid of the for loop, since at each index there a two values (pixel coordinates) using .assign is a bit tricky for me
thanks
|
|
|
|
|
If speed is a concern to you, you must use xCoordArray and yCoordArray as is without using the vector .
|
|
|
|
|
Thanks for the reply. The issue is the function I am using accpets vector as input and re-writing it is not possible at the moment.
|
|
|
|
|
you could try:
segObj.resize(element_count);
for(int ix=0; ix < element_count; ix++)
{
segObj[ix].x = xCoordArray[ix];
segObj[ix].y = yCoordArray[ix];
}
that eliminates the push_back, at least.
|
|
|
|
|
I'm doing my development in VC++ 6.0 SP6. When I modify a *.cpp file, I have to build the project with right click and select build to generate the *.lib file and build the active project with F7 to gengerate the *.exe file to debug the whole projects.
So I want to use Macro tools to help me to do these repeat operations, so that I can generate the *.exe file just with a Macro shortcut. But I don't know how to accomplish this.
Thanks so much in advance for any ideas you can give me. I usually find these answers in onw quick google search but not this time.
|
|
|
|
|
As I understand it, one workspace has 2 projects - a lib and an exe.
In this case, Here is what is normally done.
Set the exe project to be dependent on the lib project and make the exe project as the active project.
I've forgotten exactly how to do this in VC6, but you should be able to find it.
Now after making some changes to the lib source, you can directly run the program and the lib would be built first after which the exe would be built and then executed.
|
|
|
|
|
Thank you very much!
I have set the *.exe Project Dependencies.
It does work!
|
|
|
|