|
I did use the debugger, and it never generated an error, until I did some experimenting and generated an i/o error.
I'm way off base here on implementation, and I'm going to send this code to the trash and start again.
|
|
|
|
|
you need to change your file format and also need to change the parsing style. it wont work. swscanf_s function stop reading when it gets a space
|
|
|
|
|
johny10151981 wrote: swscanf_s function stop reading when it gets a space Not necessarily.
"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
|
|
|
|
|
Back to the drawing board for me.
|
|
|
|
|
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.
|
|
|
|