Click here to Skip to main content
15,892,059 members
Home / Discussions / COM
   

COM

 
GeneralRe: Is it possible to catch a com event in vb or javascript Pin
grinder13-Mar-05 19:33
grinder13-Mar-05 19:33 
GeneralDCOM event sink on Terminal Services Pin
FearlessBurner7-Mar-05 2:06
FearlessBurner7-Mar-05 2:06 
GeneralWMI -> Win32_OperatingSystem Pin
Stefak6-Mar-05 13:21
Stefak6-Mar-05 13:21 
GeneralTransparent ActiveX Control Pin
gameengineer5-Mar-05 4:22
gameengineer5-Mar-05 4:22 
GeneralRe: Transparent ActiveX Control Pin
Pinhead_Me10-Mar-05 7:58
Pinhead_Me10-Mar-05 7:58 
GeneralRe: Transparent ActiveX Control Pin
smjones10-Mar-05 13:49
smjones10-Mar-05 13:49 
GeneralRe: Transparent ActiveX Control Pin
smjones14-Apr-05 11:57
smjones14-Apr-05 11:57 
GeneralRe: Transparent ActiveX Control Pin
Pinhead_Me18-Apr-05 5:44
Pinhead_Me18-Apr-05 5:44 
Two Items:

1) Yes, the windowless control's 'window' is the parents window. GetClientRect should return the contorls size, not its location. When drawing the control, you could get the position/location of your control by using the passed in paramater "rcBounds".

[OnDraw(CDC* pDC, const CRect& rcBounds, const CRect& rcInvalid)]

It may not be necessary, for your control to be windowless. Depending on your needs, you may want to process OnEraseBkgnd function and return 1. This will tell the framework that you have taken care of the drawing/erasing of the background.

2) Second idea, again depending on your needs this may or may not work. Its an ALT 3.0 component and will demonstrate a transparency effect.

Do the following:

a) create an ALT COM component via "Alt COM Wizard" in Visual Studio MFC (I used VC++ 6.0 with MFC)

b) when specifying the control atrributes, unselect the 'Opaque' option (see figure: http://www.microsoft.com/msj/0299/atl3Activex/atlfig12.gif[^])

c) Add a ALT control to your project "Full Control"

d) Process the following messages WM_ERASEBKGND and WM_MOUSEMOVE (OnEraseBkgnd & OnMouseMove)

e) Declare a CPoint member variable name it "m_Point"

f) Drop in the following code for the OnDraw, OnEraseBkgnd and OnMouseMove funstions:

HRESULT OnDraw(ATL_DRAWINFO& di)
{
CString strTemp;
RECT& rc = *(RECT*)di.prcBounds;

//Set Background for text the be transparent
SetBkMode(di.hdcDraw, TRANSPARENT);

//Format Mouse Position Text
strTemp.Format("X: %d Y: %d ",m_Point.x,m_Point.y);

SetTextAlign(di.hdcDraw, TA_CENTER|TA_BASELINE);
LPCTSTR pszText = strTemp;
TextOut(di.hdcDraw, (rc.left + rc.right) / 2, (rc.top + rc.bottom) / 2, pszText, lstrlen(pszText));

return S_OK;
}
LRESULT OnEraseBkgnd(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
return 1;
}

LRESULT OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
m_Point.x = (short)LOWORD(lParam);
m_Point.y = (short)HIWORD(lParam);

HWND hParent = GetParent();
/*For better results, Determine the controls RECT and pass it in the InvalidateRect() fucntion below,
doing this this will result in only your control being redrawn, rather than having your parents entire rect be redrawn and result in flashing/blinking */

::InvalidateRect(hParent, NULL, true);
return 0;
}


Hope that helps you out a bit.
GeneralCom-Addin Query Pin
Anonymous5-Mar-05 2:14
Anonymous5-Mar-05 2:14 
GeneralWindows Hooking. Pin
technojewel3-Mar-05 20:18
technojewel3-Mar-05 20:18 
GeneralRe: Windows Hooking. Pin
Tarundeep Singh Kalra4-Mar-05 8:15
Tarundeep Singh Kalra4-Mar-05 8:15 
GeneralRe: Windows Hooking. Pin
vishalmore15-Mar-05 19:08
vishalmore15-Mar-05 19:08 
GeneralClient/Server COM+ Application Pin
Wender Oliveira3-Mar-05 14:58
Wender Oliveira3-Mar-05 14:58 
GeneralProblem While Instantiating and calling API through COM Component Pin
Anuj Mishra2-Mar-05 18:04
Anuj Mishra2-Mar-05 18:04 
GeneralIE code download failure for dll and ActiveX control using INF and CAB file Pin
prog012-Mar-05 11:40
prog012-Mar-05 11:40 
GeneralBindIFilterFromStream Pin
cheesepirate2-Mar-05 7:02
cheesepirate2-Mar-05 7:02 
Generaldyanamically create listboxes in ATL Pin
gauravjain1-Mar-05 4:28
gauravjain1-Mar-05 4:28 
GeneralCommunication with one particular instance of an activex/com object Pin
awhit1-Mar-05 0:54
awhit1-Mar-05 0:54 
GeneralCOM and MSFlexGrid Pin
A. Karthick Arun28-Feb-05 20:34
A. Karthick Arun28-Feb-05 20:34 
GeneralCOM,OLE,AUTOMATION,ActiveX Pin
hjkjk28-Feb-05 20:16
hjkjk28-Feb-05 20:16 
GeneralCreating Schema Rowset ( OLE DB) in COM Pin
gauravjain28-Feb-05 5:47
gauravjain28-Feb-05 5:47 
Generalfft scale factor in MRI Dicom images Pin
ramtilak gattu28-Feb-05 5:34
ramtilak gattu28-Feb-05 5:34 
GeneralRe: fft scale factor in MRI Dicom images Pin
dicomapi27-Apr-05 2:20
dicomapi27-Apr-05 2:20 
Generalimplementing COM in c++ Pin
csharp627-Feb-05 18:19
csharp627-Feb-05 18:19 
GeneralRe: implementing COM in c++ Pin
Anuj Mishra2-Mar-05 18:10
Anuj Mishra2-Mar-05 18:10 

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.