dotNET.System_Windows_Forms.Clipboard.GetDataObject() in TestComplete 7.51
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2010
02:43 AM
01-05-2010
02:43 AM
dotNET.System_Windows_Forms.Clipboard.GetDataObject() in TestComplete 7.51
I use dotNET.System_Windows_Forms.Clipboard.GetDataObject() to check if the clipboard has any data on it.
The code is similar to:
function ClipboardIsAvailable()
{
var oDataObject = dotNET.System_Windows_Forms.Clipboard.GetDataObject();
return oDataObject.GetDataPresent("string");
}
This worked great while I was using TestComplete 6.52.
However, when I converted the script to TestComplete 7.51, dotNET.System_Windows_Forms.Clipboard.GetDataObject() always returns null.
Is there additional setting I need to do under TestComplete 7.5 that I didn't have to do on 6.52? Is this a bug?
System.Windows.Forms, version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 is listed under CLR bridge of the project. The application that's being tested is a .NET software, and it's the same software I was testing under TestComplete 6.52. In fact, I can still run the same script in TestComplete 6.52, and it finds the value.
Thanks.
The code is similar to:
function ClipboardIsAvailable()
{
var oDataObject = dotNET.System_Windows_Forms.Clipboard.GetDataObject();
return oDataObject.GetDataPresent("string");
}
This worked great while I was using TestComplete 6.52.
However, when I converted the script to TestComplete 7.51, dotNET.System_Windows_Forms.Clipboard.GetDataObject() always returns null.
Is there additional setting I need to do under TestComplete 7.5 that I didn't have to do on 6.52? Is this a bug?
System.Windows.Forms, version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 is listed under CLR bridge of the project. The application that's being tested is a .NET software, and it's the same software I was testing under TestComplete 6.52. In fact, I can still run the same script in TestComplete 6.52, and it finds the value.
Thanks.
Solved! Go to Solution.
5 REPLIES 5
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2010
01:33 AM
01-06-2010
01:33 AM
Hi Motoo,
Thank you for reporting the problem. We have reproduced it, and currently we are investigating it. We will let you know our results as soon as we have some.
--
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2010
02:28 AM
01-06-2010
02:28 AM
Hi David,
Thank you for prompt reply. I look forward to the resolution of this issue, as this is one of the reason we are having trouble fully migrating to TestComplete 7.5.
Motoo
Thank you for prompt reply. I look forward to the resolution of this issue, as this is one of the reason we are having trouble fully migrating to TestComplete 7.5.
Motoo
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2010
02:49 AM
01-14-2010
02:49 AM
By the way, can we get some idea of when this bug may be fixed?
This is one of the biggest reason that we are not fully able to convert to 7.5 from 6.5. If the fix will not be available soon, we'll have to think of the way around it.
Thanks,
Motoo
This is one of the biggest reason that we are not fully able to convert to 7.5 from 6.5. If the fix will not be available soon, we'll have to think of the way around it.
Thanks,
Motoo
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2010
10:20 PM
01-14-2010
10:20 PM
Hi Motoo,
Let me quote the Clipboard.GetDataObject Method MSDN article:
The Clipboard class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your Main method is marked with the STAThreadAttribute attribute.
So, to avoid the problem, you need to set the Preferred apartment model of the calling thread CLR Bridge option to Single-threaded apartment. See the Project Properties - CLR Bridge Options help topic for details.
I hope this helps.
--
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2010
01:40 AM
01-25-2010
01:40 AM
Thanks. That seemed to have solved the issue. Now I can see the clipboard data as I did in the previous version of TestComplete.
Motoo
Motoo
