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
E

Erik

@Erik
About
Posts
72
Topics
47
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Which tool to monitor file and registry changes?
    E Erik

    Hi, for a professional application, I am looking for a tool that is able to: - monitor user defined paths for file changes - monitor registry changes of defined registry folders - log the fact that a change has taken place, and by which process (for example: test.ini modified by notepad.exe) - log a short diff report (this is the point that I really found no real solution for... i.e. show what was actually changed in a file and create a diff-report like Windiff oder KDiff) I already found tools like FileSpy on sourceforge which can do part of what I need, but no tool which is capable of doing them all. Any suggestions where to look at? Preferrably free software, but if the tool is good, it may also be commercial software.

    Free Tools windows-admin tools tutorial question

  • How to use DisableProcessWindowsGhosting in a VC6 application?
    E Erik

    The problem is that my app still has to support Windows NT 4.0 Additionally, I guess it is part of the latest platform SDK available for VC6, I just wonder how to configure my project settings correctly...

    C / C++ / MFC help tutorial question workspace

  • How to use DisableProcessWindowsGhosting in a VC6 application?
    E Erik

    Hi, I need to set the DisableProcessWindowsGhosting(VOID) function in an application developed in VC6.0 The problem is that Windows.h that comes with that old programming environment does not know this function yet. What do I have to include in order to get access to that function?

    C / C++ / MFC help tutorial question workspace

  • [MFC] Keep thread alive until application exits
    E Erik

    Hi, I use the CWinThread class to have my CDialog GUI stay responsive while doing some lengthy calculation. However, my thread needs to stay alive, since it can receive some notification anytime while my application runs. The problem I have is that after InitInstance is done, my thread automatically enters the ExitInstance method, which I do not want. However, I want my thread to stay alive until I close my CDialog, and then enter ExitInstance. Any idea how this can be performed? Thanks alot.

    C / C++ / MFC c++ mobile help question

  • ::__argv ist NULL, but ::__argc is correct, why?
    E Erik

    Hi, I am currently writing a unicode MFC application in VS 8, and I want to get my commandline arguments. So I use ::__argv and ::__argc, but while the argument count is always determined correctly, ::__argvs always NULL in my Apps InitInstance-method. Why? m_lpCmdLine however works, but I'd rather want to use __argv. Any hint why this parameter is always NULL?

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

  • How can I filterresources from an external assembly by type (text, icons, etc.)?
    E Erik

    Hello, I already figured out how to load another assembly from my C# application, and extract the resources embedded to that assembly. My problem is that I'd like to filter the resources by type, i.e. I want to get only text resources, but not icons and other stuff. The code I use at the moment looks like this:

    Assembly target = Assembly.LoadFile(filename);
    string[] list = target.GetManifestResourceNames();

                foreach (var listentry in list)
                {
                    Stream resourceStream = target.GetManifestResourceStream(listentry);
    
                    var rr = new ResourceReader(resourceStream);
                    IDictionaryEnumerator dict = rr.GetEnumerator();
                    int ctr = 0;
                    while (dict.MoveNext())
                    {
                        ctr++;
                        string entry = dict.Value; //I'd like to know what kind of resource this is, how can I do that?
    
                    }
                    rr.Close();
                }
    

    How can I determine which kind of resource entry I currently get, i.e. if it's an icon, a text resource, or something else?

    C# question csharp hardware help tutorial

  • VS2005: mixed-language menus and dialogs (german and english)
    E Erik

    Hi tolw, thanks alot for your hint. I looked at the installed software, but all the updates and even the service packs are installed in English language (ENU), here is a screenshot: http://picfront.de/d/8cDs[^] I am totally confused now...

    Visual Studio tutorial design help question announcement

  • VS2005: mixed-language menus and dialogs (german and english)
    E Erik

    Hello, I am using a german Windows XP operating system, but I usually install the english version of any development environment, since this makes reading and comparing settings in international forums much easier. So far, this has worked perfectly for me, when I installed VisualStudio 2005, everthing was perfect, and the whole user interface was in english language, as expected. Since some days, and probably some operating system updates (I cannot tell exactly since when), I get mixed lagnueage entries in menus and dialogs. For example, the header of all dialogs in VC2005 is english, but the menu entries are German language. The "Edit" menu title is in english (in a german version, this would probably be "Bearbeiten"), but the "copy" entry for example is in german language ("Kopieren"). The same is true for the Project settings dialog, some parts are german, others english language. I have made some screenshots to illustrate this strange behaviour, and emphasized some German and english sections in red rectangles: http://picfront.de/d/8cDn[^] http://picfront.de/d/8cDo[^] Do you have any idea what might have caused this behaviour, and more important: how to fix it? Thanks alot.

    Visual Studio tutorial design help question announcement

  • MFC: ownderdrawn menu, how can I change the default menu border?
    E Erik

    Hi, I have created my own ownerdrawn menu, subclassed from CMenu, implementing the MeasureItem and DrawItem methods, which works flawlessly so far. However, I would like to change the visual appearance of the complete menu border, i.e. not the border of single menu items, but the whole menu border instead. Is there a good way to achieve this? Which method do I have to reimplement?

    C / C++ / MFC question c++

  • How to convert filename to fully qualified name when running an app with a filename argument in the current working directory
    E Erik

    Hi, thanks for your hints, I have also searched in the MSDN Lib myself, and have come to the conclusion that GetFullPathName works best for me, since it automatically expands a given filename to the full path. That was exactly what I wanted, and it works. :)

    C / C++ / MFC tutorial c++ json question

  • How to convert filename to fully qualified name when running an app with a filename argument in the current working directory
    E Erik

    Hi, I am writing a commandline app that accepts a filename as parameter, and wonder if there is an easy way to convert the filename to a fully qualified filename when starting the app within a directory, and provide a filename that is located in the current working directory. for example, my app is located in c:\test\myapp.exe, and the file infile.txt is located there as well. So a user can call myapp.exe infile.txt from that directory. In my app, I'd like to be infile.txt converted to c:\test\infile.txt. Is there a function in the Win API or MFC that automatically expands filenames to full qualified path? Next step would be to allow relativ paths as well. Any hint how to do that? Thanks alot.

    C / C++ / MFC tutorial c++ json question

  • How to determine memoy footprint of an application (compare 32Bit vs. 64Bit OS)
    E Erik

    Hi, I'd like to compare the memory usage of my applications running on Windows 7 32Bit vs. 64Bit version. The question is simple: which tool do you recommend to measure the approximate memory usage of some of my sample applications? Of course I do not need it to the last byte, but a good estimate. I have installed process explorer, but which of the columns does represent the actual memory usage of a process best? Thanks for any hints.

    The Lounge question visual-studio performance tutorial announcement

  • MFC: How to set the focus to the previously focused window?
    E Erik

    Hi, I need to set the focus to the window that had the focus before my dialog was first selected. To be more precise: as soon as the user clicks a button in my dialog, I want to set the focus to the window that had the focus before the user clicked in my dialog. I also want to be able to realize if that window has been closed in the meantime. What is the best way to achieve that? Thanks alot for any suggestions.

    C / C++ / MFC question c++ tutorial

  • How to change the font-size of a popup-menue (MFC, VC6)
    E Erik

    Thanks, I have done that now. There still stays one big problem which I simply do not understand: My menu is created using CreatePopupMenu, and it does not belong to a Main window. However, MFC always calls the MeasureItem overridable for my Mainwindow, which has a CMenu member, which is null, because the menu is not part of my mainwindow. How can I achieve that the MeasureItem method of my subclassed menu is called directly, instead of the mainwindows Measureitem function?

    C / C++ / MFC c++ tutorial question

  • How to change the font-size of a popup-menue (MFC, VC6)
    E Erik

    Thanks alot, I have found these, but they are mostly overdoing for my purpose. All I wanna do is change the font size, nothing more, so I had to remove 95% of the code. I was just wondering if there is some really simple way to achieve only the font size changing. Besides, my Menu has no mainwindow, it's just a popupmenu (CMenu::CreatePopupMenu). Most samples seem to require a mainwindow, however. Is there really no simple example without all the fancy rest of XP-style menus?

    C / C++ / MFC c++ tutorial question

  • How to change the font-size of a popup-menue (MFC, VC6)
    E Erik

    Hi, I wonder if there is a quick and easy way to change the height of a PopupMenu (i.e. so that each line in the menu has an increased vertical size), and also change the font size to use a bigger font. Do you have any code samples that can do that? Unfortunately, CMenu does not have an appropriate member to set the font size, or am I missing something? Thanks alot.

    C / C++ / MFC c++ tutorial question

  • Which is the best way to shutdown, reboot, or logoff from the system in C# (.NEt 4.0)?
    E Erik

    Hi, I have to write an application that has the ability to perform a system-restart, shutdown or user-logoff. So far, I have found two solutions to do it, which both work very well. I'd like to know which is the best way to do it, i.e. if there are any disadvantages to the one or the other way to do it. Which is the most professional way to deal with it? Currently, I use the System.Management Namespace, whic looks like the most elegant way to do this to me:

    ManagementBaseObject mboShutdown = null;
    using (ManagementClass mcWin32 = new ManagementClass("Win32_OperatingSystem"))
    {
    mcWin32.Get();
    mcWin32.Scope.Options.EnablePrivileges = true;
    ManagementBaseObject ShutdownParams = mcWin32.GetMethodParameters("Win32Shutdown");
    ShutdownParams["Flags"] = "1";
    ShutdownParams["Reserved"] = "0";
    foreach (ManagementObject manObj in mcWin32.GetInstances())
    {
    mboShutdown = manObj.InvokeMethod("Win32Shutdown", ShutdownParams, null);
    }
    ret = true;
    }

    On the other hand, I have found many users who load the appropriate system-DLLs, and perform the whole tsak "unmanaged", an call ExitWindowsEx from these DLLs. This works too, but I am wondering why people decide to do it this way, if there is a namespace available in .NET that actually does it, like in my example above. Which way would you chose, and why?

    C# csharp tutorial question

  • How can I get the filename and sourcepath of a running process?
    E Erik

    Hi, I am using something like this to get all my running processes:

          Process\[\] processlist = Process.GetProcesses();
          foreach(Process theprocess in processlist)
          {
                 Console.WriteLine("Process: {0} ID: {1}", theprocess.ProcessName, theprocess.Id);
          }
    

    My problem is that I want to know the filename (EXE) of a process, and the pathname it was started from. For example, if there is a process Notepad.exe running, I want to determine in which folder that file actually resides, i.e. something like "C:\Windows\system32\notepad.exe". How can I get that information? I already tried to get the member StartInfo. but it doesn't contain a link to the folder. How can I do this?

    C# question help tutorial

  • How can I access my Mainwindow-controls from a thread?
    E Erik

    Thanks alot, this solution works perfectly!

    C# question workspace

  • How can I access my Mainwindow-controls from a thread?
    E Erik

    Hi, I am currently writing a gui-application, which does some processing in a thread. I pass a reference to my mainwindow to the thread, in order to make the thread set some text inside the mainwindow. However, when I try to access any control in my mainwindow from my thread, I get: "An unhandled exception of type 'System.InvalidOperationException' occurred in WindowsBase.dll" Simple question: what is the best way to access mainwindo-gui elements from a thread? This is what my code looks like:

    public MainWindow()
    {
    InitializeComponent();
    _ProcessHelperThread = new System.Threading.Thread(ProcessHelperThread);
    _ProcessHelperThread.Start();
    }

        void ProcessHelperThread()
        {
            Processes.Init(this); //this is a reference to my mainwindow
            //run the processes defined in Startup configuration
            Processes.Startup();
        }
    

    Inside the thread (i.e. in my Processes-object), my app crashes when I try something like this:

     public int Init(MainWindow window)
        {
            window.textBlock1.Text = Waittext; //Exception
        }
    

    What is a better way to do this?

    C# question 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