Click here to Skip to main content
15,894,646 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionInserting a Bitmap into a RichEditctrl Pin
ForNow13-Oct-21 14:08
ForNow13-Oct-21 14:08 
SuggestionRe: Inserting a Bitmap into a RichEditctrl Pin
David Crow14-Oct-21 9:10
David Crow14-Oct-21 9:10 
GeneralRe: Inserting a Bitmap into a RichEditctrl Pin
ForNow14-Oct-21 9:49
ForNow14-Oct-21 9:49 
QuestionUnable to initialize of clear initial buffer or value of richeditcontrol Pin
ForNow7-Oct-21 13:15
ForNow7-Oct-21 13:15 
AnswerRe: Unable to initialize of clear initial buffer or value of richeditcontrol Pin
Richard MacCutchan7-Oct-21 21:53
mveRichard MacCutchan7-Oct-21 21:53 
GeneralRe: Unable to initialize of clear initial buffer or value of richeditcontrol Pin
ForNow7-Oct-21 21:58
ForNow7-Oct-21 21:58 
GeneralRe: Unable to initialize of clear initial buffer or value of richeditcontrol Pin
Richard MacCutchan7-Oct-21 22:34
mveRichard MacCutchan7-Oct-21 22:34 
GeneralRe: Unable to initialize of clear initial buffer or value of richeditcontrol Pin
ForNow7-Oct-21 23:12
ForNow7-Oct-21 23:12 
QuestionC language exercise - beginner Pin
Senhor League6-Oct-21 17:49
Senhor League6-Oct-21 17:49 
AnswerRe: C language exercise - beginner Pin
Victor Nijegorodov6-Oct-21 19:43
Victor Nijegorodov6-Oct-21 19:43 
AnswerRe: C language exercise - beginner Pin
CPallini6-Oct-21 22:46
mveCPallini6-Oct-21 22:46 
GeneralRe: C language exercise - beginner Pin
David Crow7-Oct-21 2:08
David Crow7-Oct-21 2:08 
AnswerRe: C language exercise - beginner Pin
jsc427-Oct-21 5:18
professionaljsc427-Oct-21 5:18 
GeneralRe: C language exercise - beginner Pin
Graham Breach7-Oct-21 11:30
Graham Breach7-Oct-21 11:30 
GeneralRe: C language exercise - beginner Pin
Bram van Kampen15-Oct-21 13:35
Bram van Kampen15-Oct-21 13:35 
GeneralRe: C language exercise - beginner Pin
Richard MacCutchan15-Oct-21 22:04
mveRichard MacCutchan15-Oct-21 22:04 
AnswerRe: C language exercise - beginner Pin
Bram van Kampen15-Oct-21 13:29
Bram van Kampen15-Oct-21 13:29 
Questiondata structure Pin
User 153459235-Oct-21 15:05
User 153459235-Oct-21 15:05 
AnswerRe: data structure PinPopular
Dave Kreskowiak5-Oct-21 17:11
mveDave Kreskowiak5-Oct-21 17:11 
AnswerRe: data structure Pin
Maximilien6-Oct-21 12:44
Maximilien6-Oct-21 12:44 
AnswerRe: data structure Pin
Bram van Kampen15-Oct-21 12:50
Bram van Kampen15-Oct-21 12:50 
QuestionRun powershell in C# Pin
jwradhe23-Sep-21 0:43
jwradhe23-Sep-21 0:43 
Hi!
I am pretty new to this, but im trying to present when the latest winupdate was done on computer, and only found in powershell to present that, and i tried to run it in C#, but no error and no result.
I understand that im doing wrong, but what is the best way to do this?

// Get Latest Windows Update
        private void LastWinUpd()
        {
           
            Runspace runspace = RunspaceFactory.CreateRunspace();
            runspace.Open();

            PowerShell ps = PowerShell.Create();
            ps.Runspace = runspace;

            //ps.Commands.AddScript("gwmi win32_quickfixengineering | Select-Object -expandProperty 'installedon' | sort installedon -desc | Select-Object -First 1 | Get-Date -Format 'yyyy - MM - dd K'");

            ps.AddCommand("$a = (New - Object - com 'Microsoft.Update.AutoUpdate').Results");
            ps.AddCommand("$a.LastInstallationSuccessDate | Get - Date - Format 'yyyy-MM-dd K'");

            Collection<PSObject> results = ps.Invoke();

            runspace.Close();

            StringBuilder stringBuilder = new StringBuilder();
            foreach (PSObject obj in results)
            {
                text_LastWinUpd.Text = obj.ToString();
            }
           
        }
        // END

AnswerRe: Run powershell in C# Pin
Richard MacCutchan23-Sep-21 0:49
mveRichard MacCutchan23-Sep-21 0:49 
AnswerRe: Run powershell in C# Pin
Richard Deeming23-Sep-21 1:14
mveRichard Deeming23-Sep-21 1:14 
GeneralRe: Run powershell in C# Pin
jwradhe23-Sep-21 1:48
jwradhe23-Sep-21 1:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.