Solved

IShellDispatch4 and WindowsSecurity()

Posted on 2004-09-02
5
680 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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…

864 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now