Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

IShellDispatch4 and WindowsSecurity()

Posted on 2004-09-02
5
Medium Priority
?
709 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 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
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…
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…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

610 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