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
K

Krischu

@Krischu
About
Posts
15
Topics
8
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • telling c from cpp files or making VS recognize c as c++
    K Krischu

    OK thanks. Sorry for misunderstanding. It turns out that the author must have had the intention to mark all soource files being C-files (there was the option /TC alreay there). Overriding that with /TP triggers so many errors that I decided to leave in the /TC option, repair the error manually in that one C-file and will contact the author about that.

    Visual Studio c++ visual-studio question

  • telling c from cpp files or making VS recognize c as c++
    K Krischu

    Thanks. That helped partially. For the file in question it cured the problem. But it fired a cascade of other errors in other files. I choose the project settings and add the /Tp as an additional command line switch, right?

    Visual Studio c++ visual-studio question

  • telling c from cpp files or making VS recognize c as c++
    K Krischu

    I downloaded a github project (SimVDI) and tried to compile it under VS 2013 (being the only VS I have). The author named all the files with extension .c. Almost all code is C but in one place the author seemed to let a sloppiness creep in and did some C++-ish thing (auto declaration in for (int i=0...)). I repaired that to C style. But is there a way to make S treat all files with extension .c as C++ files? (rather than nameing them .cpp)?

    Visual Studio c++ visual-studio question

  • Injecting a mouse hook into a Windows application - is there a tool?
    K Krischu

    My problem: I would like to intercept/log mouse events in an application which I don't have the source for. I've read about writing a Mouse Hook and there is SetWindowsHookEx(), but I'm clueless at the moment how I can inject such into an existing application? Is there a tool that can achieve this? Or do I have to write it myself? -- Christoph

    Free Tools help question

  • Window1.xaml -> Window1.xaml.cs - how do I get this hierarchially ordered
    K Krischu

    When I create open WPF program examples I see Window1.xaml and a Window1.xaml.cs file neatly grouped together, the .cs files having a link arrow showing the relation or depency between the two files. But when I add a xaml file, paste some xml (xaml) into it from another project, I have to create a separate class file Window1.xaml.cs for example. This file, when added as a new item, is in the same tree hierarchy than the .xaml file and is not showing this arrow icon. Am I doing something wrong? -- Christoph

    .NET (Core and Framework) wpf question csharp data-structures xml

  • Intercepting the TerminateProcess event
    K Krischu

    Thanks a lot. I will look into it. -- Christoph

    C / C++ / MFC question help

  • Intercepting the TerminateProcess event
    K Krischu

    Covean wrote:

    Have you control about the subprocess? If so why not use named events? HANDLE hEvent = CreateEvent(NULL, true, false, "some_silly_name_you_can_refer_to_in_your_processes");

    Thanks. Yes, I have control of the process' source code. Will try something in that vein. -- Christoph

    C / C++ / MFC question help

  • Building application wizards or applications like DevStudio
    K Krischu

    I would like to find a starting point to write a .NET application that looks like Develeoper Studio itself. Dockable Windows for stdout,stderr, tree views, ribbon bars etc. Is there such? Preferably something in WPF, describable in XAML. -- Christoph

    .NET (Core and Framework) csharp wpf data-structures question

  • Intercepting the TerminateProcess event
    K Krischu

    In the vein of my CreateProcess() question in a parallel thread today I'm facing the problem of letting the called subprocess doing some tidying up work before really following the termination signal. Would that be possible? Or would it be better to send the process a different signal (in UNIX that would have been a USR signal) and wait a time period for receiving the termination event and if that does not occur in time, then terminating it brute force? Is the TerminateProcess an unconditional signal that cannot be intercepted by the process under termination itself? Hope I expressed myself clearly enough :) -- Christoph

    C / C++ / MFC question help

  • Process Termination waiting for Event - Win32
    K Krischu

    Great! Many thanks. Just a minor drawback: When I stay in the while loop and the pi.hProcess has fired, the event sustains. Is there a way to reset the event automatically (or programmatically)? -- Christoph [edit] I did the following (not sure whether it's correct):

    while(1) {

    	dWait = WaitForMultipleObjects(2, &hEvents\[0\], FALSE, 1000 /\* ersetzt Sleep() \*/);
        switch(dWait)
    		{
    			case WAIT\_OBJECT\_0 + 0: /\* hServerStopEvent gefeuert\*/
    			{
    				 goto cleanup;
    				 break;
    			}
    			case WAIT\_OBJECT\_0 + 1: /\* pi.hProcess gefeuert \*/
    			{
    				  // the started process has terminated
    				  
    				  timestamp(),fprintf(logfile,"Subprozess hat beendet mit exitcode %d, was tun?\\n",
    					  GetExitCodeProcess ( pi.hProcess, &procstat ));fflush(logfile);
    				  **ResetEvent(hEvents\[1\]);
    				  hEvents\[1\]=NULL;**
    				  
    				 // do something
    				 break;
    			}
    			default: // Timeout
    			{
    				   // do something
    				  break;
    			 }
    		 }
     }
    

    modified on Wednesday, November 11, 2009 10:01 AM

    C / C++ / MFC help question

  • program
    K Krischu

    I think you gotta check your for loop bracing. Please put your question in English. Also a bit prettier printing would help yourself in understanding your code. You might want to put it in a code block after running it through "indent". -- Christoph

    C / C++ / MFC help

  • Process Termination waiting for Event - Win32
    K Krischu

    Thanks for answering. I thought so as well. Could you supply some sample code? Does the -->>> WaitForSingleObject(pi.hProcess,INFINITE); hang in that function call? Then I would not reach the code section after it which already contains : I think I have to create some sort of event and put it in the hEvents[] array.

     // Start the child process.
     if( !CreateProcess( NULL,   // No module name (use command line).
        execpath,         // Command line.
        NULL,             // Process handle not inheritable.
        NULL,             // Thread handle not inheritable.
        FALSE,            // Set handle inheritance to FALSE.
        0,                // No creation flags.
        NULL,             // Use parent's environment block.
        NULL,             // Use parent's starting directory.
        &si,              // Pointer to STARTUPINFO structure.
        &pi )             // Pointer to PROCESS\_INFORMATION structure.
      )
     
    // Wait until child process exits.
    //--->>>> WaitForSingleObject( pi.hProcess, INFINITE );
    
     while(1) {
             dWait=WaitForMultipleObjects(1,hEvents,FALSE,0);
             if(dWait == WAIT\_OBJECT\_0)
                     break; 
             Sleep(1000);/\* millisec \*/
     }
     cleanup:
         if(pi.hProcess){
                //GetExitCodeProcess ( pi.hProcess, &procstat );
                TerminateProcess(pi.hProcess,-1); //terminated by service termination
                fprintf(logfile,"Subprocess %s terminated by service\\n", execpath );
    

    -- Christoph

    modified on Wednesday, November 11, 2009 8:42 AM

    C / C++ / MFC help question

  • Process Termination waiting for Event - Win32
    K Krischu

    I have a Win32 Service (written in C) that does a CreateProcess(). After that it waits for its own termination (the services'). I would like to monitor the subprocess such that the service gets notified when the subprocess terminates (for whatever reason). I have an idea of doing this with events and WaitForMultipleObjects(), but somehow I'm missing the idea where to start. Should the service create an event? Or should the subprocess do that? And how would that be notified to the service process so that it can wait for that event? Help very much appreciated. -- Christoph

    C / C++ / MFC help question

  • CreateProcess API for C# .NET?
    K Krischu

    Is there an API for the Win32 CreateProcess interface with all functionality available in C#/.NET? I'm seeking for an example and would be very grateful for one.

    C# csharp json tutorial question

  • drag and drop a selection into a .BAT
    K Krischu

    Hi, I'm new to this forum and this is my first post. I want to select a number of files and drag/drop then onto an icon (behind which is a .bat) Then the .bat should process one file after the other. .bats as I understand only accept 10 arguments (old DOS anachronism) but even on under Unix one has this problem and for that purpose the is a technique, called xargs. Is there something like that (freely) available for Windows?

    IT & Infrastructure help question
  • Login

  • Don't have an account? Register

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