473,414 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Threads, Processes .NET 2.0 - Drag and Drop Registration

1
Hi, I have a Drag and Drop registration problem (See http://www.thescripts.com/forum/thread434707.html for similar problem post), can anyone out thereadvise on the best solution?
I have a .NET 2.0 application (actually in C#) called from a third party piece of software via VBScript. The VB script passes an object as a parameter which my application applies changes to.
My C# application dynamically creates a form, which includes controls extended from the RichTextBoxControl. These controls need to support drag and drop.
I also need to ensure that the calling application can not receive mouse/keyboard events until my application stops.

If I call my application directly from the VB script I get a drag and Drop registration exception.

I have tried starting my application via a bridging application which starts the app as a separate process (and waits for it to exit) - my app works OK but I can't pass the required parameter using this method.

I have also tried the following code to create my form in a new STA thread:
//public method called via VB script
public void launchApp(object oParam)
{
Thread t = new Thread(new ParameterizedThreadStart(formCreator));
t.SetApartmentState(ApartmentState.STA);
t.Start(oParam);

}

//Form creator in separate thread to avoid Drag Drop registration problems
static public void formCreator(object oParam)
{
frmMyDynamicForm frm = new frmMyDynamicForm(oParam);
frm.ShowDialog();
}

This has two problems.
1. Although I don't get Drag and Drop regestration exception, drag and drop still does not work. Another form allows a drag operation to start OK, and my DragEnter event handler on my extended richTextBoxControl is called but the code " e.Effect = DragDropEffects.Link;" line is ignored and the "Can't drop" icon is displayed.
2. The calling application can get focus.

I am tearing my hair out (I have only documented a 2 of many attempted solutions), can anyone offer advice?

Any suggestions would be much appreciated. Thanks!
Aug 21 '06 #1
0 2460

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: SamSpade | last post by:
There seems to be two ways to put things on the clipboard ( I don't mean different formats): SetClipboardData and OleSetClipboard If I want to get data off the clipboard do I care how it was put...
3
by: Ajay Krishnan Thampi | last post by:
I have a slight problem implementing 'drag and drop' from a datagrid to a tree-view. I have pasted my code below. Someone please advice me on what to do...pretty blur right now. ==code== ...
2
by: Dante | last post by:
Has anyone ever successfully gotten a web deployed exe to have Drag Drop capabilities? I'm currently getting the message: An unhandled exception of type 'System.InvalidOperationException'...
2
by: Barry Moon | last post by:
Hi Can anyone give me any help with passing an object across processes, via drag and drop? I've written a custom ListView control, which supports dragging and dropping of its items. The...
0
by: Urs Vogel | last post by:
Hi I sometimes encounter an exception saying that the drag&drop registration failed. What could be the cause of this exception? I couldn't find any documentation. Any hints are appreciated,...
6
by: jojobar | last post by:
Hello, I look at the asp.net 2.0 web parts tutorial on the asp.net web site. I tried to run it under firefox browser but it did not run. If I want to use this feature in a commercial product...
3
by: Eric S. Johansson | last post by:
I have a small problem that may be best solved by dragging and dropping a mail message to an icon. But I'm honestly not sure what the data will look like from different e-mail clients. Since most...
7
by: Raj Wall | last post by:
I have threads with event handlers to watch for new files placed in directories. The handler has a Using { ... } block to process the file which is then deleted. In testing I can drag/drop FileA...
1
by: haplo | last post by:
Hello! I recently tried using threads in my winForms application in c# along with a form containing a drag& drop listbox which resulted in recieving the infamous "DragDrop registration did not...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.