Thanks for looking at this. The typos were only on the UT, not in my code. Both of these return the OLE error of interface unsupported:
loAPI.GetAVals(lcGUID)
loAPI.GetAVals((loAObject.id))
However, an interesting note is that if I pass the var lcGuid, I receive 'no such interface supported' but if I pass the object, I receive 'The parameter is incorrect' because it expects a Guid.
Now, if I create a session object and hook up one of the events to it, it fires, but only locally and it appears that only the code in the procs in the define below run, not the base code in the dll. For example, I dragged the interface onto a foxpro prg and it fires, but it doesn't communicate back through the dll. It's like it only fires locally:
x=NEWOBJECT("aClass")
z=NEWOBJECT("abClass")
EVENTHANDLER(a,z)
EVENTHANDLER(ab,z)
x.aClass_Connect(5000)
loABOject.aname = 'Tracy C Holzer'
x.aClass_SetAVals(loAbObject)
DEFINE CLASS aClass AS session OLEPUBLIC
IMPLEMENTS aClass IN "a.CachStandardAPI.tlb"
PROCEDURE aClass_Connect(Port AS Number) AS Number
? [in aClass_Connect]
ENDPROC
PROCEDURE aClass_Connect_2(RemoteMachine AS STRING, Port AS Number) AS Number
ENDPROC
PROCEDURE aClass_SetAVals(obj AS VARIANT) AS Number
DODEFAULT()
=MESSAGEBOX('in aSetVals Event')
ENDPROC
ENDDEFINE
Now a question on the above code. Not sure I get it.In the object browser I see the classes, methods, props, and interfaces of the com dll.
I see this class: 'aClass'
I see this interface: '_aClass'
I see no events (lightening bolts under events - events shows 0).
If I check the interface members within aClass, I see _aClass.
So that tells me that the class aClass implements the interface _aClass (right?)
Now, I cannot drag/drop the class itself into vfp, but I can drag/drop the interface _aClass and it will produce the define statement above.
When I do that, since aClass implements _aClass, if I call a method in aClass (which exists in the interface _aClass as well), and I hooked up the method to the eventhandler above, shouldn't the code above in _aclass run as well as the _aclass code in the com dll? it appears that only the code above runs, not the code in the com dll. Also, I cannot call aClass directly this way, only the interface _aClass.
If I hook it to my original code like so:
EVENTHANDLER(loAPI,x)
shouldn't calling loAPI.setaVals(loAObject) run the code above in the define statement? It does not, but it does update the com dll as it should, but the eventhandler seems to do nothing.
Also, I can call all of the methods in the interface when I use x. (they are brought into the define statement) which appear to not run code in the dll but only the code in the define statement above, but I cannot see the getAVals method using loAPI still (returns unsupported interface) which I do not understand since getAVals exists in the interface _aClass which is implemented in aClass.
Hope I explained this well enough. I am clearly not understanding this correctly.
Running the above code (using the define statements) seems to overwrite the interface behavior and not run the default interface behavior in the com dll at all. This I do not understand since I clearly get a connection number when I call the x.aClass_Connect(5000)
Note: the interface when dragged/dropped into vfp was _aclass which i tested with the same results as after I renamed it throughout to aClass (to see if it made a difference which it does not).
Also, when I look at an example solution in c#, I see overloaded methods for the connect method of aclass and one of them includes a parameter of a callback function, but those overloaded methods are not exposed via com. Only the first method with the single parameter of the port is visible via com.
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"