Tracy,
first try to get the dotnet working by an example in
dotnet. If you don't have the source, look for one of the tools recreating source from the IL (if you are lucky there is testcode in the dll as well showing proper usage<g>).
You have at least a dot missing in the code shown here when setting your name, so this probably would leave
loAObjec
t.CallerName as .f. && 'Tracy C Holzer' goes to loAObjectCallerName
which could mean some different values for the corresponding property depending how defensive
loAPI.SetAVals(loAObject)
was coded. I would also try
loAPI.GetAVals( (loAObject.id) )
or
lcGUID = loAObject.id
loAPI.GetAVals(lcGUID)
probably missing some sleep...
regards
thomas
>I have a com interop net dll that I did not create, nor can I modify. It has an api that I can use to communicate with it. When I connect to it, it returns an integer for the connection. The api has numerous methods I can call to send information or request information. I can send fine, but I cannot receive. According to the documentation, the information is received via a callback. I have looked at vfp callback examples for com, but all of them appear to be examples where the com dll is created by the developer and I do not have control over that. How do I manage a callback when I call the net com interop dll?
>
>The connection is made via tcp through a port you can choose (I chose 5000). For testing purposes, I am running the cache app (c# net dll) on my machine using 127.0.0.1 and connecting to it via the api (net com interop dll) from VFP on my workstation as well.
>
>The documentation states that information is returned via a callback, but looking at the layout for the aclass connect, I see no callback information.
>
>
Connect (int Port, string AppName, CallBack CallBackFunction): int
>Creates a connection to CACH application. Each AppName can register a separate
>callback function. The caller checks the connection status through the registered callback
>function.>
>???
>However, in the object browser, I only see: Connect(port)
>no other parameters show.
>
>I connect like so:
>
>
>*-- Method Connect(Port As Long) As Long
>*-- Member of a_CachStandardAPI.aClass
>
>*--Connect
>PUBLIC loAPI as a.CachStandardAPI.aClass
>loAPI = CREATEOBJECT("a.CachStandard.API.aClass","","")
>public lnport
>lnport = 5000
>lnConnection = loAPI.connect(lnport)
>
>
>*--Populate the ab object's properties
>lcguid=getguid()
>Public loAObject as a.CachStandardAPI.abClass
>loAObject = CREATEOBJECT("a.CachStandard.API.abclass","","")
>loAObject.ID = lcGuid
>loAObject.CallbackNumber = '1234567890'
>loAObject.CallerNumber = '0987654321'
>loAObject.callerlocation = '100 N Main St;HP'
>loAObjectCallerName = 'Tracy C Holzer'
>
>*--Send the object to the com dll
>*-- Method SetAvals(obj As _abClass) As Long
>*-- Member of a_CachStandardAPI.aClass
>
>loAPI.SetAVals(loAObject)
>
>
>Now, if I modify the information in the net com dll directly, I should be able to request an update using a method in the API:
>
>*-- Method GetAvals(CallID As GUID) As _abClass
>*-- Member of a_CachStandardAPI.aClass
>
>loAPI.GetAVals(loAObject.id)
>
>
Any idea why it would return 'No such interface supported' when I can clearly see the interface in the object browser and I can see it as well if I step through the interfaces using:>
>*--This shows the interfaces and the GetAvals is listed
>public otli, otlb
>otli=NEWOBJECT('tli.tliapplication')
>otlb=otli.TypeLibInfoFromFile("a.CachStandardAPI.tlb")
>FOR each oCoClass in otlb.CoClasses
> ?" ",oCoClass.name
> *now each interface associated with this CoClass
> for each oInterface in oCoClass.Interfaces
> ?" ",oInterface.name
> endfor
>endfor
>?
>?"Interfaces"
>FOR each oInterface in otlb.Interfaces
> ?" ",oInterface.name
>ENDFOR
>?
>FOR i = 1 TO otlb.Interfaces.Count
> ?"Interface Members for Interface "+ALLTRIM(STR(i))
> FOR each oMember IN otlb.Interfaces(i).Members
> ?" ", oMember.name
> FOR each oParm in oMember.Parameters
> ?" ",oParm.name
> ENDFOR
> ENDFOR
>ENDFOR
>RETURN
>
>
>However, I can see the method and the interface in the object browser. It's supposed to return the abObject populated.
>
>Any ideas?
>
>Although the supplier of the dll created a com interop dll at my request, they do not seem to have anyone experienced in com interop. So there is not much support there. They work with dotnet almost exclusively and not any com interop.