![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Additional Libraries Users contributed libraries. This sub-forum is only available to licensed users. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Sorry Andrew, despite it being very simple I still have problems with it
![]() In the attached program I can copy the content of a richtextbox with no problems. When I try to do the same from a "normal" textbox I get an error message however. Does this mean that only objects added from a .dll count as objects for the clipboard dll? all the best / Björn |
|
||||
|
I think it is some obscure threading problem as your code seems to work fine when optimised compiled and and my demo worked in the IDE when I was testing.
The IDE error implies that textbox1.text is null (which is not the case) however if you continue after the error it now works OK. It also works if you copy the RTF first! If I legacy compile both my demo and your code I get this error : "Current thread must be set to single thread apartment mode before OLE calls can be made. Ensure that your Main function has STA ThreadAttribute marked on it." This is required as the clipboard in .NET calls the native clipboard code which is a COM object which needs an STA host. However Erel has told me that Basic4ppc IS now STA threaded (which is why I couldn't produce this library and the WebBrowser before as both are COM objects needing STA) so I have no idea why it is throwing this error. Perhaps Erel can shed some light on this if he reads this! The RichTextTextbox has a workaround for this threading problem, which I thought had now gone away with the change in threading for B4ppc so I will try to to produce a version of the clipboard library incorporating this workaround. |
|
||||
|
I'm sorry Björn but there seems to be a fundamental incompatibility between the .NET clipboard object and both the IDE and legacy compiler on both desktop and device. While things work as I expect when optimised compiling they don't otherwise. I can't even get the workaround that I used in RichTextDesktop to work in this library while it still seems to work fine in the RichTextDesktop libray
![]() It looks like this is a device and desktop optimised compile library only. |
|
||||
|
The thread which runs the code in the IDE is set to "single thread apartment".
Maybe the problem is caused due to the fact that there is another thread (the main thread in the IDE) that is STA in the same process. For now you will only be able to use this library with the optimized compiler. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Support for Access databases | Peter | Basic4ppc Wishlist | 3 | 03-18-2008 12:39 PM |
| Control properties library (access TabIndex & TabStop) | agraham | Additional Libraries | 1 | 02-21-2008 03:15 PM |
| Network access | skipper | Questions & Help Needed | 4 | 02-19-2008 09:21 AM |
| Access to Outlook contacts | Big JR | Code Samples & Tips | 3 | 09-26-2007 11:16 AM |
| How to access the 2nd dimension | hung | Questions & Help Needed | 4 | 08-15-2007 05:24 AM |