Page 1 of 1
Help with Chilkat
Posted: Fri Mar 17, 2023 1:04 pm
by bobvolz
I've purchased Chilkat and am attempting to use it. I downloaded the activex and ran the msi and it all looks like it is installed and registered.
I added code to include 'Activex.ch' and I added the chilkat dll to my project file-( not sure if I needed to do that.
I cannot create the object using the below code. It returns oGlob as a nil. I have oGlob as a local.
oGlob:= CreateObject('Chilkat_9_5_0.Global') /// this is in the registry. I also tried the CLSID - no good
nSuccess:= oGlob:UnlockBundle("MDOW.CB1032025_uthWzzA7BR1g")
IF (nSuccess <> 1)
? oGlob:LastErrorText()
ENDIF
Any ideas what to do or look for?
Bob Volz
Re: Help with Chilkat
Posted: Fri Mar 17, 2023 4:36 pm
by rdonnay
I don't know why this isn't working for you.
I have never used .Global.
I only have experience with .JsonObject and .Sftp.
However CreateObject('Chilkat_9_5_0.Global') does return an Automation object for me.
You don't need to add their DLL to your project file.
Re: Help with Chilkat
Posted: Sat Mar 18, 2023 3:25 am
by Tom
You must first unlock chilkat. The DLL must be visible from your app (same path). Check the version numbering. If you once unlocked Chilkat in your app, you can use it as often as you want.
It CreateObject doesn't return an object, check ComLastError().
Re: Help with Chilkat
Posted: Sat Mar 18, 2023 5:00 am
by PedroAlex
Bob,
Try This:
loGlob = CreateObject('Chilkat_9_5_0.Global')
IF Valtype( loGlob ) != 'O'
MsgBox( 'Object not Created!' )
MsgBox( 'Error : ' + Var2Char( ComLastError() ) , ComLastMessage() )
Return Nil
Endif
Note:
This type of problems occurs more frequently with Chilkat 64-bit.
If you install the 32-bit version it will run better.
Re: Help with Chilkat
Posted: Sat Mar 18, 2023 5:31 am
by skiman
Hi Bob,
I always use it the following way:
Code: Select all
oGlobal := CreateObject("Chilkat_9_5_0.Global")
oRec := CreateObject("Chilkat_9_5_0.JsonObject")
oGlobal:UnlockBundle(CHILKAT_CODE)
I don't have the DLL in my project file and the DLL isn't in my application directory. The directory where the msi file is available isn't in the PATH of the PC. After installing the Chilkat can be used everywhere.
Have you installed the Chilkat as administrator?
PS. I wouldn't post the Chikkat licence. It is valid for all versions untill Mars 2025. You should keep this secret.
Re: Help with Chilkat
Posted: Sat Mar 18, 2023 3:32 pm
by bobvolz
Thank you all. I'll keep trying. Thanks Chris, that's not my actual Chilkat code.
Bob Volz
Re: Help with Chilkat
Posted: Sun Mar 19, 2023 6:02 am
by bobvolz
Now here's a dumb question. I originally installed the 64 bit version forgetting that xBase is a 32 bit language. It did not work. I then also installed the 32 bit version. Now it works!
But... it will not work unless both the 64 bit and 32 bit dlls are in my path. I shouldn't need both correct? I'm going to start from scratch and recompile everything.
Thanks, Bob Volz
Re: Help with Chilkat
Posted: Sun Mar 19, 2023 8:57 am
by bobvolz
Hi All:
I followed and reinterpreted the FoxPro examples to get an OAuth2 token for the Google Calender See below function:
I am able to get a returned cUrl string but when I paste that into a Chrome Browser I get the attached GoogleResponse,png. Client missing project ID Authorization error
This is cUrl
https://accounts.google.com/o/oauth2/v2 ... ethod=S256
My Code: the dll is already unlocked:
Function Googletest()
LOCAL oOAuth2,nSuccess,cUrl,nNumsWaited,oSbJson,oHttp,oResp,cResponse,aHeaders
oOAuth2:=createobject('Chilkat_9_5_0.OAuth2')
oOAuth2:AuthorizationEndpoint:="
https://accounts.google.com/o/oauth2/v2/auth"
oOAuth2:ListenPort:= 55568
oOauth2:TokenEndpoint:= "
https://www.googleapis.com/oauth2/v4/token"
oOAuth2:ClientId:="
bvolz3850@gmail.com"
oOauth2:ClientSecret:="
https://calendar.google.com/calendar/ic ... /basic.ics"
oOauth2:CodeChallenge = 1
oOauth2:CodeChallengeMethod = "S256"
oOauth2:Scope = "
https://www.google.com/m8/feeds"
cUrl = oOauth2:StartAuth()
IF oOauth2:LastMethodSuccess <> 1
wtf oOauth2:LastErrorText
ENDIF
wtf oOAuth2:lastmethodSuccess
wtf cUrl pause // paste cUrl into Chrome get error message
return nil
Any ideas would be helpful. I don't see any specs for Project ID in the FoxPro examples.
Bob Volz
Re: Help with Chilkat
Posted: Mon Mar 20, 2023 3:04 am
by reganc
bobvolz wrote: ↑Sun Mar 19, 2023 8:57 am
Hi All:
I followed and reinterpreted the FoxPro examples to get an OAuth2 token for the Google Calender See below function:
I am able to get a returned cUrl string but when I paste that into a Chrome Browser I get the attached GoogleResponse,png. Client missing project ID Authorization error
This is cUrl
https://accounts.google.com/o/oauth2/v2 ... ethod=S256
My Code: the dll is already unlocked:
Function Googletest()
LOCAL oOAuth2,nSuccess,cUrl,nNumsWaited,oSbJson,oHttp,oResp,cResponse,aHeaders
oOAuth2:=createobject('Chilkat_9_5_0.OAuth2')
oOAuth2:AuthorizationEndpoint:="
https://accounts.google.com/o/oauth2/v2/auth"
oOAuth2:ListenPort:= 55568
oOauth2:TokenEndpoint:= "
https://www.googleapis.com/oauth2/v4/token"
oOAuth2:ClientId:="
bvolz3850@gmail.com"
oOauth2:ClientSecret:="
https://calendar.google.com/calendar/ic ... /basic.ics"
oOauth2:CodeChallenge = 1
oOauth2:CodeChallengeMethod = "S256"
oOauth2:Scope = "
https://www.google.com/m8/feeds"
cUrl = oOauth2:StartAuth()
IF oOauth2:LastMethodSuccess <> 1
wtf oOauth2:LastErrorText
ENDIF
wtf oOAuth2:lastmethodSuccess
wtf cUrl pause // paste cUrl into Chrome get error message
return nil
Any ideas would be helpful. I don't see any specs for Project ID in the FoxPro examples.
Bob Volz
Bob,
We use the Chilkat ActiveX library a lot here. I have used Google Feeds before (never had need to / don't know what they are) but we do send email using the Gmail API.
The ClientId and ClientSecret you have put above do not look normal. They are usually hexadecimal strings and they would normally be picked up from some page in your Google Feed account.