I have randomly taken one method GetDesktopItemCount that wasn't working with your code, and got it to work thanks to slight modifications :
- declare this method as :
uint GetDesktopItemCount(outint lpiCount);
- use it :
int nbdesktops = 0;
uint hresult = IDesk.GetDesktopItemCount(out nbdesktops);
In other words, - IActiveDesktop is not a dispatch interface, so you must consume the HRESULT value in return. - out values are marshalled with the out attribute.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
With respect, that doesn't appear to be working either! I declared the GetDesktopItemCount as you did and then called in in my main program but I noticed that if I set nbdesktops to say 10 then after the function it is still 10! Also the HRESULT returned is non-zero even though no exception is thrown (it returns 0x129ADC which I don't know how to look up). Also what happened to the unit dwReserved parameter?
I declared the GetWallpaper function as:
uint SetWallpaper(string pwszWallpaper, uint dwReserved);
and it now seems to not throw an exception and even returns 0, but doesn't seem to actually do anything . I suspect that nothing will happen until I call the ApplyChanges method but that one still isn't working
Apologies for reposting the question. I posted it first in the .NET forum. I am desperate to get an answer prompting me to post here again.
I created a .NET web service that was to be consumed by a .NET web application.
Now I have a problem. I made a session variable in the Web Service and stored the instance of the Web Service in a session variable in the Web application.
I have two problems
1. The session variable in the Web service is lost in subsequent calls.
2. The WebService object in the Web app session is NULL in every submit from the browser.
Have anyone implemented something like this? Is this the correct way to implement a state-ful Web Service?
The web application starts a new session every time a web method on the WebService is called, even though I have created an instance of the Web Service in the Session_Start and kept it in a Session Variable.
Thomas George wrote: The web application starts a new session every time a web method on the WebService is called, even though I have created an instance of the Web Service in the Session_Start and kept it in a Session Variable.
SOmething sounds funny. Remember any session variables will only be there for the duration of the session. Maybe the session gets reset somewhere . Try adding breakpoints at session start/end events and see what happens....
When I was looking at it, it looked very helpful indeed, much better than the "few" examples on MSDN.
Thomas George wrote: Nice talking to you though. Got me thinking on a lot of things. I work here alone and I need someone to talk to about tech stuff once in a while .
Thanx again I work from home, but prefer to work alone, with some online help. Unfortunately my free GPRS connection comes to an end this month, so daytime will be a bit lonely untill ADSL becomes available in my area (local peak phone calls are probably the highest in the world (i dont even want to mention the cost per MB for GPRS once this free trial ends )).
The code in the previous post is for the web application. Web service objects created in an app by default is sessionless ie, it does not store the cookies. We just create a cookie container and ,wow, it is like invoking from a browser...
When a web application becomes the client for a webservice, that has state, the web application should identify the session in every request to the web service. Normally, this does not happen because the Web application does not store cookies. But, the Web service proxy object inside the web application can store the cookie, if one is created by the user.
The web service by default does not manage states - because it is a performance overhead. So, we have to explicitly enable session support for each web method that needs it, so that the session is loaded for the particular web method call (an extra load which we ask the ASP.NET framework to do by the EnableSession=true directive).
MS implemented tabs in VS .NET, a feature they ignored
in previous versions (good, old CBuilder . But did they
forgot to add a build-incrementing function again?
(like the one in the good, old CBuilder)
(well in C# and .NET it could be something different but
I cannot figure it out in the C++ version at all - the
"classic one, the unmanaged one")
All the free add-in for VS 6.0, I tried, didn't work.
BTW I haven't seen the good, old CBuilder for years but I
feel that VS .NET reminds me very much the good, old