BBC BASIC for Windows
Programming >> Operating System >> WM_COPYDATA problem http://bb4w.conforums.com/index.cgi?board=os&action=display&num=1380098370 WM_COPYDATA problem
Post by Nick on Sep 25th, 2013, 08:39am
Hi Richard
I have subclassed WM_COPYDATA like this:
PROC_subclasswin(@hwnd%,WM_COPYDATA, FN_copydata()) REM subclass the WM_COPYDATA command
I have previously installed the library:
INSTALL @lib$+"SUBCLASSW"
My FN_copydata()) routine is below. The size of COPYBUFFER% is well over what is needed for the data to be transferred.
But when FN_copydata is invoked, I get an error:
"No such variable in module c:\Users\Nick\AppData\Local\Temp\BBCCCA4.tmp\SUBCLASSW "
I can't see any way to get further into the error reporting to see what is wrong...
Ideas?
Thanks
Nick
------------------------
DEF FN_copydata(m%,w%,l%) LOCAL x,w REM This has to be fast - just get the data and return !(^RECEIVED_COPYDATA{}+4) = l% REM Equate structures - but will this pass data, not just parameters? REC_DW=RECEIVED_COPYDATA{}.dw%: REC_CB=RECEIVED_COPYDATA{}.cb%: REC_HWIN=w% x=0 REPEAT w=RECEIVED_COPYDATA{}.lpdata%?x COPYBUFFER%?x=w x=x+1 UNTIL x=RECEIVED_COPYDATA{}.cb% REM add a final null to be sure x=x+1: COPYBUFFER%?x=0 REC_COPYFLAG=1 = 1 Re: WM_COPYDATA problem
Post by admin on Sep 25th, 2013, 12:58pm
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
Re: WM_COPYDATA problem
Post by admin on Sep 25th, 2013, 1:40pm
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.
Re: WM_COPYDATA problem
Post by Nick 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
Re: WM_COPYDATA problem
Post by admin on Sep 27th, 2013, 11:23am