|
Why are you calling GetLastError on WriteprocessMemory success?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
the call doesn't complete..... The bytecount written is correct, but the memory addressed by the call stays empty.
Also in MSDN is stated that a Write call my fail whilst still returning no fail error code.
After doing a sendmessage LVM_GetItemState to listView, the call returns empty as well.
So the memory location seems to be inacessible, which is bizarre because i also have this:
lvi.pszText=_item;
WriteProcessMemory(lView, _lvi, &lvi, sizeof(LVITEM), NULL);
SendMessage(listView, LVM_GETITEMTEXT, NULL, (LPARAM)_lvi);
ReadProcessMemory(lView, _item, item, 512, NULL);
and that returns with the correct itemtext......
|
|
|
|
|
GetLastError() returns the last error that occurred, which didn't necessarily happen in the last function call. That is way it is called GetLastError() and not GetError().
You normally want to stop a sequence of operations at the first error, so you could and should structure your code like this:
result=callFunction1();
if (result==OK) result=callFunction2();
if (result==OK) result=callFunction3();
if (result!=OK) log("it went wrong; error = ", GetLastError());
|
|
|
|
|
tnx for the input, but the original code is spiked with GetLastErrors, took some out to shorten code for viewing.
|
|
|
|
|
Yeah, great. When the error handling code indicates some problem, show us fictitious code. Someone will make the right guess anyhow?
|
|
|
|
|
They must protect their brilliant code against industrial espionage, my friend.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
found it:
Microsoft Windows Vista and later. When a message is blocked by UIPI the last error, retrieved with GetLastError, is set to 5 (access denied).
took me a full week to discover this tidbit. Tnx MS
|
|
|
|
|
Good: tenacity wins, eventually.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I need help with a programto keep records and perform statistical analysis for a class of students.
the class has 40 students, there are 5 quizzes, and each student identified by a 4 digit student number
|
|
|
|
|
This is homework, the rules of the homework game, here, are:
- we don't do homework.
- Try to do some work yourself.
- If you're stuck, try harder.
- If point (3) did'n work for you, read carefully post guidelines [^] and then post in this forum.
[added]
Mr.Univoter deadlock on point (3).
[/added]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Wednesday, April 29, 2009 12:44 PM
|
|
|
|
|
biggiant22000 wrote: I need help with a programto keep...
Change this to "program to" and you should be good to go. Thanks for allowing us to help.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
I have written a CMS that uses the CHTMLEdView class as a HTML editor. The CMS also has a number of additional edit controls for things like a button name, a tooltip etc. When the CHTMLEdView has focus, and I click on one of the other Edit controls, then the cursor is hidden, which is a hassle for editting. When I then click on any of the other edit controls, the cursor re-appears, In other words, I always need to click two different edit controls after using the HTML editor before the cursor appears again. I have tried ShowCursor(TRUE) and ShowCaret() on the edit controls, but nothing seems to help. Has anybody got any ideas on the subject? Would be greatly appreciated.
Regards,
William
|
|
|
|
|
hi!
I want to use a C++ function which applies minimization on a math formula ( http://www.codecogs.com/d-ox/maths/optimization/nelder.php ) but I dont understand how to pass my formula as the first parameter.
There is even an example but I dont understand it...
double f(double *x) {
double r = sqrt(x[0] * x[0] + x[1] * x[1]);
return ABS(r) < 1E-12 ? 1 : sin(r) / r;
}
I dont know what's the unknown. "x"? "r"? Both?
My formula is: http://personal.telefonica.terra.es/web/episodio1/text3.gif
This is what I've made:
for (i=1;i<=numberOfAnchors;i++)
{
errorsquare+= pow( abs( x[i] - xestim + y[i] - yestim ) - distance[i] ) , 2 );
}
errorsquare=errorsquare/numberOfAnchors;
2 unknowns: "xestim" and "yestim".
My question is: how should I code/declare my formula so it is accepted by the C++ function ?
Thanks.
|
|
|
|
|
Well, supposing both your xestim and yestim are independent, you may rearrange your function such a way:
xestim -> z[0]
yestim -> z[1]
so that you'll get
double f (double * z)
{
errorsquare = 0.0;
for (i=1;i<=numberOfAnchors; i++)
{
errorsquare+= pow( abs( x[i] - z[0] + y[i] - z[1] ) - distance[i] ) , 2 );
}
return errorsquare;
}
Now you have the f parameter of the nelder function..
dim is 2 (as you may guess).
The starting simplex points p are up to you (you've to provide, as in the example a 2x3 array), like the eps value and the maxit .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks, Cpallini...
I guess u removed by mistake...
errorsquare=errorsquare/numberOfAnchors ;
)
|
|
|
|
|
Episodio1 wrote: I guess u removed by mistake...
Of course I forgot it, but you know, such a operation has no influence in finding minimum (you may drop it).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Cpallini, do you know about NelderMead algorithm?
Cause I dont know what initial points to use. I mean...
In that C++ function Points are 2x3 (3 points x-y).
But this function is payware, so I got this one: http://people.sc.fsu.edu/~burkardt/cpp_src/asa047/asa047.html
In this last one initial points are only 1x2, which I dont know what represents.
Code it's already running but I dont get valid points for any initial points.
EDIT: It's OK now. There would be 1 and only initial point. And it should be close to region in which I want to find a minimum. ^^
modified on Monday, April 27, 2009 7:10 PM
|
|
|
|
|
Receiving gps coordinate to web browser laziness program
By the way, coordinate is not carried cost
Teach where is done wrongly
source down
|
|
|
|
|
yunpil wrote: laziness program
At least you are consistent with that...
|
|
|
|
|
I remember walking in the park one day and... Wait, wrong story.
I have sent you the requested code. I wrapped it in a plain brown sack for your privacy. When you are done with it, please mail it back to me. Enjoy.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hi All
I have two path source(LPCSTR pF)and destination(LPCSTR pT).I am getting values in pF at the run time like this pF="C:\\Hello\\adaf\\trt" and pT="C:\\Backup."
But when code start to copy cammand then it make backup but it's not make in proper way.It's make like that(C:\\Backup\\Hello,C:\\Backup\\adaf and C:\\Backup\\trt).But i need to copy in full path like that(C:\\Backup\\Hello\\adaf\\trt).I am ueing this code.
CFileOperation fo;
CString tr=sourcepath;
int nLen = tr.GetLength();
LPCSTR lpszBuf = tr.GetBuffer(nLen);
tr.ReleaseBuffer();
LPCSTR pF=lpszBuf;
LPCSTR pT="C:\\Backup";
if(!fo.Copy(pF,pT));
Plz help me
|
|
|
|
|
MsmVc wrote: CFileOperation
What is it?
MsmVc wrote: int nLen = tr.GetLength();
LPCSTR lpszBuf = tr.GetBuffer(nLen);
Why are you misusing CString::GetBuffer ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
If you are use ;;ShellFileOperation you need to end the last file buffers with 2 (two) zero bytes. Read the docs from MS
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
What's wrong with:
CFileOperation fo;
if (! fo.Copy(sourcepath, "C:\\Backup"))
; That aside, have you stepped into the Copy() code to see when/how it is failing?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|