Click here to Skip to main content
14,428,408 members

Why is the main form dragdrop event being executed twice - VB.2017 on windows 7?

QuickBooksDev asked:

Open original thread
We have a VB.2017 Windows Form Desktop app that has been running for over a year but we noticed that when running on our client's machine, Windows 7 Pro, that the main form DragDrop event is entered twice. The 2nd time the first event is still in control based on our logs.

This does NOT happen on the development machine which is Windows 10 Enterprise. Not in the IDE nor when executed from the exe in the deployed deployed folder.

Client log shows.

Main Form DragDrop Event entered first time file name passed
Main Form DragDrop Event entered Second Time no file names passed so exits event
filenamesAR = e.Data.GetData(DataFormats.FileDrop) is nothing then it exists

--- code gets a Object reference not set to an instance of an object but not sure where ---
Main Form DragDrop Event Exit
Main Form DragDrop Event Exit

This is impossible to debug if the events are invoked differently.

So the question is why is the event getting invoked twice on the client's Windows 7 machine but not on the development Windows 10 machine.

Any help is appreciated. Thanks

What I have tried:

Break Points, Log Entries and anything else that I can think. Running it on a Windows 7 machine here is extremely difficult due to the other requirements on the App.
Tags: VB.NET, Windows


When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100