Page 1 of 2

Express++ Sample program - Document

Posted: Thu Jul 07, 2011 4:24 am
by unixkd
Dear Roger

The express++ Document sample program is an invaluable routine use by most of my clients. I use Xbase SL1 and Express 255. Prior to this version of express, I can drag multiple external files to the document browse. This is no longer working please run this sample and make necessary amendments.

Re: Express++ Sample program - Document

Posted: Thu Jul 07, 2011 10:28 am
by Wolfgang Ciriack
You can do it by yourself. You only have to add a Field RECORD_ID (C, 20, 0) to the DATA\customer.dbf. Save the CDX-File before changing, than copy it back and do an reindex, thats all.

Re: Express++ Sample program - Document

Posted: Thu Jul 07, 2011 8:06 pm
by rdonnay
I realized that it was no longer working because somehow the customer database structure got changed.

I fixed this for the next release.

You need to add the RECORD_ID field as Wolfgang suggested.

Re: Express++ Sample program - Document

Posted: Thu Jul 07, 2011 11:42 pm
by unixkd
The issue I am concern with is DRAG and DROP implemented via DCBROWSECOL ... EVAL bDragDrop no longer working. I have been using this routine for more than one year and I know those stuff about RECORD_ID, C, 20, 0. The drag and drop no longer work, that is what Iam interested in. I also discover that DCBROWSECOL now has DRAG ... DROP but I do not know how to implement it to drag external file like Excel , PDF, etc that I normally save in the database.

Thanks.

J.O. Owoyemi

Re: Express++ Sample program - Document

Posted: Fri Jul 08, 2011 7:41 am
by RDalzell
You may want to review your code, I too am using SL1 and 255 and it operates correctly in one of my apps.
Although I have another for which the drag and drop does not and has eluded me for the past year as to why. :doh:

I also know that Roger's example of Bobby's application for drag & drop also works properly (thus the DCBROWSCOL is correct).

Does Roger's document example program operate correctly?

Rick

Re: Express++ Sample program - Document

Posted: Fri Jul 08, 2011 10:02 am
by unixkd
The Roger's document is NOT operating correctly too. I tried it. The DRAG and DROP is not working but all other thing operate correctly.

J.O. Owoyemi

Re: Express++ Sample program - Document

Posted: Fri Jul 08, 2011 11:15 am
by rdonnay
I just tried all of my drag/drop samples and applications on my new computer with Windows 7.

It appears that dragging from Explorer to an Xbase++ windows no longer works under Windows 7.
This is going to take some research.

Re: Express++ Sample program - Document

Posted: Fri Jul 08, 2011 11:41 am
by rdonnay
I have discovered that the drag/drop problem occurs only when running the application from a command prompt. It works ok when the app is run from a desktop shortcut.

Re: Express++ Sample program - Document

Posted: Fri Jul 08, 2011 2:21 pm
by unixkd
YES Roger you are quite right. NOW what resulted in the application behaving differently when run from command prompt and when run from desktop shortcut. Is it a Xbase++ problem or Windows Os problem. Any fixation insight ?

Meanwhile, I really appreciate your excellent discovery.

Thanks

J.O. Owoyemi

Re: Express++ Sample program - Document

Posted: Fri Jul 08, 2011 4:13 pm
by Auge_Ohr
unixkd wrote:... but I do not know how to implement it to drag external file like Excel , PDF, etc that I normally save in the database.
i donĀ“t think you can DragDrop to a "external" Application with "pure" Xbase++ ...

Xbase++ just have o:DropZone so i would check

Code: Select all

METHOD Document:handleDragDrop(aState, oData, oXbp )
...
aDropFiles := oData:getData(XBPCLPBRD_FILELIST)
if you got anything in Array






as i understand it use DROPFILES Structure http://msdn.microsoft.com/en-us/library ... 85%29.aspx

Code: Select all

Sample use Ot4xb LIB

#include "ot4xb.ch"
#include "winuser_constants.ch"
//----------------------------------------------------------------
proc main
local hWnd := SetAppWindow():GetHWnd()

ot4xb_subclasswindow(hWnd,MyHandler(),NIL,"Drop_wndproc")
delegated_eval( {||@shell32:DragAcceptFiles(hWnd,1)} )

while inkey(0) != 27
end

return
//----------------------------------------------------------------
CLASS MyHandler
EXPORTED:
INLINE CLASS METHOD Drop_wndproc(hWnd,nMsg,wp,lp)
local p,cb,aFiles,n,nn
if nMsg == WM_DROPFILES
   nn := @shell32:DragQueryFileA(wp,-1,0,0)
   if nn > 0
      aFiles := Array(nn)
      p := _xgrab(260)
      for n := 1 to nn
         cb := @shell32:DragQueryFileA(wp,n-1,p,260)
         aFiles[n] := PeekStr(p,,cb)
      next
      _xfree(p)
      ? aFiles
      // or PostAppEvent(custom_event, aFiles,, oXbp)
   end
   return NIL
end
return NIL
ENDCLASS
DROPFILES.ZIP
using DROPFILES Structure and ot4xb
(211.66 KiB) Downloaded 883 times
try attach Sample Drop2.EXE and "Drop" something "into" Crt-Box.
i include Sample Drag2.EXE. try "from" Crt-Box to "Drag" into "open" Notepad or CMD-Box.

it show the "limitation" of DROPFILES Structure while you can NOT "send" it like this

Code: Select all

SendMessageA(nHandle_Of_Other,WM_DROPFILES,DropFiles,0)
as Pablo and Michael told me.
the best way to drop files will be use the standard ole drag & drop by implementing a IDataObject and IDropSource interfaces using ot4xb or cockpit
... but perhaps a "Trick" will do it. it will work if you "external" Application accept Crtl-V ;)