aXend's COMLIB

Everything else that doesn't fall into one of the other PB categories.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

aXend's COMLIB

Post by Karbon »

Does anyone happen to know where aXend went? I'd like to get a copy of his COMLIB done with the new tailbite so that it works with 3.93..

Thanks guys!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Anyone know aXend personally?
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
aXend
Enthusiast
Enthusiast
Posts: 103
Joined: Tue Oct 07, 2003 1:21 pm
Location: Netherlands

Post by aXend »

The updated version can be downloaded from http://home.planet.nl/~aXend/purebasic/COMLIB_393.zip.
User avatar
jqn
User
User
Posts: 97
Joined: Fri Oct 31, 2003 3:04 pm

Post by jqn »

2aXend:
What is COMLIB?.
I've downloaded COMLIB_393.zip, but there is no documentation included.

BR
Joaquin
aXend
Enthusiast
Enthusiast
Posts: 103
Joined: Tue Oct 07, 2003 1:21 pm
Location: Netherlands

Post by aXend »

COMLIB is a library to work with COM from PureBasic. You can find the previous version - including documentation - at http://home.planet.nl/~aXend/purebasic/COMLIB_demo.zip or at PureArea.Net. You can find discussions about it elsewhere on this forum.
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

aXend wrote:COMLIB is a library to work with COM from PureBasic. You can find the previous version - including documentation - at http://home.planet.nl/~aXend/purebasic/COMLIB_demo.zip or at PureArea.Net. You can find discussions about it elsewhere on this forum.
Hmm, just downloaded, no documentation with the link provided.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

It has been updated to work with 3.93 -- just after I modified everything to work around not having it! :-)
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
aXend
Enthusiast
Enthusiast
Posts: 103
Joined: Tue Oct 07, 2003 1:21 pm
Location: Netherlands

Post by aXend »

@Shanara: If you look at test_ado.pb you'll find explenation about COMLIB including an example to work with it. See the code below.

Code: Select all

; --------------------------------------------------------------------------------------------------------
; This is a demo program to demonstrate the use of COM from PureBasic.
;
; The zip file contains 5 items:
; - COMLIB          (library file, put it in the Userlibraries directory)
; - Variant_inc.res (resident file with definitions for VARIANTS, put it in the Residents directory)
; - Variant_inc.pb  (the pb version, use as Includefile)
; - ADODB.pb        (the Interface definitions for ADODB, use as Includefile)
; - test_ado.pb     (this demo program)
;
; COMLIB is a small library that contains 4 procedures:
;
; CreateObject(ProgID.s) - creates an object from a ProgID, just like VB does
; ReleaseObject(Object.l) - release the object
; Uni2Ansi(Unicode.l) - converts a Unicode string to Ansi
; Ansi2Uni(Ansistr.s) - converts an Ansi string to Unicode
;
; This demo program demonstrates the functionality of COMLIB with ADODB.
; ADODB is a COM object to access databases
;
; Created by aXend, 2004.
; For questions: use the forum or mail to aXend@planet.nl
;
; --------------------------------------------------------------------------------------------------------

IncludeFile "ADODB.pb"        ; Definitions for all the Enumerations and Interfaces
;IncludeFile "Variant_inc.pb"    ; Definitions for VARIANTS (not used here, I use the resident version)

Global sSQL.s

; Create a Connection object using the _Connection Interface and the CreateObject procedure from COMLIB
oDatabase._Connection = CreateObject("ADODB.Connection")

; Define the connectionstring (may be you have to change the path settings)
conn.s ="PROVIDER = MICROSOFT.JET.OLEDB.4.0; DATA SOURCE = 'test_ado.mdb'"

; Open the database
If oDatabase\Open(Ansi2Uni(conn),#Null,#Null,-1) = #S_OK

; I copied one tabel from the Dutch version of Northwind.mdb
  sSQL = "SELECT * FROM CUSTOMERS"

; Execute the query and create a Recordset object 
  If oDatabase\Execute(Ansi2Uni(sSQL),@affected.VARIANT,-1,@oRecords._Recordset) = #S_OK

; Get the EOF property
    oRecords\get_EOF(@EOF.VARIANT)
    
; If there are records in the table then continue
    If EOF\value = #VARIANT_FALSE
    
; Get the Fields object
      If oRecords\get_Fields(@oFields.Fields) = #S_OK
      
; Get the number of fields
        oFields\get_Count(@count.l)
        
        Debug "Number of fields is "+Str(count)
        
; Loop through the fields. I use the index mode here, but you can also access a field by name.     
        For i = 0 To count-1
        
; Definitions for each field, you have to do this or else it gets stuck       
          item.VARIANT\vt = #VT_I4  ; this is the VARIANT type for the index
          item\value = i            ; this is the index
          *item.pToVariant = item   ; this cuts the VARIANT in 4 LONG values
          
; Get a Field object by passing the 4 LONG values 
          If oFields\get_Item(*item\a,*item\b,*item\c,*item\d,@oField.Field) = #S_OK
          
            oField\get_Value(@Field.VARIANT)
            oField\get_Name(@Name.l)
            
            If Field\vt <> #VT_BSTR
              Debug Uni2Ansi(Name) + ": " + Str(Field\value)
            Else
              Debug Uni2Ansi(Name) + ": " + Uni2Ansi(Field\bstrVal)
            EndIf
            
; Release the Field object
            oField\Release()
            
          EndIf
        Next
        
; Release the Fields object
        oFields\Release()
        
      EndIf
    EndIf
    
; Release the Recordset object
    oRecords\Release()
    
  EndIf
  
; Close the Connection
  oDatabase\Close()
  
EndIf

; Release the Connection object
ReleaseObject(oDatabase)

End
@Karbon: I hope you're happy to work with it again. :)
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

I saw that sample, no docs though :) The comments makes it looks interesting to use the ADO COM object, but thats quite specific. Any other samples or some docs to help people who are looking to use COM objects and not ADO ?
blackborg
User
User
Posts: 38
Joined: Thu Nov 02, 2006 8:20 pm

Does anyone have a current working example

Post by blackborg »

Of using the comlib for PB4.. I downloaded it.. but I need touse it to open and search active directory and access..

Any help or code samples would be appreciated..
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

I very seriously doubt this is something that has been updated for PB4. I haven't heard from aXend in a long time!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

yes but, fortunately, the COMLIB source is provided.

see here - with a little surprise :wink:

http://www.purebasic.fr/english/viewtopic.php?t=16569
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
blackborg
User
User
Posts: 38
Joined: Thu Nov 02, 2006 8:20 pm

Thanks..

Post by blackborg »

the Ansi2Uni command clashes with Droopy's LIB.. but what I really need is a help file or some working ADO code.. any word on an official Fred COM or ADO Lib?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

here is my version without unicode2ansi, this function isn't required in PB4.
You can easy peek and poke to unicode :wink:
http://www.purebasic.fr/english/viewtopic.php?t=23651
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Re: Thanks..

Post by Flype »

blackborg wrote:the Ansi2Uni command clashes with Droopy's LIB.. but what I really need is a help file or some working ADO code.. any word on an official Fred COM or ADO Lib?
this link if still ok for a good ADO example (using COMLIB).
http://home.planet.nl/~aXend/purebasic/COMLIB_demo.zip
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Post Reply