I am trying to get the hang of OOP with PB (and more to the point with other languages), and found what I was obviously overlooking in the docs (yes, I know, I know,
) and obviously in my eagerness to get things running, I completely missed (or misunderstood) what was in front of me.
Now that I am struggling with Events, I found straight from the docs (copy-pasted)
PbComServer
PbComClient.bas
I won't be able to test under XP till tomorrow, but under vista it compiles fine, but running causes the ole crash about debugging, or finding an answer or report to M$
Can anyone spot anything wrong??? I am so used to PB being more right than M$ is in documentation, that I find it hard to initially think a mistake, but more a mistake I made (which is usually the case, that when in doubt, its me that made it)
Hopefully someone can spot what I can not, in a area that I am still trying to learn, so I do not know what to look for????



Now that I am struggling with Events, I found straight from the docs (copy-pasted)
PbComServer
Code:
#COMPILE DLL "EvServer.dll" $EvIFaceGuid = GUID$("{00000098-0000-0000-0000-000000000002}") $MyClassGuid = GUID$("{00000098-0000-0000-0000-000000000003}") $MyIFaceGuid = GUID$("{00000098-0000-0000-0000-000000000004}") INTERFACE STATUS $EvIFaceGuid AS EVENT INHERIT IUNKNOWN METHOD Done END INTERFACE CLASS MyClass $MyClassGuid AS COM INTERFACE MyMath $MyIFaceGuid INHERIT IUNKNOWN METHOD DoMath MSGBOX "Calculating..." ' Do some math calculations here RAISEEVENT Status.Done() END METHOD END INTERFACE EVENT SOURCE STATUS END CLASS
Code:
#COMPILE EXE "EvClient.exe" $EvClassGuid = GUID$("{00000098-0000-0000-0000-000000000001}") $EvIFaceGuid = GUID$("{00000098-0000-0000-0000-000000000002}") $MyIFaceGuid = GUID$("{00000098-0000-0000-0000-000000000004}") CLASS EvClass $EvClassGuid AS EVENT INTERFACE STATUS $EvIFaceGuid AS EVENT INHERIT IUNKNOWN METHOD Done MSGBOX "Done!" END METHOD END INTERFACE END CLASS INTERFACE MyMath $MyIFaceGuid INHERIT IUNKNOWN METHOD DoMath END INTERFACE FUNCTION PBMAIN() DIM oMath AS MyMath DIM oStatus AS STATUS LET oMath = NEWCOM "MyClass" LET oStatus = CLASS "EvClass" EVENTS FROM oMath CALL oStatus oMath.DoMath EVENTS END oStatus END FUNCTION
Can anyone spot anything wrong??? I am so used to PB being more right than M$ is in documentation, that I find it hard to initially think a mistake, but more a mistake I made (which is usually the case, that when in doubt, its me that made it)
Hopefully someone can spot what I can not, in a area that I am still trying to learn, so I do not know what to look for????
Comment