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
S

Sunil P V

@Sunil P V
About
Posts
90
Topics
34
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Windows Shutdown notification in a MFC Dialog app
    S Sunil P V

    :)

    Sunil

    Managed C++/CLI c++ question

  • Windows Shutdown notification in a MFC Dialog app
    S Sunil P V

    Hi, I need a notification mechanism for windows shutting down prefferably wthout polling. Any ideas? Thanks in advance.

    Sunil

    Managed C++/CLI c++ question

  • File download help
    S Sunil P V

    Sorry. That was a typo. What you said is right. I found a solution for this by setting a timeout using the CInternetSession class. However I have ended up with another similar problem. I am reading a file over the network drive using CFIle class. Now if the network drive access is lost (due to any reason) can we get to know this. The read() function continues without breaking. How can this be solved?? Please help...

    Sunil

    C / C++ / MFC c++ sysadmin tools help question

  • File download help
    S Sunil P V

    Hi, I am developing a file download utility using MFC. The application downloads a simple file over the internet. During download, is there a way to detect if the network connectivity is lost? Because the CHttpFile->Read function doesn't exit if the connection isn't lost.

    Sunil

    C / C++ / MFC c++ sysadmin tools help question

  • File download from network drive
    S Sunil P V

    Hi, How do I download/copy a file from a remote drive to my local drive. I know the use of API "CopyFile" but what I would like to accomplish is download a big file ~20Mb in packets of 4096bytes. Please help...

    Sunil

    C / C++ / MFC sysadmin json help question

  • Need help to pan client area of a window using win32 api / mfc
    S Sunil P V

    On the lookout for the code I had developed. Will send it ASAP :)

    Sunil

    C / C++ / MFC c++ json help

  • Need help to pan client area of a window using win32 api / mfc
    S Sunil P V

    THanks Richard

    Sunil

    C / C++ / MFC c++ json help

  • Need help to pan client area of a window using win32 api / mfc
    S Sunil P V

    Hi, We can achieve this. Please understand the below simple concept with respect to CAD or any drafting utility. We have 2 view perspective always. 1. the world window 2. the view port window. (this is what you need to add in your program) The above can be best understood with the this example: Assume you are taking photograph of a flower in a park. Now, we focus only the flower in the view finder of your camera, and the park in this case forms the world around the flower. So in this case the park becomes the world window and the flower becomes the view window. Similarly the whole drawing in your application is the world window whereas the part of the drawing that is shown to the end user is the view window. You have to make use of the SetViewportOrg method in your application. Please read this http://msdn.microsoft.com/en-us/library/46t66w7t.aspx[^]. Let me know if you need more help, I have done this before but unfortunately cannot find the source for it...

    Sunil

    C / C++ / MFC c++ json help

  • SDI application with 3 views [SOLVED]
    S Sunil P V

    Inherit your application view class from CFormView. This enables you to have controls on the view just like you would have on a dialog. For your usage I think this is suitable and it saves time. Check for online samples too...

    Sunil

    C / C++ / MFC c++ design data-structures help tutorial

  • Connecting and disconnecting from internet
    S Sunil P V

    Well there are 2 crude ways to do it: (if you haven't written drivers for your connectivity interfaces ;P ) 1. Enumerate all the network interfaces (non-virtual) and disable them 2. Configure a non-existent proxy server (like 0.0.0.0 port 80) for time being. After you are done with your execution reset this dummy proxy. Ensure you can backup any existent proxy settings if any.

    Sunil

    C# question

  • Re: Backgroundworker Thread Issue
    S Sunil P V

    Hey munishk, I had developed and application that created approximate of 20 Background workers. All these workers had to update progressbars embedded in a listview for around 20 listview items. However, initially the DoWork event handler used to update the UI which made the UI very sloppy and was sometimes showing a hung behavior. I changed the implementation to make use of Delegates to update the UI and by calling the BeginInvoke method this issue got resolved.

    // declare a delegate to update your progress
    void delegate UpdateProgressDelegate(object params);

    private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
    {
    //Do Intensive Work
    ArgumentClass backGroundCls = e.Argument as ArgumentClass;

      //Now you can do whatever you want to do with passed arguments
    
      int ctr=0;
      do
      {
          ctr++;
          UpdateProgressDelegate del = new UpdateProgressDelegate(UpdateProgress);
          del.BeginInvoke(ctr, null, null);
      } while (ctr < 10000000);
    

    }

    private void UpdateProgress(int ctr)
    {
    // update progress here
    }

    This should definitely work and solve your issue.

    Sunil

    C# mobile help question announcement

  • Re: Backgroundworker Thread Issue
    S Sunil P V

    Even when using the Background worker, I advice to make use of BeginInvoke methods to update the user interface elements. This has worked for me big time. Create appropriate delegates for user interface updates and invoke them as and when necessary.

    Sunil

    C# mobile help question announcement

  • a c++ code implimenting a single linked list
    S Sunil P V

    Be crisp and clear.

    Sunil

    C / C++ / MFC c++ data-structures

  • How to undo drawing images in MFC.?
    S Sunil P V

    Check this link http://www.codeproject.com/Messages/4305065/Re-How-to-Undo-Redo-drawing-operation-in-a-dialog-.aspx[^]

    Sunil

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

  • need help with serial communications
    S Sunil P V

    Check this link CSerialPort v1.03 - Serial Port Wrapper[^] I am sure this will help you.

    Sunil

    C / C++ / MFC help question

  • How to Get Event from Controls in Docking Dialog
    S Sunil P V

    You need to subclass the dialog so that it can get events.

    Sunil

    C / C++ / MFC help debugging tutorial

  • How to Undo/Redo drawing operation in a dialog based application.?
    S Sunil P V

    Well Undo/Redo can be handled in an easier and simpler way. There are complex ways of achieving it like double buffering etc but they seem to work exceptionally well in OpenGL. For simple MFC applications you can follow a simple approach. Create a (master)list class that stores the objects to be drawn. As and when you create a new object add it to this list. Maintain another Undo and Redo list. When the user hits on Undo option pop(remove) the last object added from the master list class add this object to your Undo list class. After this re-draw your dialog. When the user hits on Redo option pop(remove) the last object added from the Undo list class add this object to your Master list class. After this re-draw your dialog.

    Sunil

    C / C++ / MFC graphics help tutorial question

  • C# - window logon events
    S Sunil P V

    This can be achieved by using Win32 API. Create a method and add a Hook to get the windows notifications including logon, logoff, locked, unlocked etc. So if you are using a Winform application include this namespace

    using System.Windows.Interop;

    In the initialize method add this piece:

                HwndSource source = HwndSource.FromHwnd(this.Handle);
                source.AddHook(new HwndSourceHook(WndProc));
    

    where WndProc is

    private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled);

    Let me know if you need a detailed implementation. I can help. Also you need to add some interop methods to access the WM_WTSSESSION_CHANGE, WTS_SESSION_UNLOCK etc.

    Sunil

    C# sysadmin csharp help tutorial

  • default textbox value
    S Sunil P V

    Use the Properties window to set the 'Text' property to 0. This could be set as default when your form initializes. When the textbox loses focus add a validation. This should suffice. Alternatively I suppose you can set the text box to accept numbers only.

    Sunil

    C# csharp tutorial

  • User privilege issue logged on user (non local system account)
    S Sunil P V

    Thanks Dave. But is there a way to hack this. I want the logged on user's environment variables even though the application is invoked as an admin user. I suppose impersonation would not work because the admin account does not fall under local system account...

    Sunil

    C# help workspace
  • Login

  • Don't have an account? Register

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