Author |
Topic: WM_COPYDATA problem (Read 298 times) |
|
Nick
New Member
member is offline


Gender: 
Posts: 33
|
 |
Re: WM_COPYDATA problem
« Reply #2 on: Sep 25th, 2013, 1:18pm » |
|
on Sep 25th, 2013, 12:58pm, Richard Russell wrote:I see that you have cross-posted to the Yahoo group. Does that mean you don't want a response from me?
Richard. |
|
No - I posted this earlier, but then saw that the Yahoo group was continuing to generate messages, so decided to cover my options - I have a developer who is making something for me today - and I need to send him a simple test app - but I can't because of this glitch in WM_COPY...
Nick
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: WM_COPYDATA problem
« Reply #3 on: Sep 25th, 2013, 1:40pm » |
|
on Sep 25th, 2013, 1:18pm, Nick wrote:| I posted this earlier, but then saw that the Yahoo group was continuing to generate messages |
|
It's unavoidable that discussions about the group's closure, and where it will eventually be transferred, take place there. So I am going to the trouble of reading messages posted in that thread (I can do that by using my laptop, which is faster and has a newer version of IE).
But I'm not reading other messages posted there - I see the subject line but I don't bother to try to open the thread.
Quote:| I can't because of this glitch in WM_COPY... |
|
It's difficult to comment without seeing a self-contained program; for example you didn't show your declaration of the RECEIVED_COPYDATA{} structure nor your allocation of the COPYBUFFER% buffer.
All I can say is that receiving a 'No such variable' message is consistent with heap corruption, so that's something to investigate.
Incidentally - although it can't be the source of the problem - your comment 'This has to be fast' seems rather incongruous alongside the actual code, which appears to have been written to be about as slow as possible!
Richard.
|
|
Logged
|
|
|
|
Nick
New Member
member is offline


Gender: 
Posts: 33
|
 |
Re: WM_COPYDATA problem
« Reply #4 on: Sep 25th, 2013, 1:52pm » |
|
[quote author=Richard Russell All I can say is that receiving a 'No such variable' message is consistent with heap corruption, so that's something to investigate. [/quote]
OK - I will double check...
[quote author=Richard Russell Incidentally - although it can't be the source of the problem - your comment 'This has to be fast' seems rather incongruous alongside the actual code, which appears to have been written to be about as slow as possible!
Richard. [/quote]
Thanks for that. Like many experienced programmers with precious little time to go up the learning curve, I usually opt for things that are least likely to be additional reasons for something to break. But I am sure it can be re-written to be faster - your suggestions would be most welcome.
Nick
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: WM_COPYDATA problem
« Reply #5 on: Sep 27th, 2013, 11:23am » |
|
on Sep 25th, 2013, 1:52pm, Nick wrote:| OK - I will double check... |
|
Did you find the fault?
Quote:| But I am sure it can be re-written to be faster - your suggestions would be most welcome. |
|
If the amount of data is substantial (say a kilobyte or more) I would recommend using SYS "RtlMoveMemory" to transfer it:
http://msdn.microsoft.com/en-us/library/windows/hardware/ff562030.aspx
If it's relatively small, a FOR...NEXT loop using static integer variables won't be too bad:
Code: S% = source%
D% = destination%
FOR I% = 0 TO bytecount%-1 : D%?I%=S%?I% : NEXT Of course if you know that the byte count is an exact multiple of 4 this will be faster:
Code: S% = source%
D% = destination%
FOR I% = 0 TO bytecount%-4 STEP 4 : D%!I%=S%!I% : NEXT Richard.
|
|
Logged
|
|
|
|
|