OLE functions and properties

If you are a Power Builder developer and have any questions about using our products from Power Builder here is the place to post them.
Post Reply
Posts: 1
Joined: Fri Aug 01 2008

OLE functions and properties

Post by tom3x » Sat Aug 16 2008

I have following problem with ole object. I still get error error calling external property or function.I have tried 2 way of creating instances.First by automation pointer a second without it but then a get error null object referency.

Extract from programmer's guide:
Objects in SDK and their functions and properties are defined in type library.Type library is linked in pacsclnt.exe as a resource. SDK can use in every prog. languages which support OLE automation.

Example in VBscript:

Option Explicit

Dim bOK
Dim oStudiesManagement
Dim oStudiesInfoList
Dim oStudiesInfo
Dim oStudiesSeqID
Dim msg

' Create TomoCon PACS client object
Set oPACS = CreateObject("PACSClient.App")

' Set connection parameters
oPACS.PACSHostName = "pacs"
oPACS.PACSPortNumber = 104
oPACS.UserName = "PacsUser"
oPACS.UserPassword = "Password"

' Get studies management object
Set oStudiesManagement = oPACS.StudyManagement

' Find new studies
Set oStudiesInfoList = oStudiesManagement.GetNewStudiesInfo

msg = "Found " & oStudiesInfoList.Count & " new studies"
If oStudiesInfoList.Count > 0 Then
msg = msg & vbCRLF & "SeqID = " & oStudiesInfoList.SeqID
End If
MsgBox msg

' Display found study infos
Dim I
For I = 0 To oStudiesInfoList.Count-1

Dim sPatientName
Dim sPatientID
Dim sPatientSex
Dim sPatientBirthDate

Set oStudiesInfo = oStudiesInfoList.Item(I)

bOK = oStudiesInfo.GetPatientName(sPatientName)
bOK = oStudiesInfo.GetPatientID(sPatientID)
bOK = oStudiesInfo.GetPatientSex(sPatientSex)
bOK = oStudiesInfo.GetPatientBirthDate(sPatientBirthDate)

msg = "Study " & I+1 & " of " & oStudiesInfoList.Count & vbCRLF & _
vbCRLF & _
"Patient's name: " & sPatientName & vbCRLF & _
"Patient's birth date: " & sPatientBirthDate & vbCRLF & _
"Patient's sex: " & sPatientSex & vbCRLF & _

MsgBox msg

If oStudiesInfoList.Count > 0 Then
Dim ret
ret = MsgBox("Delete new studies info?", vbYesNoCancel)
If ret = vbYes Then
End If
End If

and my code in PB

Integer li_rc
String ls_pacshostname,ls_pacsportnumber,ls_pacsusername,ls_pacsuserpassword

ls_PacsHostName=f_fromdb_settings_sys ('PACS', 'PacsHostName', '')
ls_PacsPortNumber=f_fromdb_settings_sys ('PACS', 'PacsPortNumber', '')
ls_PacsUserName=f_fromdb_settings_sys ('PACS', 'PacsUserName', '')
ls_PacsUserPassword=f_fromdb_settings_sys ('PACS', 'PacsUserPassword', '')

OleObject oPACS
oPACS = Create OleObject
li_rc = oPACS.ConnectToNewObject ("PACSClient.App")
IF li_rc < 0 THEN
MessageBox("Connecting to COM Object Failed", &
"Error: " + String(li_rc))


OleObject oStudiesManagement
oStudiesManagement = Create OleObject

OleObject oStudiesFilter
oStudiesFilter = Create OleObject


OleObject oStudiesInfoList
oStudiesInfoList = Create OleObject
ls_pacsportnumber=string(oStudiesInfoList.Count) //error calling external property .Count or when i use /////oStudiesInfoList=oStudiesManagement.FindStudy(oStudiesFilter) null object referency


To wit I dont know it's possible to do it in PB7 but programmer's guide writes exactly 'SDK can use in every prog. languages which support OLE automation.' so it would be...

Thanks for help.

Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002

Re: OLE functions and properties

Post by Joan » Mon Aug 18 2008


Are you using the PDF Creator or the PDF Converter?

In your below code I didn't see where you are creating an instance of the PDF Converter or the PDF Creator dll.

Best Regards
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html

Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark

Post Reply