Express++ Sample program - Document

This forum is for eXpress++ general support.
Message
Author
User avatar
unixkd
Posts: 571
Joined: Thu Feb 11, 2010 1:39 pm

Express++ Sample program - Document

#1 Post 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.

Wolfgang Ciriack
Posts: 481
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Express++ Sample program - Document

#2 Post 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.
_______________________
Best Regards
Wolfgang

User avatar
rdonnay
Site Admin
Posts: 4746
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Express++ Sample program - Document

#3 Post 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.
The eXpress train is coming - and it has more cars.

User avatar
unixkd
Posts: 571
Joined: Thu Feb 11, 2010 1:39 pm

Re: Express++ Sample program - Document

#4 Post 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

User avatar
RDalzell
Posts: 205
Joined: Thu Jan 28, 2010 6:57 am
Location: Alsip, Illinois USA

Re: Express++ Sample program - Document

#5 Post 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

User avatar
unixkd
Posts: 571
Joined: Thu Feb 11, 2010 1:39 pm

Re: Express++ Sample program - Document

#6 Post 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

User avatar
rdonnay
Site Admin
Posts: 4746
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Express++ Sample program - Document

#7 Post 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.
The eXpress train is coming - and it has more cars.

User avatar
rdonnay
Site Admin
Posts: 4746
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Express++ Sample program - Document

#8 Post 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.
The eXpress train is coming - and it has more cars.

User avatar
unixkd
Posts: 571
Joined: Thu Feb 11, 2010 1:39 pm

Re: Express++ Sample program - Document

#9 Post 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

User avatar
Auge_Ohr
Posts: 1422
Joined: Wed Feb 24, 2010 3:44 pm

Re: Express++ Sample program - Document

#10 Post 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 882 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 ;)
greetings by OHR
Jimmy

Post Reply