login about faq

I wrote some code to generate FoxPro .prg templates for the ActiveX events. They are available here: http://chilkatdownload.com/chilkat_foxpro_prg.zip

Note: This was updated for v9.5.0.58 on 7-Jul-2016. The TextData and BinaryData events are new and must be present. However, they are not yet called by anything in this version. These events are added to pave the way for future functionality..

An example of the Ftp2 events is shown here:

ftp2EventHandler = CREATEOBJECT("MyFtp2Events")
loFtp2 = CreateObject("Chilkat_9_5_0.Ftp2")
EVENTHANDLER(loFtp2,ftp2EventHandler)

DEFINE CLASS MyFtp2Events AS SESSION OLEPUBLIC IMPLEMENTS _IChilkatFtp2Events IN "Chilkat_9_5_0.Ftp2"

PROCEDURE _IChilkatFtp2Events_AbortCheck(abort As Number) ? "AbortCheck" ENDPROC

PROCEDURE _IChilkatFtp2Events_BeginDownloadFile(path As String, nSkip As Number) ? "BeginDownloadFile" ENDPROC

PROCEDURE _IChilkatFtp2Events_BeginUploadFile(path As String, nSkip As Number) ? "BeginUploadFile" ENDPROC

PROCEDURE _IChilkatFtp2Events_BinaryData(data As Variant) ? "BinaryData" ENDPROC

PROCEDURE _IChilkatFtp2Events_DownloadRate(byteCount As Number, bytesPerSec As Number) ? "DownloadRate" ENDPROC

PROCEDURE _IChilkatFtp2Events_EndDownloadFile(path As String, byteCount As Number) ? "EndDownloadFile" ENDPROC

PROCEDURE _IChilkatFtp2Events_EndUploadFile(path As String, byteCount As Number) ? "EndUploadFile" ENDPROC

PROCEDURE _IChilkatFtp2Events_PercentDone(pctDone As Number, abort As Number) ? "PercentDone" ENDPROC

PROCEDURE _IChilkatFtp2Events_ProgressInfo(name As String, value As String) ? "ProgressInfo" ENDPROC

PROCEDURE _IChilkatFtp2Events_TaskCompleted(task As Generic) ? "TaskCompleted" ENDPROC

PROCEDURE _IChilkatFtp2Events_TextData(data As String) ? "TextData" ENDPROC

PROCEDURE _IChilkatFtp2Events_UploadRate(byteCount As Number, bytesPerSec As Number) ? "UploadRate" ENDPROC

PROCEDURE _IChilkatFtp2Events_VerifyDeleteDir(path As String, nSkip As Number) ? "VerifyDeleteDir" ENDPROC

PROCEDURE _IChilkatFtp2Events_VerifyDeleteFile(path As String, nSkip As Number) ? "VerifyDeleteFile" ENDPROC

PROCEDURE _IChilkatFtp2Events_VerifyDownloadDir(path As String, nSkip As Number) ? "VerifyDownloadDir" ENDPROC

PROCEDURE _IChilkatFtp2Events_VerifyUploadDir(path As String, nSkip As Number) ? "VerifyUploadDir" ENDPROC

ENDDEFINE

asked Apr 11 at 13:01

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

edited Sep 06 at 13:30


12next page »

Please post here if you find any mistakes or problems.

link

answered Apr 11 at 13:02

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Thank you a lot, but i have your source originaly used and got error: Interface _CHILKATFTP2EVENTS not found

I tried IMPLEMENT as you: IMPLEMENTS _ChilkatFtp2Events IN "Chilkat_9_5_0.Ftp2" and IMPLEMENTS _ChilkatFtp2Events IN "E:VFPTOOLSChilkatAx-9.5.0-win32ChilkatAx-9.5.0-win32.dll" no success

The ChilkatActiveXCehck is ok: CLSID: {32BD32D3-66EA-4EE6-A684-20CE86F757C1} DLL path: E:VFPTOOLSChilkatAx-9.5.0-win32ChilkatAx-9.5.0-win32.dll Chilkatversion: 9.5.0.56

The key problem seems to be the IMPLEMENT, but I have absolut no idea where...

but.. thanx again for first help

Stefan

link

answered Apr 11 at 15:30

Flashlight's gravatar image

Flashlight
1

I'm sorry for the mistake -- it should be "_IChilkatFtp2Events". The "I" was missing. I'm going to regenerate all of the .prg files and re-upload. I'm also going to edit the original post here to include the "I".

Also.. most Chilkat classes only use the standard events: AbortCheck, PercentDone, ProgressInfo, TaskCompleted. In fact, all future Chilkat classes will only use standard events. The .prg files for the classes that use standard events also were in error. I'll post here when the new build is ready.

link

answered Apr 12 at 10:02

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

OK.. the .prg code generation was fixed and the new .prg files are uploaded to http://chilkatdownload.com/chilkat_foxpro_prg.zip

link

answered Apr 12 at 10:14

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

edited Sep 06 at 13:30

Thank you for posting this. I tried the HTTP events class doing a QuickGetStr call and ran into the following issues with Http being added to certain event names:

  • Event _IChilkatHttpEvents_HttpBeginReceive should be named _IChilkatHttpEvents_BeginReceive
  • Event _IChilkatHttpEvents_HttpBeginSend should be named _IChilkatHttpEvents_BeginSend
  • Event _IChilkatHttpEvents_HttpEndReceive should be named _IChilkatHttpEvents_EndReceive
  • Event _IChilkatHttpEvents_HttpEndSend should be named _IChilkatHttpEvents_EndSend

There are other events that have HTTP in front of them, but they did not error out for me - might want to double-check.

Also

  • Event _IChilkatHttpEvents_BeginSend requires two numeric parameters that are not defined. Not sure what they are.

Thanks, Andy

link

answered Apr 14 at 09:59

agoeddeke's gravatar image

agoeddeke
12

Here is what I came up with for HTTP. All this seems to work fine. Again, I didn't know the BeginSend parameters so I added these as X and Y:

DEFINE CLASS MyHttpEvents AS SESSION OLEPUBLIC
IMPLEMENTS _IChilkatHttpEvents IN "Chilkat_9_5_0.Http"

PROCEDURE _IChilkatHttpEvents_AbortCheck(abort AS Number) AS VOID
    ? "AbortCheck"
ENDPROC

PROCEDURE _IChilkatHttpEvents_PercentDone(percent AS Number, abort AS Number) AS VOID
    ? "PercentDone"
ENDPROC

PROCEDURE _IChilkatHttpEvents_ProgressInfo(name AS STRING, value AS STRING) AS VOID
    ? "ProgressInfo"
ENDPROC

PROCEDURE _IChilkatHttpEvents_BeginReceive() AS VOID
    ? "BeginReceive"
ENDPROC

PROCEDURE _IChilkatHttpEvents_EndSend(success AS Number) AS VOID
    ? "EndSend"
ENDPROC

PROCEDURE _IChilkatHttpEvents_EndReceive(success AS Number) AS VOID
    ? "EndReceive"
ENDPROC

PROCEDURE _IChilkatHttpEvents_HttpChunked() AS VOID
    ? "HttpChunked"
ENDPROC

PROCEDURE _IChilkatHttpEvents_HttpRedirect(originalUrl AS STRING, newUrl AS STRING, abort AS Number) AS VOID
    ? "HttpRedirect"
ENDPROC

PROCEDURE _IChilkatHttpEvents_BeginSend(x AS Number, y AS Number) AS VOID
    ? "BeginSend"
ENDPROC

PROCEDURE _IChilkatHttpEvents_ReceiveRate(byteCount AS Number, bytesPerSec AS Number) AS VOID
    ? "ReceiveRate"
ENDPROC

PROCEDURE _IChilkatHttpEvents_TaskCompleted(task AS VARIANT) AS VOID
    ? "TaskCompleted"
ENDPROC

ENDDEFINE
link

answered Apr 14 at 10:23

agoeddeke's gravatar image

agoeddeke
12

Thanks! I'm sorting this out and will fix and re-upload the .zip containing the .prg files.

One note: The standard Chilkat events are: AbortCheck, PercentDone, ProgressInfo, and TaskCompleted. All future Chilkat classes will only use the standard events. (Perhaps in the future, more standard events will be added, and if so, they would apply across-the-board to all classes.) Eventually, the non-standard events will be replaced by standard events. For example, instead of a custom BeginReceive event, it will be a ProgressInfo event w/ the name "BeginReceive". There will be a period of time where this is noted in the documentation, and also where the BeginReceive is fired both as a ProgressInfo and as the custom event.

link

answered Apr 14 at 10:27

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Thank you. I don't have an immediate need for implementing these events - just exploring for now. I appreciate the continued support for Foxpro!

Andy

link

answered Apr 14 at 10:33

agoeddeke's gravatar image

agoeddeke
12

I made the fix and re-uploaded the .zip containing the .prg files.

I did not find that the BeginSend should have 2 args. According to everything I see, it should be 0 args. (I know it's possible I'm incorrect, but I just haven't discovered how yet..)

Here's what the IDL for the HTTP events looks like:

    // _IChilkatHttpEvents
    [
        uuid(A02D931E-49CC-4D6F-85F5-2D74AB061990),
        helpstring("_IChilkatHttpEvents Interface v9.5.0")
    ]
    dispinterface _IChilkatHttpEvents
    {
        properties:
        methods:
            [id(1), helpstring("method AbortCheck")] HRESULT AbortCheck([out] long* abort);
            [id(2), helpstring("method PercentDone")] HRESULT PercentDone([in] long percent, [out] long* abort);
            [id(3), helpstring("method ProgressInfo")] HRESULT ProgressInfo([in] BSTR name, [in] BSTR value);
        [id(4), helpstring("method BeginReceive")] HRESULT BeginReceive();
        [id(5), helpstring("method EndSend")] HRESULT EndSend([in] long success);
        [id(6), helpstring("method EndReceive")] HRESULT EndReceive([in] long success);
        [id(7), helpstring("method HttpChunked")] HRESULT HttpChunked();
        [id(8), helpstring("method HttpRedirect")] HRESULT HttpRedirect([in] BSTR originalUrl, [in] BSTR newUrl, [out] long *abort);
        [id(9), helpstring("method BeginSend")] HRESULT BeginSend();
        [id(10), helpstring("method ReceiveRate")] HRESULT ReceiveRate([in] long byteCount, [in] long bytesPerSec);
            [id(20), helpstring("method TaskCompleted")] HRESULT TaskCompleted([in] IChilkatTask *task);
    };
link

answered Apr 14 at 10:51

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Right. I don't see anything supporting the args either, but when I implement the events with HTTP.QuickGetStr I get the error "No Parameter Statement is Found" when the BeginSend fires. And when I add the two args there is no error.

Andy

link

answered Apr 14 at 11:02

agoeddeke's gravatar image

agoeddeke
12

Thanks! Yes, that's really strange. I'll continue looking at it later today.

(Apr 14 at 11:06) chilkat ♦♦

I had a hunch, took a look, and found the problem. The id passed in the internal connection point code did not match what was in the IDL for that method. I'll try to provide a new pre-release build of the ActiveX later today.

(Apr 14 at 11:13) chilkat ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×19
×18
×1

Asked: Apr 11 at 13:01

Seen: 927 times

Last updated: Sep 06 at 13:30

powered by OSQA