|
You are welcome.
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
Ok guys,
For future notice, the problem was related to the configuration of the project. When I converted the project from .net 3.5 to .net 4 and from x32 to x64 something didn't quite go right.
So I reverted everything back and converted again in a more controlled environment and now i can open/write/close files without a problem.
Cya
|
|
|
|
|
Hello,
How you fixed the access violation error on Visual Studio 2010. I am trying to write data to csv file but it is giving me access violation error. As you mentioned, the debugger points to :
virtual void __CLR_OR_THIS_CALL _Lock()
{ // lock file instead of stream buffer
if (_Myfile)
_CSTD _lock_file(_Myfile);
}
|
|
|
|
|
I have a VC++/MFC application.This was in ancient code, visual studio 6. While compiling it in VS2010 it gave tons of errors and required changes in settings. I got good guidance from http://www.codeproject.com/Members/Jochen-Arndt.
Now my project is compiling/linking and .exe file is also launching.
While the application is running since output is in Japanese so in English OS it shows all junk characters.
Now i take the whole code base to Japanese windows OS, compile the code and run the application there,
Why do I still see the junk characters on application dialogue boxes/captions/ Labels ?
Any area you can hint I can look into display caption/labels/dialogue box in Japanese ?
Please help.
|
|
|
|
|
The obvious question: have you selected Japanese font into the application's resources?
|
|
|
|
|
Obvious answer...that's why its showing Junk characters in the english OS.
modified 31-Jul-14 6:04am.
|
|
|
|
|
Can someone point me to some C++ or C# examples on how to loop thru a group of similar CSV files and import them to an access db? Thanks.
|
|
|
|
|
|
Hi,
I am working on a project which requires to use a web service in C++ native application. I have searched on the net and found many links which explains that it is possible using C++ REST SDK. I have downloaded and installed the C++ REST SDK for visual studio 2010 but couldn't find any sample application using REST SDK to call a web service.
Can anyone help me regarding this. How to use a web service in C++ using REST SDK.
Regards,
mba
|
|
|
|
|
|
I have recently written a 'project browser' ctrl for my hobby ide BUT when i right click on an item to 'select item and show menu' even though the carat is on the new item the control reports the active TREEVIEWITEM is the previously selected item and the menu acts on the prev selected item.
With listboxes its easy you just subclass the ctrl and simulate "press lmb down and lmb up" when rmb is pressed but this method doesnt work at all with treeviews.
How do i select a item with the rmb?
Ps. you can be technical with your responce, im v.familiar w/ winapi.
thx bob
Sorry guys lol. Just solved it. You use the TVM_HITTEST to get the current item under the mouse cursor then call TVM_SELECTITEM w/ that item.
Then call trackpopupmenu as normal.
4 hours wasted last night on that one... still happy ending.
modified 30-Jul-14 6:30am.
|
|
|
|
|
What messages or notifications are you responding to?
|
|
|
|
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
float summation(float g);
int main(int argc,int *argv[])
{
srand(12345);
float z;
float a=0.2,y=0.0;
int i;
for(i=0;i<5;i++)
{
float b=((float)rand()/(float)(RAND_MAX))*a;
printf("%f\n",b);
z=summation(b);
}
printf("summation:\n%f\n",z);
return 0;
}
float summation(float g)
{
int i;
float y[5],sum =0.0;
float c=0.0;
for(i=1;i<5;i++)
{
float z=y[i]-c;
float t = sum+z;
c=(t-sum)-z;
sum=t;
return sum;
}
}
output
0.035679
0.079935
0.033320
0.042424
0.012387
summation:
0.000000
|
|
|
|
|
Your summation function makes no sense. You pass in a parameter which is ignored and then do some fairly random calculations, and return the value which will be zero, after a single iteration of the loop.
|
|
|
|
|
so as far as u say which way i should proceed?
actually my logic was not working so was planning to implement kahan summation.
|
|
|
|
|
maibam debina wrote: so as far as u say which way i should proceed? Well the first thing you need to do is to define what the summation function is supposed to do; I cannot make any sense out of it. Once you have done that, then define the steps required and convert them to code. It would probably help you immensely to use meaningful names for your variables rather than single letters which make it difficult to understand.
|
|
|
|
|
can u please help me out with code...
|
|
|
|
|
Well I could, but i) I have no idea what your summation function is supposed to do, and ii) you would learn more by trying it yourself.
|
|
|
|
|
Actually the logic which i use to implement for performing the summation was
<blockquote class="quote"><div class="op">Quote:</div>for(i=0;i<5;i++)
{
float f= ((float)rand()/(float)(RAND_MAX))*a;
y=square(f);
sum +=y;
}
printf("\n Summation Of Square Number is:=%f\t\n",sum); </blockquote>
but it doesnot seem well its not giving the exact summation value,all i want was to perform summation of the generated float random numbers .
|
|
|
|
|
Are you sure that sum contains zero at the beginning of the loop? In the statement:
float f= ((float)rand()/(float)(RAND_MAX))*a;
what is the value of a ?
And since you are not printing any of the intervening values, how can you be sure the final sum is not correct?
|
|
|
|
|
|
for(i=0;i<5;i++)
{
float f= ((float)rand()/(float)(RAND_MAX))*a;
printf("%f\t",f);
y=square(f);
printf("\t\t%f\n",y);
}
for(i=0;i<5;i++)
{
float f= ((float)rand()/(float)(RAND_MAX))*a;
y=square(f);
sum +=y;
}
printf("\n Summation Of Square Number is:=%f\t\n",sum);
i have print at the 1st for loop...
|
|
|
|
|
And in the second loop you will have a different set of numbers, as returned by the calls to rand() . I also cannot find a reference to square , is this another function in your code?
|
|
|
|
|
ya it is thank fren i got it...matter was with the printf statement i gav at second loop ,wen i pass the printf statement inside the 1st loop itself n removing the second for loop as condition where same ...den i got the exact answer..
|
|
|
|
|
What are you doing?
OK, you are trying to implement the "Kahan summation algorithm"[^].
However you have to read carefully and understand it, before actually coding.
For instance, as shown by the algorithm pseudo-code[^], the parameter to the summation function must be an array, while you are using a float.
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
modified 30-Jul-14 4:20am.
|
|
|
|