Click here to Skip to main content
15,886,799 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: I have used CxImage in VS2005 (successful) and tried to use CxImage WINCE version, it doesn't support .jp2 images? Pin
CPallini26-May-09 22:10
mveCPallini26-May-09 22:10 
AnswerRe: I have used CxImage in VS2005 (successful) and tried to use CxImage WINCE version, it doesn't support .jp2 images? Pin
Stuart Dootson26-May-09 22:19
professionalStuart Dootson26-May-09 22:19 
GeneralRe: I have used CxImage in VS2005 (successful) and tried to use CxImage WINCE version, it doesn't support .jp2 images? Pin
kapardhi26-May-09 22:41
kapardhi26-May-09 22:41 
GeneralRe: I have used CxImage in VS2005 (successful) and tried to use CxImage WINCE version, it doesn't support .jp2 images? Pin
Stuart Dootson26-May-09 23:01
professionalStuart Dootson26-May-09 23:01 
GeneralRe: I have used CxImage in VS2005 (successful) and tried to use CxImage WINCE version, it doesn't support .jp2 images? Pin
kapardhi26-May-09 23:25
kapardhi26-May-09 23:25 
GeneralRe: I have used CxImage in VS2005 (successful) and tried to use CxImage WINCE version, it doesn't support .jp2 images? Pin
Stuart Dootson27-May-09 1:24
professionalStuart Dootson27-May-09 1:24 
QuestionCRichEditCtrl on CMDIChildWnd Pin
prithaa26-May-09 20:20
prithaa26-May-09 20:20 
QuestionISENSLOGON getting subscribe entries to registry without any error but no notification is captured when user logon/logoff.Plz reply Masters. Pin
sakshibhugra26-May-09 20:16
sakshibhugra26-May-09 20:16 
I have tried implementing isenslogon but i am not able to get notification.
I have out logs in the function implementation for logon/logoffas follows
interface MyISensLogon : public ISensLogon
{
private:
long ref;
HWND IsensLog;

public:
MyISensLogon()
{
ref = 1;
}

STDMETHODIMP QueryInterface(REFIID iid, void ** ppv)
{

if (IsEqualIID(iid, IID_IUnknown) || IsEqualIID(iid, IID_IDispatch) ||IsEqualIID(iid, __uuidof(ISensLogon)))
{
*ppv = this;
AddRef();
return S_OK;
}

*ppv = NULL;
return E_NOINTERFACE;
}

ULONG STDMETHODCALLTYPE AddRef ()
{
return InterlockedIncrement(&ref);
}

ULONG STDMETHODCALLTYPE Release ()
{
int tmp;
tmp = InterlockedDecrement(&ref);
return tmp;
}

HRESULT STDMETHODCALLTYPE GetTypeInfoCount(/* [out] */ UINT *pctinfo )
{
return E_NOTIMPL;
}

HRESULT STDMETHODCALLTYPE GetTypeInfo ( UINT iTInfo, LCID lcid,ITypeInfo **ppTInfo)
{
return E_NOTIMPL;
}

HRESULT STDMETHODCALLTYPE GetIDsOfNames (REFIID riid, LPOLESTR *rgszNames,UINT cNames, LCID lcid,DISPID *rgDispId)
{
return E_NOTIMPL;
}

HRESULT STDMETHODCALLTYPE Invoke (DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags, DISPPARAMS *pDispParams,VARIANT *pVarResult, EXCEPINFO *pExcepInfo,UINT *puArgErr)
{
return E_NOTIMPL;
}
virtual HRESULT STDMETHODCALLTYPE Logon(BSTR bstrUserName)
{
WriteLog( "Ctrl-LogON event\n\n" );
return S_OK;
}

virtual HRESULT STDMETHODCALLTYPE Logoff(BSTR bstrUserName)
{
sprintf(temp,"Logoff for user %s with CurrentSID = %s",user,CurrentSID);
WriteLog(temp);
return S_OK;
}
virtual HRESULT STDMETHODCALLTYPE StartShell( BSTR bstrUserName)
{
WriteLog("Inside StartShell");
return S_OK;
}
virtual HRESULT STDMETHODCALLTYPE DisplayLock( BSTR bstrUserName)
{
WriteLog("Inside DisplayLock");
return S_OK;
}

virtual HRESULT STDMETHODCALLTYPE DisplayUnlock( BSTR bstrUserName)
{
WriteLog("Inside DisplayUnlock");
return S_OK;
}
virtual HRESULT STDMETHODCALLTYPE StartScreenSaver( BSTR bstrUserName)
{
return S_OK;
}

virtual HRESULT STDMETHODCALLTYPE StopScreenSaver( BSTR bstrUserName)
{
return S_OK;
}


};
subscription func is follows :-
static MyISensLogon *pISensLogon = 0;

HRESULT SubscribeLogoffNotification()
{
IEventSubscription* pIEventSubscription = 0;
HRESULT hr = S_OK;
HRESULT comInit = E_FAIL;
HRESULT res = S_OK;
WCHAR buffer[64] = {0};
int i = 0;


comInit = CoInitialize(0);
if (comInit != RPC_E_CHANGED_MODE)
{
hr = comInit;
if (FAILED(hr))
{
goto error;
}
}

res=CoCreateInstance(__uuidof(CEventSystem), 0,CLSCTX_SERVER,__uuidof(IEventSystem),(void**)&pIEventSystem);

if((FAILED(res))|| (NULL == pIEventSystem))
{
WriteLog("SubscribeLogoffNotification : Error create com instance for CEventSystem");
goto error;
}

pISensLogon= new MyISensLogon();

char temp[220];
for(i=0; i<7; i++)
{

sprintf(temp,"\nSubscribeLogoffNotification for i=%d started",i);
WriteLog(temp);

res=CoCreateInstance(__uuidof(CEventSubscription),0, CLSCTX_SERVER,__uuidof(IEventSubscription),(LPVOID*)&pIEventSubscription);
if((FAILED(res))
|| (NULL == pIEventSubscription))
{
goto error;
WriteLog("\nSubscribeLogoffNotification : Error create com instance for CEventSubscription");
}

res=pIEventSubscription->put_EventClassID(OLESTR("{d5978630-5b9f-11d1-8dd2-00aa004abd5e}"));
if(FAILED(res))
goto error;


res=pIEventSubscription->put_SubscriberInterface((IUnknown*)pISensLogon);
if(FAILED(res))
goto error;

MultiByteToWideChar(0,0,methods[i],-1,buffer,64);

res=pIEventSubscription->put_MethodName(buffer);
if(FAILED(res))
goto error;

MultiByteToWideChar(0,0,names[i],-1,buffer,64);

res=pIEventSubscription->put_SubscriptionName(buffer);;
if(FAILED(res))
goto error;

MultiByteToWideChar(0,0,subids[i],-1,buffer,64);

res=pIEventSubscription->put_SubscriptionID(buffer);
if(FAILED(res))
goto error;

res=pIEventSystem->Store(PROGID_EventSubscription,(IUnknown*)pIEventSubscription);
if(FAILED(res))
goto error;

pIEventSubscription->Release();

pIEventSubscription=0;

sprintf(temp,"\nSubscribeLogoffNotification for i=%d Completed",i);
WriteLog(temp);
}
res = S_OK;
return res;
error:
CoUninitialize();
return res;

}

with loads of thanks
QuestionVisual Studio 2005 like interface Pin
Gagnon Claude26-May-09 17:04
Gagnon Claude26-May-09 17:04 
QuestionBitmaps for Tool Bar Pin
BobInNJ26-May-09 15:18
BobInNJ26-May-09 15:18 
AnswerRe: Bitmaps for Tool Bar Pin
«_Superman_»26-May-09 19:41
professional«_Superman_»26-May-09 19:41 
AnswerRe: Bitmaps for Tool Bar Pin
molesworth26-May-09 22:02
molesworth26-May-09 22:02 
AnswerRe: Bitmaps for Tool Bar Pin
BobInNJ27-May-09 8:13
BobInNJ27-May-09 8:13 
QuestionUse the windows 7 sdk with qt Pin
toprogramminguy26-May-09 13:34
toprogramminguy26-May-09 13:34 
AnswerRe: Use the windows 7 sdk with qt Pin
Stuart Dootson26-May-09 14:21
professionalStuart Dootson26-May-09 14:21 
GeneralRe: Use the windows 7 sdk with qt Pin
fanronghua26-May-09 22:50
fanronghua26-May-09 22:50 
GeneralRe: Use the windows 7 sdk with qt Pin
Stuart Dootson26-May-09 23:00
professionalStuart Dootson26-May-09 23:00 
QuestionAdding ActiveX Control Container to Win32 Window Pin
snacker226-May-09 12:50
snacker226-May-09 12:50 
AnswerRe: Adding ActiveX Control Container to Win32 Window Pin
Stuart Dootson26-May-09 13:00
professionalStuart Dootson26-May-09 13:00 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
snacker226-May-09 13:24
snacker226-May-09 13:24 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
snacker226-May-09 14:00
snacker226-May-09 14:00 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
snacker226-May-09 14:12
snacker226-May-09 14:12 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
snacker226-May-09 14:18
snacker226-May-09 14:18 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
snacker226-May-09 14:21
snacker226-May-09 14:21 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
Stuart Dootson26-May-09 14:32
professionalStuart Dootson26-May-09 14:32 

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.