Hi All,

I am trying to translate the following from VB to CF. It uses com objects,
and this is my first attempt at calling com from cf.

VB example is:

Dim oAHC As New AHCMessenger
Dim oMsgMan As IHCMessageManager
Set oMsgMan = oAHC.Connect("testapplication1")
Dim oMsgType As New AHCMessageType
oMsgType.Version = "HL7 2.3"
oMsgType.MessageTypeCode = "ADT"
oMsgType.EventCode = "A28"
Dim oMsg As HCMessageEnvelope
Set oMsg = oMsgMan.CreateMessage(msgtype)

My CF equivalent is:

<cfobject type="COM" name="oAHC" class="AHC.Messenger" action="CREATE">
<cfset oMsgMan = oAHC.Connect("TestApplication1")>
<cfobject action = "Create" type = "COM" class = "AHC.MessageType" name =
"oMsgType">
<cfset oMsgType.Version = "HL7 2.3">
<cfset oMsgType.MessageTypeCode = "ADT">
<cfset oMsgType.EventCode = "A28">
<cfset oMsg = oMsgMan.CreateMessage(oMsgType)>

The first 6 lines work correctly, but the last line throws an error
"... there are no methods with the the specified method name and argument
types".

I have used OLEView.exe to check the com objects, and the AHC.Messenger
object has methods listed under two subgroups: IDispatch and
IHCMessageManager. I can use CF to access the Connect and Disconnect methods
listed under IDispatch subgroup, but cannot figure out how to access the
methods listed under IHCMessageManager subgroup. e.g. CreateMessage

Any com experts able to help me out?

Thanks,
Phil.


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to