Latest version of the Calendar API with VB6

760 views
Skip to first unread message

Martin Teefy

unread,
Oct 22, 2013, 4:53:32 AM10/22/13
to google-ca...@googlegroups.com
Hi,
 
Using a sample VB6 project I found on a french web-site quite a while ago, i'd enhanced my rich VB6 environment to use the gcalendar as well as exchange.
 
I've just released that the version/methods I'm using is being switch off Nov 2014!!
 
So can anybody advise me on the syntax to switch to?
 
I use the following:
 
Function GooAuthentification(stEmail As String, stPassword As String) As Boolean
Dim stURl As String
Dim stSource As String
Dim stFormData As String
Dim stHeaders As String
   
    stSource = App.CompanyName & "-" & App.EXEName & "-" & App.Major & "." & App.Minor
    stURl = "https://www.google.com/accounts/ClientLogin"
    stFormData = "Email=" & stEmail & "&Passwd=" & stPassword & "&source=" & stSource & "&service=cl"
    stHeaders = "Content-Type:application/x-www-form-urlencoded GData-Version: 2.1"
   
    mInet.Execute stURl, "POST", stFormData, stHeaders
   
    'Mise à 0 flag d'attente réponse
    bFinAttente = False
    Do Until bFinAttente = True
        DoEvents
    Loop
    
    FrmDebug.txtResponse = "Authentication Response:" & _
                            vbCrLf & vbCrLf & _
                            stReponse
       
    If InStr(1, stRetHeader, "200 OK") > 0 Then
        stAuthCode = Right(stReponse, Len(stReponse) - InStrRev(stReponse, "Auth=") - 4)
        GooAuthentification = True
    Else
        GooAuthentification = False
    End If
End Function
'
'  Post d'un message avec code d'identification.
'
Function GooEnvoi(stCde As String, stURl As String, Optional stFormData As String = "", Optional stETAG As String = "") As Boolean
   
    Dim stHeaders As String
    Select Case stCde
        Case "DELETE", "PUT"
            stHeaders = "Authorization: GoogleLogin auth=" & stAuthCode & _
                        "Content-Type:application/atom+xml" & vbCrLf & _
                        "GData-Version: 2.1" & vbCrLf & _
                        "If-Match: " & stETAG
        Case Else
            stHeaders = "Authorization: GoogleLogin auth=" & stAuthCode & _
                        "Content-Type:application/atom+xml" & vbCrLf & _
                        "GData-Version: 2.1"
    End Select
   
    bFinAttente = False
    mInet.Execute stURl, stCde, stFormData, stHeaders
    Do Until bFinAttente = True
        DoEvents
    Loop
    GooEnvoi = Mid(stRetHeader, 10, 2) = "20"
       
End Function
 
Many Thanks
Martin
 

Jon Taramona

unread,
Nov 20, 2014, 5:42:29 AM11/20/14
to google-ca...@googlegroups.com
 
Did you get any answer? Please let me know, I have the same problem.
 

Jordi Garcia

unread,
Nov 27, 2014, 5:28:33 PM11/27/14
to google-ca...@googlegroups.com
I too have the same problem , please help !!

El dimarts 22 d’octubre de 2013 10:53:32 UTC+2, Martin Teefy va escriure:

Lucia Fedorova

unread,
Dec 1, 2014, 5:52:06 PM12/1/14
to google-ca...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages