View Single Post

Old 03-23-2007, 05:01 AM   #5 (permalink)
DavidZ DavidZ is offline
Likes to customize RE!

Join Date: Jul 2006
Location: London, UK
Posts: 350
Rep Power: 3 DavidZ is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)
- API/VBA

I tried the example using VB.NET and it failed. I got an error message on the OLEInitialize function. I rewrote the code so that it matched the C#'s declaration and it worked fine.

Code:
Module Module1
   Public Declare Function OLEInitialize Lib "ole32" Alias "OleInitialize" (ByVal intp As IntPtr) As Integer
 
   Sub Main()
 
      OLEInitialize(Nothing)
 
      Dim oREAPI As New REDotNetAPI.REAPI
      Dim oConstit As REDotNetAPI.CRecord
 
      oREAPI.Init("WRE11111", , , 50, , REDotNetAPI.AppMode.amStandalone)
 
      oConstit = New REDotNetAPI.CRecord()
      oConstit.Init(oREAPI.SessionContext)
      oConstit.LoadByField(REDotNetAPI.bbRECORDUniqueFields.uf_Record_CONSTITUENT_ID, 3)
      System.Console.Write(oConstit.Fields(REDotNetAPI.ERECORDSFields.RECORDS_fld_FULL_NAME))
 
     oConstit.CloseDown()
     oConstit = Nothing
 
 
  End Sub
 
End Module
Note that this was written using a pre-7.80 version i.e. before RE included the interop assemblies so the namespace "REDotNetAPI" may be different on later versions.

David
__________________
David Zeidman
Zeidman Development
http://www.zeidman.info

Check out my RE API blog
http://www.re-decoded.com

Reply With Quote