Solved

IShellDispatch4 and WindowsSecurity()

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

11 Experts available now in Live!

Get 1:1 Help Now