Click here to Skip to main content
15,920,111 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: directshow samplegraber Pin
Richard MacCutchan7-Feb-12 22:30
mveRichard MacCutchan7-Feb-12 22:30 
QuestionDifference between CHOICE and TIMEOUT dos commands Pin
vanikanc6-Feb-12 5:00
vanikanc6-Feb-12 5:00 
AnswerRe: Difference between CHOICE and TIMEOUT dos commands Pin
Richard MacCutchan6-Feb-12 5:36
mveRichard MacCutchan6-Feb-12 5:36 
QuestionWindows XP Embedded Crypto Providers Pin
Member 23122052-Feb-12 9:33
Member 23122052-Feb-12 9:33 
AnswerRe: Windows XP Embedded Crypto Providers Pin
enhzflep27-Feb-12 4:41
enhzflep27-Feb-12 4:41 
QuestionCreate 32 and 64 bits COM dll Pin
MrKBA1-Feb-12 22:11
MrKBA1-Feb-12 22:11 
AnswerRe: Create 32 and 64 bits COM dll Pin
«_Superman_»3-Feb-12 17:29
professional«_Superman_»3-Feb-12 17:29 
QuestionGeneric terms....!!! plz help Pin
♥…ЯҠ…♥31-Jan-12 17:48
professional♥…ЯҠ…♥31-Jan-12 17:48 
AnswerRe: Generic terms....!!! plz help Pin
Richard MacCutchan31-Jan-12 21:27
mveRichard MacCutchan31-Jan-12 21:27 
AnswerRe: Generic terms....!!! plz help Pin
Richard MacCutchan1-Feb-12 3:38
mveRichard MacCutchan1-Feb-12 3:38 
RantRe: Generic terms....!!! plz help Pin
♥…ЯҠ…♥6-Feb-12 17:39
professional♥…ЯҠ…♥6-Feb-12 17:39 
GeneralRe: Generic terms....!!! plz help Pin
Richard MacCutchan6-Feb-12 22:37
mveRichard MacCutchan6-Feb-12 22:37 
QuestionMS C++ gives error for fully-qualified ctor name in initializer list Pin
old_hacker27-Jan-12 11:23
old_hacker27-Jan-12 11:23 
SuggestionRe: MS C++ gives error for fully-qualified ctor name in initializer list Pin
Pablo Aliskevicius28-Jan-12 22:25
Pablo Aliskevicius28-Jan-12 22:25 
AnswerRe: MS C++ gives error for fully-qualified ctor name in initializer list Pin
Richard MacCutchan28-Jan-12 22:37
mveRichard MacCutchan28-Jan-12 22:37 
QuestionCan you help me solve my OTS Elevated COM Object error? Pin
Christine_Irene26-Jan-12 3:08
Christine_Irene26-Jan-12 3:08 
Hi,

I have a COM dll with a class in it. This class alters the registry at HKLM\Software\Policies\MyPolicy

The DLL has a UAC execution level of Highest Available (I think I had it still happen with asInvoker as well).

The executable that cals this dll has an execution level of invoker.

If I run this as administrator, I get the UAC prompt when my class gets invoked, and I see all my debug messages in dbgview and any debug message boxes show up.

If I log in as standard user, and right click runas administrator, everything works fine.

However, If I simply double-click, I see the UAC elevation prompt when my class gets invoked. I enter in the correct password, and the COM object creation passes, but the Registry is never changed, AND I do not see any debug messages or message boxes. If I turn off "Run all administrators in admin approval mode", I see the messages, but the program fails to set the registry keys.

Anybody have any clues? Also, do you know of any great debuggers that I may use to solve this?


More Info:

I am building it in VS 2008, but it is using visual studio version 2.0 with MFC setting to 'using standard windows libraries' and Use of ATL set to 'Dynamic Link to ATL'

I explicitly add the additional registry settings to get the elevation to work in the DllRegisterServer function.

I add the following keys to the registry:
HKLM\Software\Classes\AppID\My AppGuid(found in dllMain.h)>\ROTFlags(a string set to "1")
HKLM\Software\Classes\AppID\My AppGuid\DllSurrogate(a string set to empty)

HKLM\Software\Classes\CLSID\My ClassID (found in ClassName.rgs)\AppID (a string set to My AppGuid)
HKLM\Software\Classes\CLSID\My ClassID\LocalizedString (an expanding string set to @dllPath.dll,-100(where 100 is a string
in the string table)).

HKLM\Software\Classes\CLSID\My ClassID\Elevation\Enabled (a DWORD set to 1)

HKLM\Software\Classes\CLSID\My ClassID\Elevation\IconReference (An expanding string set to 'applicationIcon')

Also, my calling code uses the standard old

HRESULT CallingClass::CoCreateInstanceAsAdmin(HWND hwnd,REFCLSID rClsid, REFIID rIid, void** ppv)
{
  try
  {

    HRESULT     hr;
    BIND_OPTS3	bo;
    WCHAR		wszCLSID[255];
    WCHAR		wszMonikerName[300];

    StringFromGUID2(rClsid,wszCLSID,sizeof(wszCLSID)/sizeof(wszCLSID[0])); 

    hr = StringCchPrintf(
       wszMonikerName,sizeof
       (wszMonikerName)/
       sizeof(wszMonikerName[0]),   
       L"Elevation:Administrator!new:%s", 
       wszCLSID);

    if(FAILED(hr))
    {
      . . .ShowMyDebugMessage		
      return hr;
    }

    memset(&bo, 0, sizeof(bo));
    bo.cbStruct	= sizeof(bo);
    bo.hwnd	= hwnd;
    bo.dwClassContext = CLSCTX_LOCAL_SERVER;
    return CoGetObject(wszMonikerName, 
        &bo, rIid, ppv );
  }
  catch(...)
  {
    . . .Show my debug message
    return E_FAIL;
  }

  return S_OK;

}

Christine Murphy
C# developer

QuestionStore STL iterator in CListBox Pin
LionAM17-Jan-12 0:36
LionAM17-Jan-12 0:36 
AnswerRe: Store STL iterator in CListBox Pin
Richard MacCutchan17-Jan-12 0:52
mveRichard MacCutchan17-Jan-12 0:52 
GeneralRe: Store STL iterator in CListBox Pin
LionAM17-Jan-12 1:11
LionAM17-Jan-12 1:11 
GeneralRe: Store STL iterator in CListBox Pin
Richard MacCutchan17-Jan-12 1:31
mveRichard MacCutchan17-Jan-12 1:31 
GeneralRe: Store STL iterator in CListBox Pin
LionAM17-Jan-12 2:02
LionAM17-Jan-12 2:02 
GeneralRe: Store STL iterator in CListBox Pin
Richard MacCutchan17-Jan-12 3:00
mveRichard MacCutchan17-Jan-12 3:00 
GeneralRe: Store STL iterator in CListBox Pin
LionAM17-Jan-12 5:16
LionAM17-Jan-12 5:16 
GeneralRe: Store STL iterator in CListBox Pin
Richard MacCutchan17-Jan-12 5:22
mveRichard MacCutchan17-Jan-12 5:22 
GeneralRe: Store STL iterator in CListBox Pin
LionAM17-Jan-12 9:09
LionAM17-Jan-12 9:09 

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.