KGunder
2014-07-09T12:21:18Z
Using iGrid 5.0.0.74 in an Access 2010 Application

when declaring
Private WithEvents c_Grid As iGrid500_10Tec.iGrid

The Events needs a reference to a VBRUN.DataObject:
Private Sub c_Grid_OLEStartDrag(Data As VBRUN.DataObject, AllowedEffects As Long)

VBRUN is declared in C:\Windows\SysWow64\MSVBVM60.DLL "Visual Basic For Applications"

but In Access 2010 there is already a "Visual Basic For Applications" C:\PROGRA~2\COMMON~1\MICROS~1\VBA\VBA7\VBE7.DLL

How can I solve this conflict ?

Best Regards

Klaus
Igor/10Tec
2014-07-14T14:47:53Z
I guess we should not classify it as a bug. iGrid's OLEStartDrag event is designated for Visual Basic, but not for MS Office VBA that does not support OLE drag-n-drop. The VBRUN.DataObject type is really declared in MSVBVM60.DLL which is the main part of the VB6 runtime.
KGunder
2014-07-15T14:21:35Z
Hi Igor,

it wasn't meant to be classified as a bug, it is more that I'm asking for a change request ;-)
Reason:

when you add iGrid to a form and use the VBA Editor to add an Event for OLEStartDrag, it will insert:
Private Sub iGrid_OLEStartDrag(Data As Object, AllowedEffects As Long)

but if you declare iGrid as a local Variable, e.g.
Private WithEvents c_Grid As iGrid500_10Tec.iGrid
you have to use the signature:
Private Sub c_Grid_OLEStartDrag(Data As VBRUN.DataObject, AllowedEffects As Long)

So I am asking, if it would be possible to change the definition to always using "Data As Object",
so that using DragDrop with your control in MS Office would be easier.


PS: Using a TreeView Control, the definition for OLEStartDrag is:
Private Sub tv_OLEStartDrag(Data As MSComctlLib.DataObject, AllowedEffects As Long)

which would be fine too, as it does not collide with VBA.

Best regards

Klaus
Igor/10Tec
2014-07-15T15:21:50Z
You defined the original question status as an issue ;)

Well, the event stub

Private Sub iGrid_OLEStartDrag(Data As Object, AllowedEffects As Long)

is not generated by iGrid, the VBA editor automatically inserts it based on the types provided by iGrid and its internal logic. You or me cannot control this.

If we talk about the TreeView control from the MS Common Controls pack, its DataObject is defined in another object library, not the VB6 runtime, and that's why you see MSComctlLib.DataObject in the event syntax.

By the way, can you really use the OLE Drag-n-drop in the TreeView in MS Access? I mean does it really work like in VB6?
KGunder
2014-07-16T10:48:02Z
> If we talk about the TreeView control from the MS Common Controls pack, its DataObject is defined in another object library,
> not the VB6 runtime, and that's why you see MSComctlLib.DataObject in the event syntax.

Aren't those not the same definition of a DataObject ??

> By the way, can you really use the OLE Drag-n-drop in the TreeView in MS Access? I mean does it really work like in VB6?

Yes!
But I am trying to replace the TreeView Control with the iGrid Control, as iGrid has more styling functionalities !
( different BackColor for Rows/Cells )
( but struggling a little bit getting all row data in the same column grid, it would be nice if a longer text in a cell
could overflow to the next cell and not get clipped at the column boundary ๐Ÿ˜‰ )
Igor/10Tec
2014-07-16T10:53:26Z
These are two different DataObjects - one from VBRUN, the other from MSComCtlLib (as the object prefixes imply ๐Ÿ˜‰
Oliver
2014-08-05T10:39:07Z
Originally Posted by: KGunder 


> By the way, can you really use the OLE Drag-n-drop in the TreeView in MS Access? I mean does it really work like in VB6?

Yes!
But I am trying to replace the TreeView Control with the iGrid Control, as iGrid has more styling functionalities !



Hello KGunder

I'm trying to get this working too. I want to replace a Listview with iGrid that currently supports some Drag and Drop. Did you get that to work as long as you are handling the event coming from the control, not the object? (Using the Object declaration for parameters)

Kind Regards,
Oliver
Igor/10Tec
2016-11-24T12:59:18Z
Our customer, Eckhard Petersen, sent us his solution to this problem. We publish the pertinent part of our email correspondence with some minor corrections below with the customer's consent.

ๅผ•็”จ:

It is known that the iGrid.OLEDrag method does not raise the OLEStartDrag event in MS Access, and all iGrid OLE-events need the VBRUN.DataObject that you canโ€˜t use in VBA (there is a conflict with VBE7.DLL).

I thought that OLE-Drag-n-drop is not possible in Access VBA because of this.

I found out, iGrid.object in combination with the directive

References.AddFromFile "c:\windows\SysWow64\msvbvm60.dll\3"

allowed me to use OLE-Drag-n-Drop the known way (see the attached file).



Below is the MS Access sample implemented by Eckhard Petersen:

  Drag_Drop_wo_xGrid.zip (79kb) downloaded 267 time(s).