|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
help converting c# to c++?Is there any way to convert this code to c++ from c#?
System.Web.HttpContext.Current.Session["CookieContainer"] = outputChannel.Options.CookieContainer; Thanks in advance. Regards Joel In C#, that would be:
System.Web.HttpContext.Current.Session["CookieContainer"] = outputChannel.Options.CookieContainer; -- Show quoteHTH, Kevin Spencer Microsoft MVP Chicken Salad Surgery Orange you bland I stopped splaying bananas? "Joel" <J***@discussions.microsoft.com> wrote in message news:C46F6531-9831-4A4A-B749-5A0A0CD163C6@microsoft.com... > Is there any way to convert this code to c++ from c#? > > System.Web.HttpContext.Current.Session["CookieContainer"] = > outputChannel.Options.CookieContainer; > > Thanks in advance. > Regards Joel well thanks but i meant a conversion the other way... :)
c# to c++ Regards Joel. Show quote "Kevin Spencer" wrote: > In C#, that would be: > > System.Web.HttpContext.Current.Session["CookieContainer"] = > outputChannel.Options.CookieContainer; > > -- > HTH, > > Kevin Spencer > Microsoft MVP > Chicken Salad Surgery > > Orange you bland I stopped splaying bananas? > > > "Joel" <J***@discussions.microsoft.com> wrote in message > news:C46F6531-9831-4A4A-B749-5A0A0CD163C6@microsoft.com... > > Is there any way to convert this code to c++ from c#? > > > > System.Web.HttpContext.Current.Session["CookieContainer"] = > > outputChannel.Options.CookieContainer; > > > > Thanks in advance. > > Regards Joel > > > I must be dyslexic this morning!
I do seem to remember laying awake all night wondering if there really is a dog... -- Show quoteKevin Spencer Microsoft MVP Chicken Salad Surgery Orange you bland I stopped splaying bananas? "Joel" <J***@discussions.microsoft.com> wrote in message news:DBDF508F-0C05-4DC8-A052-2301282AA630@microsoft.com... > well thanks but i meant a conversion the other way... :) > c# to c++ > > Regards Joel. > > "Kevin Spencer" wrote: > >> In C#, that would be: >> >> System.Web.HttpContext.Current.Session["CookieContainer"] = >> outputChannel.Options.CookieContainer; >> >> -- >> HTH, >> >> Kevin Spencer >> Microsoft MVP >> Chicken Salad Surgery >> >> Orange you bland I stopped splaying bananas? >> >> >> "Joel" <J***@discussions.microsoft.com> wrote in message >> news:C46F6531-9831-4A4A-B749-5A0A0CD163C6@microsoft.com... >> > Is there any way to convert this code to c++ from c#? >> > >> > System.Web.HttpContext.Current.Session["CookieContainer"] = >> > outputChannel.Options.CookieContainer; >> > >> > Thanks in advance. >> > Regards Joel >> >> >> Joel wrote:
> Is there any way to convert this code to c++ from c#? Assuming you're talking about C++/CLI (VC++ 2005 only), then it'd be > > System.Web.HttpContext.Current.Session["CookieContainer"] = > outputChannel.Options.CookieContainer; something like: System::Web::HttpContext::Current->Session["CookieContainer"] = outputChannel->Options->CookieContainer; If you're talking about ISO standard C++, then it'd be something completely different, since none of those classes is accessible from standard (native, unmanaged) C++. -cd No actually I was talking about vc++ 2003.
Sorry for not making that clear. Its not working with the ["CookieContainer"] part. I have now solved my issue i another way but im still curious if and how its possible to translate that part? Regards Joel Show quote "Carl Daniel [VC++ MVP]" wrote: > Joel wrote: > > Is there any way to convert this code to c++ from c#? > > > > System.Web.HttpContext.Current.Session["CookieContainer"] = > > outputChannel.Options.CookieContainer; > > Assuming you're talking about C++/CLI (VC++ 2005 only), then it'd be > something like: > > System::Web::HttpContext::Current->Session["CookieContainer"] = > outputChannel->Options->CookieContainer; > > If you're talking about ISO standard C++, then it'd be something completely > different, since none of those classes is accessible from standard (native, > unmanaged) C++. > > -cd > > > "Joel" <J***@discussions.microsoft.com> wrote in message I think you have to call the indexer by name using function call syntax news:FEDAB0AF-866F-4E63-BCE9-C56A8390081F@microsoft.com... > No actually I was talking about vc++ 2003. > Sorry for not making that clear. > > Its not working with the ["CookieContainer"] part. > > I have now solved my issue i another way but im still curious if and how > its > possible to translate that part? instead of the indexer syntax. The name of the indexer should be get_Item, so it'd be: System::Web::HttpContext::Current->Session->get_Item("CookieContainer") = outputChannel->Options->CookieContainer; -cd Carl Daniel [VC++ MVP] wrote:
Show quote > "Joel" <J***@discussions.microsoft.com> wrote in message HttpContext.Current.Session["CookieContainer"]> news:FEDAB0AF-866F-4E63-BCE9-C56A8390081F@microsoft.com... > >>No actually I was talking about vc++ 2003. >>Sorry for not making that clear. >> >>Its not working with the ["CookieContainer"] part. >> >>I have now solved my issue i another way but im still curious if and how >>its >>possible to translate that part? > > > I think you have to call the indexer by name using function call syntax > instead of the indexer syntax. The name of the indexer should be get_Item, > so it'd be: > > System::Web::HttpContext::Current->Session->get_Item("CookieContainer") = > outputChannel->Options->CookieContainer; > is actually C# shorthand for HttpContext.Current.Session.Item["CookieContainer"] So... in C++ HttpContext::Current->Session->Item["CookieContainer"] C# treats Item[xxx] as a special case and allows you to drop the property name "Item". Cheers, Peter
Show quote
"Peter Bromley" <no***@nowhere.com> wrote in message ....which is just shorthand fornews:eLSqNJYwGHA.3364@TK2MSFTNGP02.phx.gbl... > Carl Daniel [VC++ MVP] wrote: >> "Joel" <J***@discussions.microsoft.com> wrote in message >> news:FEDAB0AF-866F-4E63-BCE9-C56A8390081F@microsoft.com... >> >>>No actually I was talking about vc++ 2003. >>>Sorry for not making that clear. >>> >>>Its not working with the ["CookieContainer"] part. >>> >>>I have now solved my issue i another way but im still curious if and how >>>its >>>possible to translate that part? >> >> >> I think you have to call the indexer by name using function call syntax >> instead of the indexer syntax. The name of the indexer should be >> get_Item, so it'd be: >> >> System::Web::HttpContext::Current->Session->get_Item("CookieContainer") = >> outputChannel->Options->CookieContainer; >> > > So... in C++ > > HttpContext::Current->Session->Item["CookieContainer"] HttpContext::Current->Session->get_Item("CookieContainer") Both work in Managed C++ (old syntax), while HttpContext::Current->Session->default["CookieContainer"] and HttpContext::Current->Session["CookieContainer"] both work in C++/CLI (new syntax). -cd The following two will work in C++/CLI:
HttpContext::Current->Session["CookieContainer"] HttpContext::Current->Session->default["CookieContainer"] -- Show quoteDavid Anton www.tangiblesoftwaresolutions.com Instant C#: VB to C# converter Instant VB: C# to VB converter Instant C++: C#/VB to C++ converter C# Code Metrics: Quick metrics for C# "Carl Daniel [VC++ MVP]" wrote: > "Joel" <J***@discussions.microsoft.com> wrote in message > news:FEDAB0AF-866F-4E63-BCE9-C56A8390081F@microsoft.com... > > No actually I was talking about vc++ 2003. > > Sorry for not making that clear. > > > > Its not working with the ["CookieContainer"] part. > > > > I have now solved my issue i another way but im still curious if and how > > its > > possible to translate that part? > > I think you have to call the indexer by name using function call syntax > instead of the indexer syntax. The name of the indexer should be get_Item, > so it'd be: > > System::Web::HttpContext::Current->Session->get_Item("CookieContainer") = > outputChannel->Options->CookieContainer; > > -cd > > > "David Anton" <DavidAn***@discussions.microsoft.com> wrote in message Yes, we've already covered that. The question was about MC++ 2003.news:D2F29736-8755-4B94-9A87-AC85CBB65FB2@microsoft.com... > The following two will work in C++/CLI: -cd Thank you all for that important piece of knowledge.
It will help me in my future development. Regards Joel Show quote "Carl Daniel [VC++ MVP]" wrote: > "David Anton" <DavidAn***@discussions.microsoft.com> wrote in message > news:D2F29736-8755-4B94-9A87-AC85CBB65FB2@microsoft.com... > > The following two will work in C++/CLI: > > Yes, we've already covered that. The question was about MC++ 2003. > > -cd > > > |
|||||||||||||||||||||||