|
To Sohail Kadiwala:
Thanks! Of couse I will.
|
|
|
|
|
Hi All,
I have created one system wide hook in one of my dll file say myHook.dll like this:
hGetMsgHook = SetWindowsHookEx( WH_GETMESSAGE, GetMsgProc,
(HINSTANCE)hmodHook, 0 );
Now the confusion is that, while anyprocess sends any message, This function will be called from within the address space of that process itself or outside that proecess. Which process address space this function will map to?
Just like in setWinEventHook API we have one flag for setting this WINEVENT_INCONTEXT or WINEVENT_OUTOFCONTEXT, dont we have anything to control the same for SetEindowsHookEx API?
Thanks in advance for all your suggestions...
Regards
Abhinav
HCL Technologies, Noida(India)
|
|
|
|
|
Abhinav agrawal India wrote: while anyprocess sends any message, This function will be called from within the address space of that process itself or outside that proecess. Which process address space this function will map to?
WH_GETMESSAGE can be created as a global or a thread specific hook.
If you created it as a global hook it is mapped (AFAIK) to all of the processes in the system (well, the current desktop). Specific calls to your hook come from the address space of the process that called GetMessage or PeekMessage.
RemoteLib uses global hook to inject any dll to the target process:
-it installs a global hook
-it then forces the hook to be balled by sending a message to the target window
-when the hook is called, the hook procedure calls LoadLibrary from the target process space and thus loads the dll too the target process space.
Also see http://codeproject.com/dll/#Hooks
H.
|
|
|
|
|
in my dll i have couple of interfaces
from that i want to hide 2 from User
how this is done
plz help
Sagar
Love Is photogenic,It require a dark to develope
|
|
|
|
|
[hidden] attribute should help.
|
|
|
|
|
can U plz explaing bit more
Sagar
Love Is photogenic,It require a dark to develope
|
|
|
|
|
From MSDN:
hidden
Description
Indicates that the item exists, but should not be displayed in a user-oriented browser.
Allowed on
Property, method, coclass, dispinterface, interface, library.
Comments
This attribute allows members to be removed from an interface by shielding them from further use, while maintaining compatibility with existing code.
When specified for a library, the attribute prevents the entire library from being displayed. It is intended for use by controls. Hosts need to create a new type library that wraps the control with extended properties.
Flags
VARFLAG_FHIDDEN
FUNCFLAG_FHIDDEN
TYPEFLAG_FHIDDEN
|
|
|
|
|
yep ! I got that from MSDN
Thanks for the help !
solved my problem
cheers
Sagar
Love Is photogenic,It require a dark to develope
|
|
|
|
|
Hi there!
I have a dll that has only one ATL object.
Now, I need to add a second one, and I would like to add to the same dll (this way I don't need to register a new dll, just the old one with the new object!).
I add it using the VC6 wizard, it compiles ok, but when I try to use it via VB, it gives the error "Can't create activex object!".
It's not a problem in the code, since if I put it in a stand alone dll it runs ok.
Does any one knows what kind of magic I need to do to make it run?
ALMC
|
|
|
|
|
almc wrote: I have a dll that has only one ATL object.
Now, I need to add a second one, and I would like to add to the same dll (this way I don't need to register a new dll, just the old one with the new object!).
are you adding the ATL Object or Method/property... If you are adding ATL object you have to register the dll again ....
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hi all,
iam creating dialogbar activex control ..thru ATL..
i created one dialogbar resource...
when i insert that control in test container..its not visible.
if i want to see in test container,whats the procedure...can u please guid me through small code snippet?
best regards,
tirucapricorn
|
|
|
|
|
I'll show some code about card,write by myself,i'm chinese:
void CCardsCtrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
// TODO: Replace the following code with your own drawing code.
CBitmap* pOldBitmap = NULL;
CBitmap bitmap;
CDC bmpDC;
CRect rect;
CPoint ptLeftUp;
//ÔËÐÐģʽÏÂÒƶ¯´°¿Ú
if(AmbientUserMode())
{
GetRectInContainer(&rect);
rect.bottom -= m_sOffset;
rect.top -= m_sOffset;
MoveWindow(rect);
}
//»æÖÆÆË¿Ë
bmpDC.CreateCompatibleDC(pdc);
if(m_bBackground) //ÏÔʾ±³¾°
{
if(m_sBackBmp == 1)
{
bitmap.LoadBitmap(IDB_BITMAP_BACK1);
}
else
{
bitmap.LoadBitmap(IDB_BITMAP_BACK2);
}
}
else //ÏÔʾÅÆÃæ
{
bitmap.LoadBitmap(IDB_BITMAP_11+m_sValue-1);
}
pOldBitmap = bmpDC.SelectObject(&bitmap);
pdc->BitBlt(rcBounds.left, rcBounds.top, rcBounds.Width(), rcBounds.Height(), &bmpDC, rcBounds.left, rcBounds.top, SRCCOPY);
bmpDC.SelectObject(pOldBitmap);
bitmap.DeleteObject();
}
ddddddddddddddddddddd
|
|
|
|
|
Hi,
I have a registred ocx that implements the fallow method
CString COPOSCashDrawer::GetDeviceDescription()
{
CString result;
InvokeHelper(0x1d, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
return result;
}
I created a dll that implements the fallow method:
STDMETHODIMP CCashDrawer::get_DeviceDescription(BSTR *pVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
CComBSTR bstStr( this->DeviceDescription );
*pVal=bstStr.Detach();
// TODO: Add your implementation code here
return S_OK;
}
This method belongs interface ICashDrawer : IDispatch
I want to do a application that make the ocx's method
CString COPOSCashDrawer::GetDeviceDescription() make call to the dll's method
STDMETHODIMP CCashDrawer::get_DeviceDescription(BSTR *pVal)
I tryed to import the Controll into a project(Project->Add to
Project->Componentes and Controls->Registred ActiveX Controls), then I tryed
to create a instance of a ocx's class and make call to the method
GetDeviceDescription(). The fallow error menssage was draw me:
DEBUG ASSERTION ERROR!
File: Winocc.cpp
Line: 345
Please, can you help me?
the fallow code is the application...(example)
// teste.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "teste.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// The one and only application object
#include"oposcashdrawer.h"//CLASS OF CONTROL
CWinApp theApp;
using namespace std;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
COPOSCashDrawer um;//INSTANCE OF CONTROL
// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
cerr << _T("Fatal Error: MFC initialization failed") << endl;
nRetCode = 1;
}
else
{
// TODO: code your application's behavior here.
/*CString strHello;
strHello.LoadString(IDS_HELLO);
cout << (LPCTSTR)strHello << endl;*/
um.GetDeviceDescription();//CALLING THE METHOD( THIS CAUSES THE ERROR...DEBUG ASSERTION ERROR! FILE: WINOCC.CPP LINE: 345;
}
return nRetCode;
}
Grateful!
--
Honae
|
|
|
|
|
You need to actually create the control. You created an instance of COPOSCashDrawer, but you never actually created the component. Call um.CreateControl();
|
|
|
|
|
WindowA->DoModal(popup DialogB)
<br />
DialogB<br />
|<br />
|----------ControlA<br />
............|<br />
............-------------ControlAA<br />
i wanna handle ControlAA's message in DialogB and don't wanna write a custom class for ControlA, is it possible? i think i could achieve this by changing the default dialog procudure? how to change the dialog procedure?
-- modified at 0:23 Friday 14th October, 2005
|
|
|
|
|
does the message first reach the DialogB then the ControlA last arrive ControlAA?if it's true ,could i handle it in DialogB? how?
|
|
|
|
|
hi all,
i just wrote a com, but now have a problem that is my com can not share the data between applications.
Any help would be greately appreciated
|
|
|
|
|
kiluar wrote:
i just wrote a com, but now have a problem that is my com can not share the data between applications.
this link will help :-
http://www.codeproject.com/dll/data_seg_share.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
can you write a function
putdata() and getdata()
to share data between applications
ddddddddddddddddddddd
|
|
|
|
|
wlwlxj wrote: can you write a function
putdata() and getdata()
I can't understand ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
There is this article on CP A Technique to Customize the Title Bar of Windows
[^] which lets you draw the title bar of an application. I have to do the same thing but all my applications are written in MFC. So my question how could I use the above mentioned code in MFC? Or is it possible? If not how could I custom draw the title bar in MFC. Or how could I combine the two?
Any sugestions would be greatly apreciated. This is a time sensitive matter.
regards,
Mircea Grelus
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
I forgot to mention. I'm refering to VC6.
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
Is there some one who can help me to design a COM component ?
thx
----------------------------
Jerry yu
Chinese
programming fans
|
|
|
|
|
Let me know the details. I'll try help you.
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I can ,but how i help you.
I'm chinese, email me(wlwlxj@163.com) when you have troubles.
ddddddddddddddddddddd
|
|
|
|