Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I'm defeated. I may have to sell shoes!
Message
From
29/01/2013 13:30:12
 
 
To
29/01/2013 13:12:52
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01564407
Message ID:
01564555
Views:
57
>>>>Hello Everyone,
>>>>
>>>>Can anyone get this to work? If I can get past this code I'll be able to finish the rest (I think) myself.
>>>>
>>>>Thanks in advance...
>>>>
>>>>
>>>>CLEAR
>>>>
>>>>PUBLIC oComUtil, oFoxEvent, oMSMQEvent 
>>>>
>>>>* Setup up event handler to receive the messages
>>>>oMSMQEvent = create("msmq.msmqevent")
>>>>oComUtil = create("vfpcom.comutil")
>>>>oFoxEvents = create("FoxEvent")
>>>>
>>>>? EVENTHANDLER(oMSMQEvent,oFoxEvent)
>>>>
>>>>
>>>>DEFINE CLASS FoxEvent AS custom OLEPUBLIC
>>>>	IMPLEMENTS FoxEvents IN "MSMQ.Msmqevent"
>>>>
>>>>	Procedure FoxEvents_Arrived(oQueue,Cursor)
>>>>		WAIT WINDOW "Message Arrived" TIMEOUT 1
>>>>	ENDPROC
>>>>
>>>>	Procedure FoxEvents_ArrivedError(Queue,ErrorCode,Cursor)
>>>>		WAIT WINDOW "Message Arrived Error" TIMEOUT 1
>>>>	ENDPROC
>>>>
>>>>ENDDEFINE
>>>>
>>>
>>>Is that all the events in FoxEvents? A class that implements an interface has to have methods for every event in the interface, even if they do nothing.
>>>
>>>Tamar
>>
>>The problem begins for me with >oMSMQEvent = create("msmq.msmqevent"), which creates an empty class. When I tried the example from MS Office Automation w/VFP Pg pg 363, .ExportEvents(), MSMQ_Events.prg never gets created.
>>
>>oVFPCOM = CREATEOBJECT("vfpcom.comutil")
>>oMSMQ = CREATEOBJECT("MSMQ.MSMQEvent")
>>
>>oVfpCom.ExportEvents(oMSMQ, "MSMQ_Events.prg")
>
>If this is VFP 7 or later, forget VFPCOM; you don't need it. All this is built into the language. Open MSMQ in the Object Browser, find the interface you want to implement and drag it into a code window. That'll create the object definition you need to fill in.
>
>Also, are you sure that MSMQ is installed in your version of Windows? Looks like it's not automatic in newer versions.
>
>Tamar

Yes, I have MSMQ turned on (Windows 7, Control Panel > Admin Tools > Computer Management > Services and Applications) and I have both Public and Private queses created. I don't see MSMQ in the object brower. Is is called MSMQ... or is it in there with a different name?

Larry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform