|
Prev: Terminal Service is Enable or not using C++ or VC++ Code
Next: How to remove all registers that my project add?
From: Funnyman on 19 Jun 2008 18:30 On Jun 9, 6:50 pm, Norman Bullen <n...(a)BlackKittenAssociates.com> wrote: > Funnyman wrote: > > I've been trying to find an answer to this question for a few days > > (through research and experimentation), but haven't had any success, > > so I figured I'd try this group. > > > All scenarios are running on Windows NT 4.0, apps compiled using > > Visual Studio 6.0. > > > Basically I want to know if aneventobject created by aserver > > application (application A) can be passed to a VB script file via a > > COM API return parameter, then passed to anotherserverapplication > > (application B) as a parameter using one of B's COM API functions, > > then application B will use WaitForSingleObject on thateventobject > > to wait for it to be signaled by application A. > > > To clarify a bit, here are the function definitions I mentioned above: > > > Application A: > > STDMETHOD(GetPageVectorEntryBreakEvent)(/*[in]*/long > > lZeroBasedIndex, /*[out,retval]*/long *plBreakEvent); > > > Application B: > > STDMETHOD(Page)(/*[in]*/ DWORD zoneNumber, /*[in]*/ BSTR wavefile, / > > *[in,optional]*/ long lBreakEvent); > > > VB script snippet that uses the functions: > > ... > > lngPageBreakEvent = AppA.GetPageVectorEntryBreakEvent(lngIndex) > > AppB.Page lngZoneNumber, "C:\program files\crq\prompts\7050.wav", > > lngPageBreakEvent > > > The intended functionality is that when AppB.Page is called, > > application B starts playing a .wav file that will play until > > completed OR until the lngPageBreakEvent is set using SetEvent in > > application A. I'm finding that setting theeventin application A has > > no effect on application B. > > > I can provide some nitty gritty implementation details if they'll help > > reach a solution, but for now I just wanted to see if anyone has had > > experience in making this work. But essentially theeventobject > > handle is going through the following transformation > > HANDLE -> long -> (void *) -> HANDLE > > > Thanks in advance for any help you can provide me, as this problem has > > been bugging me non-stop and I'd like to put it behind me. > > > Cheers, > > Mike (Funnyman) > > Eventobjectscan be named. Yourtwoapplicationscanshareaneventif > they both call CreateEvent() using the same name. > > It sounds like you're trying to pass a handle from one application to > another via a third; this can be done but it's probably more difficult. > You need to use DuplicateHandle() to create a handle that the receiving > application can use and then pass the numeric value of that handle to it. > > -- > Norm > > To reply, change domain to an adult feline. Thank you so much for your response - I ended up using the DuplicateHandle() function because I wasn't able to work out how to communicate the named events between the two applications in a dynamic manner. The functionality now works perfectly! Thanks again, Mike |