Solved

IShellDispatch4 and WindowsSecurity()

Posted on 2004-09-02
5
700 Views
Last Modified: 2013-12-03
I need a code example using C++ (I am using Microsoft VC++), that uses the WindowsSecurity Method.

Reference:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/objects/ishelldispatch4/windowssecurity.asp

Regards,
0
Comment
Question by:POLITEC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 16

Accepted Solution

by:
nonubik earned 500 total points
ID: 11964759
0
 
LVL 9

Expert Comment

by:_ys_
ID: 12024517
#include <iostream>
#include "ShlDisp.h"

int main(int argc, char* argv[])
{
    CoInitialize(0);

    IShellDispatch4 *pShellDispatch4 = 0;
    HRESULT hr;

    if (SUCCEEDED(hr = CoCreateInstance(CLSID_Shell, 0, CLSCTX_SERVER,
        IID_IShellDispatch, reinterpret_cast<void**>(&pShellDispatch4))))
    {
        std::cout << "Shell instance obtained";

        if (SUCCEEDED(hr = pShellDispatch4->WindowsSecurity()))
        {
            std::cout << "Windows security invoked!!";
        }

        pShellDispatch4->Release();
    }
    else
    {
        std::cout << "Failed to obtain shell instance";
    }

    CoUninitialize();

    return 0;
}
0
 
LVL 16

Expert Comment

by:nonubik
ID: 12024674
I think this is not the problem (just method calling) but the fact that it does not behave as expected....
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question