Release Filefolder Lock When Using Dragdrop Onto Control

Dec 12, 2010

I'm trying to loop through a list of files to get the path and filename. These files are dragged onto a datagrid:

[Code]...

View 1 Replies


ADVERTISEMENT

.net - Release A File Lock On A COM DLL That Has Been Instantiated Via `CreateObject`?

Dec 21, 2011

I have a .Net 4 WinForms app that generates a DLL, calls CreateObject on the generated DLL then calls one of several methods that the DLL contains. The DLL is eventually used by a separate app. This WinForms app is just to generate and test the DLL hence why it can generate the DLL multiple times.The problem lies in the fact that calling CreateObject on the DLL locks the file to the process. The next time the DLL is generated it can't overwrite the previous DLL file on disk without closing the app completely and starting it again.

I've tried Marshal.ReleaseComObject, executing the CreateObject in a separate AppDomain, even setting the variable holding the COM object to a different COM object via CreateObject, manually calling GC.Collect() and a whole host of other things but none result in unlocking the file.The code flow is basically (simplified and generic names, etc.):

...
' Compile and generate DLL that is COM enabled and works fine
...
Dim foo As Object = CreateObject("Bar.Foo")

[code]....

is there a way to release a file lock on a COM DLL that has been instantiated via CreateObject without killing the process?

Note: this is a continuation of this original issue. I now have the DLL registering without locking the file but now the issue is with the CreateObject call not the DLL registration.

View 1 Replies

Release MS Access LDB Lock File After Created It?

Feb 17, 2012

I have difficulty in removing the LDB generated by the "CREATE" method of ADOX in the following code segment.Aims: Create (on the fly) a new access database and then export data (says Arena modules) to that newly created database.

Expected: The newly created access database should be able to be used by some external operations, say Access.exe, after the end of the subroutine and without exiting the current VB program.

1) I tested that the "Arena code" do nothing about the create/release of the ldb file.

2) I tested the "Exclusive Mode" in connection string, but the access file is still locked by the vb program.

3) I tested under both inside the VB environment, and directly invoke the generated from Explorer, and same results.

4) Other database formats is not the options to me. (due to Arena export limit)

5) It is not a web app.

Code:

Sub Method1()
Dim logs As New System.Collections.Generic.List(Of String)
Dim arenaApp As Arena.Application = Nothing
Try

[code]....

Platform:

Windows 7 64bit, Office 2010 (32)
VB 2010 express
Lib: MS ADO Ext. 2.8 for DDL and Security

View 1 Replies

.net - Event Fired In Dragdrop Source When Dragdrop Is Completed Or Cancelled?

Nov 28, 2011

I know that there is usually a DoDragDrop method that starts a drag and drop operation. And that there are events (such as DragEnter, DragOver, DragDrop, DragLeave) that can be handled on the target side.

Are there any events on the source of the dragdrop that will tell me whether the dragdrop operation was completed, or possibly cancelled?

View 2 Replies

DragDrop Control - Fails To Copy Files?

Mar 10, 2009

I am new to vb.net and development in general. The basics are I have a control that accepts dragdrop, I use this control to drag files onto - based upon the text contained in a combobox the directory path is built in the dragdrop event, and I initiate System.IO.File.Copy. I then refresh my listview, which is working well and is listing files based upon the content of a directory. Here is my code for the dragenter and dragdrop subs

Private Sub pnlDataDrop_DragEnter(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles pnlDataDrop.DragEnter
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
e.Effect = DragDropEffects.Copy
[Code] .....

I have added some break points so that I can see the values for targetpath and myfiles(), and all looks ok. The app is in its very early stages, so I am only testing in the development environment at the moment. So you know, the targetpath is a UNC: \myservermydirectory.

View 2 Replies

Release An Mdb File's File Lock Protection?

Aug 22, 2006

.NET 1.1VB 2003i have create a program where the program will dynamically create a mdb file, create a table, then populate the table via ADOX.dll using com interop.After populating the table i would like to FTP the said file to some FTP folder, to my dismay everytime i try to upload the mdb file i always get 0 kb, then i found out that the mdb file is "FILE-LOCKED" by some unknown process, but i dont know why because i have manually released all the resources that has been used, here is my code

[Code]...

View 6 Replies

Release Configuration Mode - Custom Control Losing Property Settings

Jun 27, 2011

I have a custom control that as a custom property. The property has several preset values to chose from a drop down. The control can be added to a form. The property can be viewed and set in the properties box in the IDE. It all works fine.

Here's the problem: I can create new versions and recompile the control and/or the application without the properties preset value being lost as long as I do it in Debug mode. However, once I try to recompile in Release mode the custom property values predefined setting is lost. I first thought it was something with going from debug mode to release mode. But it seems to be ANY time I recompile in Release mode the custom property values are lost. Is this a quirk in VS that needs a configuration setting, etc. to get around it?

View 3 Replies

Gridview Control - Files Are Being Lock - Unable Rename Them

Oct 26, 2009

In the attached project when I load the files in datatable and then try to add images without using the "Dispose" method the datagridview does not showing it correctly and when I load images with "Dispose" method then everything is showing correctly but the files are being lock and i am unable rename them...

View 5 Replies

ListView DragDrop To Explorer?

Jul 2, 2009

I'm looking for a way to click and drag an item out of a listview, and get the explorer path I dropped the file on, so I can write data to that location.

View 1 Replies

Treeview Dragdrop To Richtextbox?

Apr 5, 2010

i have to forms, one with a RTB on it, the other with a treeview on it.I want to be able to drag a image from the treeview over to my rich text box.Basicly like a clip art window.The treeview nodes have a short description of the image (e.g Dog) then a picture of a dog next to it. I want then to be able to drag that into my rich text box, and the picture of the dog to appear.Is there a easy way to do this?

View 2 Replies

Why Can't Get .DragDrop Event To Fire

Mar 25, 2010

I am trying to drag and drop items from a listbox into a richtextbox? I can not get the .DragDrop event to fire? I have copied and past the code from [URL]

I can get the .DragEnter event to fire. The mousedown event fires the drag and drop, is there something for mouseup?

View 1 Replies

[2008] DataGridView DragDrop Into New Row?

Jan 15, 2009

I am dragging and dropping values from a listview to a datagridview cell.In the datagridview I have AllowUserToAddRows = True because I want them to drag in as many items as they need.

The problem is that when I drag an item into the new row a newer row is not created below it as it would if I had typed something int he cell and left.

I tried to add a new row on the CellValueChanged event but that inserts a row above the row that I just dragged to.

Anyone know how to trigger that event after a drag and drop?

View 8 Replies

Move FlowPanelLayout Controls Via DragDrop

Apr 23, 2012

I have a FlowPanelLayout that can contain several UserControls called DataGridViewFilterSortElement. These controls look kind of like buttons, but different. I want the user to be able to click one of the DataGridViewFilterSortElement controls and drag it to another position (index) in the FlowLayoutPanel. Is there a way to see the control physically moving as the user drags it to another position? In other words, is there a way to take a "snap shot" of the control that is being dragged (instead of a shadowed box) which would show the actual control moving as the cursor moves?

Also, as the control is being dragged I'd like to have the other controls position to shift automatically instead of waiting for the user to drop the drag to see the shifts. For example, let's say the FlowPanelLayout contains 3 controls and the user wants to drag the first control to the third controls position. So the user clicks and holds the first DataGridViewFilterSortElement, then drags over the second control, which causes the second control to shift to position 1 of 3, then the user drags over the third control, which causes the third control to shift to position 2 of 3, then the user drops the control in position 3.

Here is a short little video that shows what I want to do: Video Example
Private Sub lblDescription_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown, lblDescription.MouseDown
' if the user left clicks and holds the element begin a DragDrop action
If e.Button = Windows.Forms.MouseButtons.Left Then
Me.DoDragDrop(Me, DragDropEffects.Move)
End If
End Sub
[Code] .....

View 1 Replies

TreeView DragDrop Not Working In Citrix?

Dec 10, 2009

I have a treeview dragdrop event written in VS2003. It works perfectly fine when the application is running on desktop, until we move the application to Citrix. So, users are now running it off from Citrix, the DragDrop event doesn't work anymore. It doesn't even have the effects of allowing dropping.

View 3 Replies

VS 2008 DataGridView DragDrop Indicator?

Apr 9, 2010

I'm using the following code to reorder rows, it does work but i can't find a way to implement any indicator that shows me where the row will be droped, is it possible to do? It seems that the handler DragDrop is blocked until the mouse is released..vb.net

[Code]...

View 2 Replies

[2008] DragDrop From Program To Explorer?

Mar 8, 2009

Below is a practical example of how this would be useful:A practical example would be an FTP client where a user dragdrops files to be uploaded and would naturally want to dragdrop remote files to their local folders with the intention of triggering a download of that file to the folder they dragged the listview item to.

View 2 Replies

Can't Get Any (copy) Effect - Make Dragdrop Event?

Jul 19, 2009

When I use the code below, I can't get any (copy)effect as I drag things onto the picture box(img). Therefore, I can't dragdrop files. How can I make dragdrop event possible?

[Code]....

View 2 Replies

Listview DragDrop Multiple Items Not Working?

May 6, 2008

I trying to do a drag drop from a listview in one form to another instance of the same form (same application running twice).I have it working with single items selections, but I want to make it work with multiple selections. 289508(VS.71).aspxThis works if I drag/drop onto itself (the same form), which I don't want, but I need it to work across instances.During debugging it seems the code DragDrop code just quits at the line during the drop:Dim myItems() As ListViewItem = e.Data.GetData("System.Windows.Forms.ListViewItem()")Any ideas what is wrong or how to drag/drop multiple items in a listview between apps?

here's my code:
Private Sub ListView1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListView1.DragDrop

[code]....

View 5 Replies

ListView DropHighLight (DragEnter Or DragDrop Event)

Mar 15, 2012

In old vb6.0 it was easy to highlight the target item, where to drop those dragged rows.

Private Sub listView_OLEDragOver(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single, State As Integer) Set listView.DropHighlight = listView.HitTest(x, y)

You can get the item to drop to in VB.NET:

Private Sub ListView_DragDrop(ByVal sender As Object, ByVal _
e As System.Windows.Forms.DragEventArgs) Handles _
ListView.DragDrop

[CODE]...

Now we got the index and item, where to drop. But then what? One possibility to do the HighLight is change the ListViews state to "LVIS_DROPHILITED" by sending Windows message "SendMessageA(lvw.Handle, LVIS_DROPHILITED, 0, 0)". But when is the right time to do that (DragEnter or DragDrop event) and what are the right parameters? Didn't succeed on that yet.

View 4 Replies

Drag And Drop - Change Cursor As Feedback In DragDrop

Mar 5, 2011

Working on a DragDrop application. I have a class object (built as an object) which has a GroupBox that is enabled for DragDrop.

In the class I have set it up so that the cursor will change when it enters the groupbox, leaves the groupbox, mouse is down within the groupbox and drag/drop is working. I also set up a label in the class object and changed the text in that label as well. Basically, the text changes in the label as expected including 'FEEDBACK' appearing when I am dragging the object BUT the cursor stays stubbornly as a pointer. This is tghe state of affairs either when I debug the class or when, after I build the class, it is run as part of the main program.

Here are the subs set up in the class.

Private Sub GroupBoxSourceMouseDown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBoxSource.MouseDown
GroupBoxSource.DoDragDrop(GroupBoxSource.Text, DragDropEffects.Copy)

[Code].....

View 2 Replies

Drag And Drop - Change Cursor As Feedback In DragDrop?

May 25, 2010

drag and drop - Change Cursor as Feedback in DragDrop

View 8 Replies

DragEnter And DragDrop Events Fire Multiple Times In VB?

Jul 8, 2010

I've got a research application that is hosting a webbrowser control and I'm implementing a feature that allows the user to select text from a web page and drag it to various research note fields. The issue I have is the dragenter and dragdrop events continue after the initial drop, inserting the text multiple times. Here's the test case on my box and the result.

Select Text in Browser Drag to Text Box Drop Text What happens is after the drop event is fired and the text inserted to the drop target, when you move the mouse after dropping the text, the drag enter event is fired, followed by the dragdrop event, then another dragenter and dragdrop. So, selected text such as "Selected Text" becomes "Selected TextSelected TextSelected Text".

Note: The dragenter event is properly raised once when the mouse enters the textbox, however the mouse does not have to leave the textbox after the dragdrop event fires. i thought there was something wrong with my application so I created a simple test app, containing a Webbrowser and a multi-line text box. This test app generates the same results and the code is below. This is the first time, I've implemented
drag and drop operations and I followed the guidelines noted in this MSDN article. While I did what the article suggests, I'm thinking I need to note the event was handled somewhere.

[Code]...

View 1 Replies

Forms :: Make A Textbox With Complete Support For Dragdrop?

Oct 30, 2009

I am trying to make a textbox with complete support for dragdrop, however, it doesn't work.

Private MouseIsDown As Boolean = False
Private SelectionLen As Integer
Private SelectStart As Integer

[code]....

View 1 Replies

Asp.net - DragDrop Event Not Firing On Object Inside Usercontrol (but DragEnter Does)

Feb 12, 2012

Well the title pretty well describes my problem. Here is a little bit more detailed description of my problem: I am building an application with a TabControl, which I populate at execution time with TabPages. In my first version of the code, these TabPages were filled with a children ListView. The ListView was also created in code, using AddHandlers to link it to the DragEnter and DragDrop routines. Everything worked very well... Now as I need some other controls on every TabPage, instead of creating every single control in code, I have created a UserControl containing a ListView and a few Buttons, which I instantiate for every new TabPage. The problem now is that the DragDrop event is not raised anymore

[Code]...

View 1 Replies

DoubleClick Event Not Firing When DragDrop Code Implemented (ListView)?

Aug 29, 2008

As the subject describes, once I implemented support for DragDrop - The DoubleClick event of the ListView control no longer fires.An overview of the code is as follows:

Private Sub ListView_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView.MouseMove

[code]......

View 4 Replies

VS 2010 TabControl With DragDrop Not Raising MouseClick Events On Tabs

Aug 29, 2010

I have a custom (inherited) TabControl which adds Drag/Drop functionality to it, so that one can drag the tabs around, either within the same control (to re-order them) or to and from other TabControls. I've noticed some time ago that my TabControl however was not raising its MouseClick and MouseUp events (or actually: it is not calling its OnMouseClick and OnMouseUp methods, which comes down to the same thing). I've been struggling with this problem for a long while and I finally figured out what is happening. I'm no closer to figuring out what to do about it though... The problem seems related to the drag drop functionality. I have this code in the OnMouseDown method (which is raised as usual):

[Code]...

View 10 Replies

VS 2008 Dragdrop - Check If The Present Data Type Inherits From The Base Type

Aug 20, 2009

I have a number of controls (Device1, Device2, etc.) that all inherit from BaseDeviceControl. In the DragEnter event handler I am trying to test for the correct type by using the BaseDevvceControl like this....

[Code]....

View 8 Replies

DragDrop File To Icon On Form / File Is Sent To Specified Directory

Apr 11, 2011

I want to have an icon / image of a folder on my form and I want it to operate just the same as a desktop shortcut to a directory does. If clicked, it opens directory, if file / folder is dropped onto it it sends those to the specified directory.I am however going to need to use something like this:[code]

View 8 Replies

'Release' My First Application?

Jun 18, 2010

What is the 'proper way' of giving my application to people?

Ideally I just want to zip up the minimal amount of files and for people to put this in a folder of their choice and just run it.

I've noticed from playing with a "Publish" I end up with a "setup.exe" and also a "Application Files" folder.

Within that folder are the necessary files (a DLL and a .EXE) to run my application. Can I just supply those two files out to people?

View 7 Replies

How To Release File Use

Mar 27, 2012

I'm trying to save rtf files in this manner to bin (rtb9 is the rtf control and there is button when clicked opens it):

Private Sub tempSave()
f My.Settings.rtbx = "rtb01" Then

[code].....

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved