|
Hi Members,
I have a requirement where i need to display a popup control through my window service. I know in Win 7 window service can not communicate to desktop.
So can i get some ideas over it.
Regards
|
|
|
|
|
I suppose one thing you can do is create seperate applications and send/receive windows messages between them.
Here's a quick google result[^]
If you've never done this it might take you a few hours to figure out how it is done. I suggest a small test project and build from there.
hope this helps. But again, try to talk to your boss about this ridiculous requirement.
|
|
|
|
|
repost from yesterday (in the same forum!)
|
|
|
|
|
Hi Members,
I have an applications installed on two machines (client & server) on a Network. Whenever any upgrade of the application is available on the Server machine, Server machine have to notify the client machine. This notification has to be made through the Taskbar Flyout or Tray Notification similar with notifications of java version upgrade or AVG AntiVirus Version Upgrade
I have tried to resolve this thing using Window service and this approach is working nicely on the XP or lower version of o/s. But on Window 7 it’s not working as we all know that from vista onwards Window services run on a different session
So can somebody please comes up with any idea so that I may able to resolve this problem
Regards
|
|
|
|
|
PankajKSood wrote: But on Window 7 it’s not working as we all know that from vista onwards Window services run on a different session
"We" also know that Google has links to how this is solved.
PankajKSood wrote: Whenever any upgrade of the application is available on the Server machine, Server machine have to notify the client machine.
..and what do you do with the client-apps whose machine is turned off? Usually, the client-app "asks" the server whether an update is available (as easy as checking if a new file is on your server) and proposes to download it.
|
|
|
|
|
I told you exactly how to do this yesterday.
Again, you DON'T do this from a Windows Service and you really don't need a service to check for a new version of an app. You can do that with a normal application that runs out of the registry's Run key which will run whenever a user logs in.
|
|
|
|
|
Hi
I have implemented the IWMHeaderInfo3 interface from the Windows Media Format SDK as follows:
[ComImport, Guid(IID.IWMHeaderInfo3), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
internal interface IWMHeaderInfo3 : IWMHeaderInfo2
{
...
void GetAttributeIndices([In] ushort wStreamNum, [In, MarshalAs(UnmanagedType.LPWStr)] string pwszName, [In] ref ushort pwLangIndex, [Out, MarshalAs(UnmanagedType.LPArray)] ushort[] pwIndices, [Out, In] ref ushort pwCount );
...
}
My problem is that according to the MSDN documentation the pwLangIndex parameter needs to be passed a null value at times. However a ushort cannot be assigned a null value so when I try to reference the method in code with a null in that position it complains the closest matching method has invalid parameters.
The unmanaged method is expecting a pointer to a WORD for this parameter so could I use IntPtr instead of ushort and the MarshalAs command to treat it as a WORD *? If so how do I do this?
What is the correct way to get around this issue? All help greatly appreciated.
|
|
|
|
|
You can create a "nullable" ushort as follows:
ushort? pwLangIndex = null;
|
|
|
|
|
Unfortunately this doesn't work. You can't pass a ushort? variable to the parameter.
I tried changing the parameter type to a ushort? in the method declaration but at runtime this results in an exception (Cannot marshal 'parameter #3': Generic types cannot be marshaled.) being raised.
|
|
|
|
|
|
Hi Gerry
I tried changing the parameter type to an IntPtr without the ref and using IntPtr.Zero in the call but that results in a "Value does not fall within the expected range." exception at runtime.
If I keep the ref it complains that IntPtr.Zero is a static const so can't be used as a ref parameter. Using a variable of type IntPtr instead causes a memory access violation.
|
|
|
|
|
If you could provide a more complete sample then others could actually try out their suggestions first. As it stands, it's not that easy to reproduce your problem.
|
|
|
|
|
You can try changing the ushort parameter to an IntPtr and just send in 0.
|
|
|
|
|
Hi Dave
I tried changing the parameter type to an IntPtr and using IntPtr.Zero in the call but that results in a "Value does not fall within the expected range." exception at runtime.
|
|
|
|
|
Well, it was worth a shot.
|
|
|
|
|
Create an overload with that parameter changed to System.IntPtr and pass System.IntPtr.Zero when you require null.
|
|
|
|
|
Pass whatever NULL is in the Windows libraries, which I think will be 0.
|
|
|
|
|
hi! i wrote a code for a GPS sever which analyse the trame received from a client and thanks to this trame, it may localise tha place in which the client is situated! How can i modify the trame and the code so the client will be abla to send in the trame a sign to show if he is in emergency!
and please where i can fnd exemples of trames of a person who is moving ?? Help please!!!
|
|
|
|
|
You're going to have to explain what a "trame" is.
|
|
|
|
|
it is a frame: the message that receives the server and contains the informations! in mu code i used a frame GPRMC sent by a client! sorry i am used to study in frensh that's why i used the word trame
|
|
|
|
|
I have a C# application that tests a product my company developes. At the moment this application can be run on a ordinary laptop. I have now started to develope new tests that requires specific hardware and dll:s. These new tests can only be run on a computer that has this hardware installed.
What is the best solution if I still want to be able to use the same application on an ordinary laptop to run the other tests that don't requires the new hardware? The "ordinary laptop" is missing the dll:s that my application is using to communicatio with the hardware.
|
|
|
|
|
I can think of 3 ways you could do this:
1) Enable remote debugging in Visual Studio and run all the tests on a computer with the hardware installed. So your laptop can run the tests and the hardware also.
2) Add a few conditional compile options around the calls you have into the hardware specific DLLs - this makes them not execute at all.
3) Stub out the hardware DLLs on your dev laptop by creating special versions of them that run without the hardware attached. So basically, they can return to you known data when called, and do nothing when no return data is required.
|
|
|
|
|
I think the most widely used point for these situation is what you have proposed as 3rd option. Simply Mock your hardware specific assemblies (I don't know how hard that is), this way on a laptop you can test only your code and in the mocks implement whatever functionality you need assuming that "the hardware" works ok. When running the tests on the actual device you can simply remove the mock assemblies and you can also run your tests.
|
|
|
|
|
Load the DLL dynamically depending on the Hardware (take a look at Assembly.LoadFrom).
------------------------------
Author of Primary ROleplaying SysTem
How do I take my coffee? Black as midnight on a moonless night.
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
How to reduce the size of a pdf using free libraries in C#.
|
|
|
|