Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
Q

QuickDeveloper

@QuickDeveloper
About
Posts
158
Topics
81
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Error in Console App:"The request was aborted: Could not create SSL/TLS secure channel."
    Q QuickDeveloper

    Hi All I am calling a REST API from my C# Console application and get the following error while calling GetResponse method "The request was aborted: Could not create SSL/TLS secure channel." The code has worked before couple of days back , so I am not sure what changed. The cert I am using is valid cert installed on my machine where I run the code, I checked the expiration details and all. My code is as follows, it fails in the try block below.The uri that I pass is this -https://management.core.windows.net/{0}/services/hostedservices[^] I replace the {0} with a valid id ofcourse. Code:

    public static XDocument GetResponse(Uri uri)
    {
    HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
    request.Method = "GET";
    request.Headers.Add("x-ms-version", msVersion);
    request.ClientCertificates.Add(certificate);
    request.ContentType = "application/xml";

            XDocument responseBody = null;
            HttpWebResponse response;
    
            try
            {
                **response = **(HttpWebResponse)request.GetResponse();****
            }
         catch (WebException ex)
     {
         response = (HttpWebResponse)ex.Response;
     }
    

    }

    Exception: The complete exception is: System.Net.WebException was caught HResult=-2146233079 Message=The request was aborted: Could not create SSL/TLS secure channel. Source=System StackTrace: at System.Net.HttpWebRequest.GetResponse() at StorageAccountsExtractor.AzureService.GetResponse(Uri uri) in e:\StorageAccountsRetriever\StorageAccountsExtractor\StorageAccountsExtractor\Program.cs:line 289 InnerException: Solution: I looked on the web and looks like I need to make HTTPS use TLS? how do I do that.Any other ideas that I could look into?

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    C# csharp security json question asp-net

  • DLL
    Q QuickDeveloper

    john5632 wrote:

    how can I debug dll(COM)

    I assume you have an Exe associated with that dll. Place breakpoints in your DLL and mention the Executable(exe) as the startup program in your Dll.This way you can step in to the code and watch the variables etc Hope this helps!

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    C / C++ / MFC question c++ com debugging

  • virtual inheritance and polymorphism! [modified]
    Q QuickDeveloper

    The first one is a clear case of Diamond Inheritance Problem, As there will be two copies of A in B & C , the compiler will be confused which one to use for D. This is where virtual inheritance steps in. Refer http://www.parashift.com/c++-faq-lite/multiple-inheritance.html#faq-25.8[^] for a start.

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    C / C++ / MFC oop question c++ help tutorial

  • Start with cloud
    Q QuickDeveloper

    For starters

    pravin_mun wrote:

    1. How to get free cloud space

    You can try Windows Azure Free Trial Offer . Refer http://www.microsoft.com/windowsazure/free-trial/[^]

    pravin_mun wrote:

    2. Libraries for the same in C#

    Download Windows Azure SDK .Refer http://www.microsoft.com/windowsazure/sdk/[^]

    pravin_mun wrote:

    3. Get started with some samples and implement them with visual studio...

    Refer this for some sample Web Apps to be deployed using VS http://www.microsoft.com/windowsazure/tutorials/[^] This is purely from Windows Azure perspective, you can also try out other vendors like Amazon EC2 or GAE Hope this helps!!

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    Cloud Computing csharp visual-studio hosting cloud help

  • Send a Message to a Window programmatically
    Q QuickDeveloper

    «_Superman_» wrote:

    Use spy to get handles of the child windows and try sending the message to the child windows to figure out which window responds as you expect.

    Yes,I used Spy++ to get the handle of window.The window is being maximized when using ShowWindow but looks like no messages are being posted. Also as replied by "Mattias G" above this reply, i gave coordinates in WPARAM/LPRAM - SendMessage(hwnd,WM_RBUTTONDOWN,100,100) but to no avail. I will try to send messages to child windows (Maybe webpage inside browser) and verify. Thanks for the reply !

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    C / C++ / MFC question

  • Send a Message to a Window programmatically
    Q QuickDeveloper

    Hi I am trying to send a Message to my Internet Explorer Window.I got the handle and able to maximize the window but unable to send message. Can anyone tell me if something is wrong in SendMessage call below?Is the message queued?Send message should wait until the message is processed right?

    int _tmain(int argc, _TCHAR* argv[])
    {

    HWND hwnd=FindWindow(L"IEFrame",NULL);
    	
    if(NULL != hwnd)
    {
      printf("\\n  Retrieved the window handle \\n");
      ShowWindow(hwnd,SW\_MAXIMIZE);// This line works and the browser window is maximized as well.
      LRESULT lr=SendMessage(hwnd,WM\_RBUTTONDOWN,NULL,NULL);//Here,nothing happens,even though i change the message to any other (like WM\_LBUTTONDOWN etc)
    
    	  if(lr == 0) //Since if app process WM\_RBUTTONDOWN it should return zero
    	  {
                          printf(" \\n Message Sent \\n"); //Strangely ,this output is printed though i don't see any action on browser
    	  }
    	  else
    	  {
    		 printf("\\n Failed to send message \\n"); 
    	  }
    }
    else
    {
    	printf("\\n Failed to retrieve handle \\n");
    }
    return 0;
    

    }

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    C / C++ / MFC question

  • Get list of groups for a given user using ActiveDirectory
    Q QuickDeveloper

    Hi I am getting the list of groups for a particular user using ActiveDirectory. I am using the following code.

    void GetUserDetailsFromAD()
    {
    string _userName = Environment.UserName;
    string _userDomain = Environment.UserDomainName;

    //Use given URL
    using (DirectoryEntry de = new DirectoryEntry(string.Format("LDAP://URL /OU=XYZ,DC={0},DC=XYZ,DC=XYZ,DC=com",_userDomain)))
    {
    //Create a text file to write details
    TextWriter tw = new StreamWriter("C:\\LDAP.txt");

                    de.AuthenticationType = AuthenticationTypes.Secure |AuthenticationTypes.ReadonlyServer;
                    using (DirectorySearcher search = new DirectorySearcher(de))
                    {
                        search.Filter = "(sAMAccountName=" + \_userName + ")";
                        search.PropertiesToLoad.Add("displayName");
                        search.PropertiesToLoad.Add("memberof");
                        SearchResult result = search.FindOne();
    
    
                        if (result != null)
                        {
                            \_displayName = result.Properties\["displayname"\]\[0\].ToString();
    
                            //Loop through all the groups that user is part of
                            foreach (object item in result.Properties\["memberof"\])
                            {
    
                                 //Write the groups to a text file
                                tw.WriteLine(item.ToString());
    
                              //Check whether the group in which user is present starts with ABC
                                if (item.ToString().StartsWith("CN=ABC,DC=DEF"))
    			{
    				//user is member of ABC group
    			}
    			else
    			{
    			       //user is not member
    			}
                            }
                        } 
                    }
    
                    tw.Close();
               
              
            }
    

    }

    When i run these program from my local machine(let's say machine A) ,the list of groups which _userName belongs to is populated in C:\\LDAP.txt file.However if i run this from another machine (machine B) in same network,only some groups are displayed ,not all.Eg:If machine A lists group 1,2,3,4 ,machine B lists only 1,2. 1)How can i know whether there are any restrictions in place on other system?(due to which all groups are not displayed) 2)How to check whether there any changes in network settings in the second machine with respect to Active Direc

    C# question com sysadmin tutorial workspace

  • how to create frames in ASP.NET
    Q QuickDeveloper

    thank you very much Christian... could you give a sample link ....(you mean i need to create frames in html page and put target as .aspx page)??

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    ASP.NET asp-net csharp tutorial question

  • how to create frames in ASP.NET
    Q QuickDeveloper

    hi i have created a ASP.NET web application. I have 3 web forms (.aspx) pages in that.I have 2 hyperlinks in one page.when i click on that link,the repective page should load.I am able to display page from link(without frames),but link disappears(since it's another page). So can anybody tell me how to create frames,so that page will be displayed in some area and hyperlink will be visible at top?

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    ASP.NET asp-net csharp tutorial question

  • Difference between C++ and VC++
    Q QuickDeveloper

    hrishiS wrote:

    What is the differrence between C++ and VC++.

    C++ in general refers to the language, independent of compiler.There are various compilers for C++ like C++ in windows(VC++),linux(GCC) etc. VC++ is Microsoft's Compiler of C++,with it's own libraries primarily developed for MS Operating Systems. This http://en.wikipedia.org/wiki/List_of_compilers#C.2FC.2B.2B_compilers[^] should help you. Hope that gives a start

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    C / C++ / MFC question c++ visual-studio learning workspace

  • how to increment Application Object in Global.asax file
    Q QuickDeveloper

    Abhishek Sur wrote:

    if (Application.AllKeys.Contains("userCount"))

    thanx Abhishek..it really works!!! :)

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    ASP.NET csharp question asp-net visual-studio help

  • how to increment Application Object in Global.asax file
    Q QuickDeveloper

    i thought Application object is global object and therefore it exists/initialized by default.....thanx for help..i'll check on the web

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    ASP.NET csharp question asp-net visual-studio help

  • how to increment Application Object in Global.asax file
    Q QuickDeveloper

    hi i am using Application Object to count the number of users created for a webpage.I am using following code in C#:

    1.   protected void Session\_Start(object sender, EventArgs e)
      
    2.  {
      
    3.       int userCount=(int)(Application\["userCount"\]) ;
      
    4.       Application\["userCount"\] = ++userCount;
      
    5.   }
      

    It gives error @ line 3 saying Object reference not set to an instance of an object. in WebPage. how do i increment Application Object Value in Session_Start? i tried

    Application["userCount"] + =1

    but it says Can't convert Int to Object type.... I am using VS 2008 /ASP.NET 3.5 thanx in advance..

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    ASP.NET csharp question asp-net visual-studio help

  • Copy web reference to local folder
    Q QuickDeveloper

    hi all Can anyone tell me How can i copy web references to local application? I mean if i create VS 2008 web application and add web reference...do the dll's get copied to local system? i need to copy the libs to a common folder. any links wud be fine

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    ASP.NET question visual-studio

  • Read XML Data from C#
    Q QuickDeveloper

    hi i need to read XML data from an XML file into C#.i tried using XmlTextReader class but i am not getting all elements. My XML file is as follows

    <?xml version="1.0"?>
    <Form1>
    <button>username</button>
    </Form1>

    My code is as follows

    // Create an instance of XmlTextReader and call Read method to read the file

            XmlTextReader textReader = new XmlTextReader("C:\\\\books.xml");
    
            textReader.Read();
    
            // If the node has value
    
            while (textReader.Read())
    
            {
    
                // Move to fist element
    
                textReader.MoveToElement();
    
    
                  Console.WriteLine("Attribute Count:" + textReader.Value.ToString());
            }
    

    in the above code i am not getting all the nodes and elements...(maybe due to whitespaces) please give links to any code samples etc...is there any other method to read?? thanks in advance...

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    C# csharp xml question announcement

  • delete operator in C++
    Q QuickDeveloper

    i declared the following code

    class A
    {
    int i;
    public:
    void Showi()
    {
    i=10;
    printf("\n i:%d ",i);
    }
    };

    void main()
    {

    A \*p= new A();
    p->Showi();
    
    if(p)
    {
      **delete p;**
      printf("\\n p deleted ");
    }
    p->Showi();
    

    }

    the problem is even after i deleted pointer p ..the call to Showi() works....does it mean p is deleted after sometime(since i heard VS 2005 uses GC)? i am using VC++ 2005 express edition.

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    C / C++ / MFC c++ visual-studio help question

  • How to get cin cout in MFC dialog based application
    Q QuickDeveloper

    hi If u are using MFC...you can do the following Cin: 1)Put some controls in dialogbox like textbox etc. 2)Bind variables to that controls 3)When somebody types into that text control ,you can get the values into the variables using unctions like UpdateWindow etc Cout: 1)You can put a static control on dialog and display message(use SetWindowText API) 2)Use a Simple MessageBox 3)Draw Text on the dialog (not needed here) some links: http://www.flounder.com/getdlgitem.htm[^] http://msdn.microsoft.com/en-us/library/86kdbbs8.aspx[^] Hope that helps

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    C / C++ / MFC c++ design tutorial

  • Size of datatype dependent on OS or Hardware Architecture?
    Q QuickDeveloper

    hi i would like to know if whether the size of datatype C++ is dependant on which of the following ( or on all of them ) ? 1)Operating System 2)Hardware Architecture 3)Compiler Eg:Does size of int on 64 bit Hardware with 32/64 bit windows varies?

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    C / C++ / MFC c++ hardware architecture question

  • How to read data from a serial port in COM
    Q QuickDeveloper

    hi You need to treat the Serial Port as a file.If you are using Asynchronous communication you can use CommEvents. The Following links can help http://msdn.microsoft.com/en-us/library/aa450602.aspx[^] http://msdn.microsoft.com/en-us/library/aa450667.aspx[^] Hope that helps

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    COM com tutorial

  • find a book for the beginner
    Q QuickDeveloper

    you can try the following books 1)Programming Windows With MFC by Jeff Prosise 2)Programming Windows by Charles Petzold hope that helps.....

    "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

    C / C++ / MFC c++ learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups