Forum Index
Zload dll?
Goto page 1, 2, 3
 
Author Message
mdown



Joined: 03 Feb 2006
Location: Dallas, Texas

Posted: 27 June 2006, 17:31 PM    Post subject: Zload dll?

Is there an OLE DLL i can call from my windows code that would allow me to provide a very simple way to download zbasic binaries to my customers?
Zload is to difficult for end users to work with.

Thanks,

-Mike
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Location: Portland, OR

Posted: 27 June 2006, 17:40 PM    Post subject:

Not yet. What language is your Windows app written in?
Back to top
DH*
Guest




Posted: 27 June 2006, 19:27 PM    Post subject: Re: Zload dll?

mdown wrote:
Is there an OLE DLL i can call from my windows code that would allow me to provide a very simple way to download zbasic binaries to my customers? Zload is to difficult for end users to work with.

I've been asking for either a DLL or a standalone GUI app but, so far, to no avail.

In the meantime, if your main problem is with users who don't understand zload command lines you might be able to shell to zload and eliminate the need for them to deal with it. They'll still see the ugly console app, though.
Back to top
mdown



Joined: 03 Feb 2006
Location: Dallas, Texas

Posted: 27 June 2006, 20:51 PM    Post subject: Zload dll?

For this app it would be VB6 for simplicity.

I just need somthing i can send my end users that works quick and easy without having to send the zbasic gui.

-Mike
Back to top
stevech



Joined: 23 Feb 2006

Posted: 27 June 2006, 21:34 PM    Post subject:

I'd volunteer to write and contribute such a utility- similar to BLIPS that I have done for re-flashing AVRs. But I'd need the protocol specs and/or source to zload.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Location: Portland, OR

Posted: 27 June 2006, 21:45 PM    Post subject:

Can VB6 provide a callback routine? It seems to me that I read somewhere something about using AddressOf to do so. I'm thinking of an API that would supply a callback for progress updates. That way, the calling application can represent the progress in any suitable fashion.

The API might be something like the following (described in VB syntax):
Code:
Public Declare Function ZXDownload Lib "zxutil.dll" (
    ByVal lpFileName As String,
    ByVal wPort as Integer,
    ByVal lpProgress as Long,
    ByVal dwData as Long) as Integer

The value returned by the API would be a success indication or error status code. The callback would be coded something like:
Code:
Public Function UpdateDownloadProgress(
    ByVal wPercentComplete as Integer,
    ByVal dwData) As Integer
' add code to update the progress indicator here
End Function


The value returned by the callback indicates whether to continue the download or abort.
Back to top
DH*
Guest




Posted: 27 June 2006, 22:40 PM    Post subject:

dkinzer wrote:
Can VB6 provide a callback routine?

Please don't do it that way. VB4-32, which I use, cannot handle callbacks.

I prefer passing the handle of a window to which the DLL can pass back messages as I've suggested previously. If you're going to use a callback, let me know now so I can quit wasting time, effort and money on a dead-end.
Back to top
mdown



Joined: 03 Feb 2006
Location: Dallas, Texas

Posted: 27 June 2006, 22:46 PM    Post subject: Zload dll?

I'm not sure about the AddressOf operator, but if you called ZXDownload asynchronously and then looped the call to UpdateDownloadProgress if could be done that way.

Although an OLE interface with events would be nice...

-Mike
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Location: Portland, OR

Posted: 27 June 2006, 23:09 PM    Post subject: Re: Zload dll?

dhouston wrote:
Please don't do it that way. VB4-32, which I use, cannot handle callbacks. I prefer passing the handle of a window to which the DLL can pass back messages[...]

There will be an alternate API that utilizes a window handle instead of a the more general solution of using a callback.
mdown wrote:
Although an OLE interface with events would be nice...

I'll make a standard DLL and you can put an OLE wrapper around it if you'd like.
Back to top
DH*
Guest




Posted: 27 June 2006, 23:26 PM    Post subject:

stevech wrote:
I'd volunteer to write and contribute such a utility- similar to BLIPS that I have done for re-flashing AVRs. But I'd need the protocol specs and/or source to zload.

I believe the C++ source for ZLoad is included in the ZBasic package.
Back to top
DH*
Guest




Posted: 28 June 2006, 0:18 AM    Post subject: Re: Zload dll?

dkinzer wrote:
There will be an alternate API that utilizes a window handle instead of a the more general solution of using a callback.

Actually, I think a more general solution would be a standalone GUI app similar to what NetMedia gave me. I had a Download Firmware menu item in my Windows interface. When the user clicked on the menu item, I closed the serial port, shelled to the downloader, waited for it to finish and then reopened the port. I had a delay at the beginning of my BX-24 code to allow time to reopen the port. The user then saw all of the sign-on messages. It was pretty seamless and could be used from almost any programming language.

The user had to select the file and port from the downloader app's menu but this could be done on the command line. There was an INI file item for the title bar of the app. I documented its use in my user manual. You can see a copy at http://jeffvolp.home.att.net/bx24-aht/manual.pdf.

The VB4-32 code was quite simple.

Code:
Private Sub mnuBXB_Click()

   mscomm1.PortOpen = False
   WaitForProcessToEnd "BX_OEM_Downloader.exe"
   Sleep 100
   mscomm1.PortOpen = True
   
End Sub 

Public Sub WaitForProcessToEnd(cmdLine As String)
 
  Dim retVal        As Long
  Dim pID           As Long
  Dim pHandle       As Long
 
  pID = Shell(cmdLine)
  pHandle = OpenProcess(&H100000, True, pID)
  retVal = WaitForSingleObject(pHandle, -1&)
 
End Sub


Last edited by DH* on 28 June 2006, 11:45 AM; edited 1 time in total
Back to top
stevech



Joined: 23 Feb 2006

Posted: 28 June 2006, 3:08 AM    Post subject:

dhouston wrote:
stevech wrote:
I'd volunteer to write and contribute such a utility- similar to BLIPS that I have done for re-flashing AVRs. But I'd need the protocol specs and/or source to zload.

I believe the C++ source for ZLoad is included in the ZBasic package.


Right you are! Thankfully, it seems to be C rather than C++ or C#.
It needs to be GUI-ized.
And the VM side needs a way for the user program to trigger a download reception rather than as now, only via the tickle of the serial port DTR
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Location: Portland, OR

Posted: 28 June 2006, 4:32 AM    Post subject:

stevech wrote:
I'd volunteer to write and contribute such a utility- similar to BLIPS that I have done for re-flashing AVRs. But I'd need the protocol specs and/or source to zload.

You might want to hold off for a few days. The code is being refactored to make it more modular.


Last edited by dkinzer on 28 June 2006, 6:18 AM; edited 1 time in total
Back to top
stevech



Joined: 23 Feb 2006

Posted: 28 June 2006, 5:36 AM    Post subject:

oui messr
Back to top
DH*
Guest




Posted: 28 June 2006, 10:48 AM    Post subject:

stevech wrote:
dhouston wrote:
I believe the C++ source for ZLoad is included in the ZBasic package.
Right you are! Thankfully, it seems to be C rather than C++ or C#.

I misremembered that it was .cpp.
Quote:
It needs to be GUI-ized.
And the VM side needs a way for the user program to trigger a download reception rather than as now, only via the tickle of the serial port DTR

That sounds great - two birds, one stone.
Back to top
Display posts from previous:   
Page 1 of 3

 



ZBasic Microcontrollers Home
All content Copyright © 2005, 2006, 2007, 2008, 2009, 2010 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group