|
Hi there. Is there a quick answer to this following question:
What's the difference between automation compliant COM and ActiveX component.
Thanks
norm
|
|
|
|
|
Nothing!
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
"Nothing" as in "No difference"?
I just want to reconfirm this. Thanks
|
|
|
|
|
ActiveX is just a fancy name for COM.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
This problem has been driving me nuts for several days and I'm hoping a fresh mind out there can shed some light on this problem for me.
I've written an MFC application that can be installed as an NT service. Naturally, an NT service isn't terminated when the user logs out, however I do want to do a few things within the app when the user logs out or shuts down the computer. I'm able to determine when the user is logging out and perform the appropriate functionality by acting on the WM_QUERYENDSESSION and WM_ENDSESSION Windows messages.
Here's the problem. When the user logs out, everything is fine. They log back in and my service is still running as it should be. When they log back out or attempt to shutdown, it would appear that my application aborts the log off / shutdown. However, I'm always returning true to the WM_QUERYENDSESSION message. If I remove my handling of the WM_QUERYENDSESSION message, the same still happens.
It gets even weirder when I discovered that my application doesn't even receive the WM_QUERYENDSESSION message the second time I try logging out, but it DOES receive the WM_ENDSESSION message (with wParam = 0).
If I close my application, Windows is fine shutting down. If I restart my application, it works fine once before repeating the above.
Can someone save the remainder of my hair before I finish pulling it out?!
|
|
|
|
|
Help with TransparentBlt()
I'm working from the CP example "Oscilliscope/StripChart Control" by Mark C. Malburg (http://www.codeproject.com/miscctrl/oscope.asp).
What I'm trying to adapt it to do is have several plots on the same chart PLUS the ability to turn off/on any one of the plots.
I am trying to use CDC::TransparentBlt(), but the compiler does not recognize this function. I looked at the AfxWin.h declaration for CDC and it is not there -- ...\microsoft visual studio\vc98\mfc\include\afxwin.h (VC++ 6.0)
I'm running VC++ 6.0, Win2000, Service pack ???
What do I have to do in order to get this to work?
Thanks (in advance for any help)
Johnny
|
|
|
|
|
May be this is just me, but I always thought that TransparentBlt is a member of ATL CDC ( atlgdi.h ?), but not MFC CDC (afxwin.h) at least at 6.0 level.
Either way whats wrong with using ::TransparentBlt(dc->GetSafeDC(),....);
|
|
|
|
|
Hiya I am writing a window sockets program. I can find loads of examples of setting the IP address and then displaying that, but I can not find out how to display the IP Address once I have got the computer name..I have this so far:
char szHostName[200];
struct hostent *host;
gethostname( szHostName,strlen( szHostName ));
host = gethostbyname( szHostName );
// now display the IP Address of the host??
I have seen the inet_addr function, but don't know how to use it..
|
|
|
|
|
Example:
in_addr *addr = (in_addr*)*host->h_addr_list;<br />
<br />
CString s;<br />
s.Format("%d.%d.%d.%d", addr->s_b1, addr->s_b2, addr->s_b3, addr->s_b4);
Regards,
BB
|
|
|
|
|
Hiya, thanks for that and tried it but it says that s_b1 is not a member of in_addr. Which it isn't.
I put it in exactly as suggusted. But S_un is the member of in_addr .i.e
addr->S_un
What can I do to fix this??
Thanks again,
grahamoj
|
|
|
|
|
OK, I mispelled this. I guess you may use:
s.Format("%d.%d.%d.%d", addr->S_un.S_un_b.s_b1, addr->S_un.S_un_b.s_b2, addr->S_un.S_un_b.s_b3, addr->S_un.S_un_b.s_b4);
Regards,
BB
|
|
|
|
|
Hi ... you may try this code snippet ....
the result should be something like 123.456.789.123 ...
hope it will help you
struct hostent * pHost = gethostbyname(szHostName);
if(pHost != NULL)
{
for(int i = 0; (pHost->h_addr_list[i]!= NULL); i++ )
{
CString csIP = "";
for(int j = 0; j < pHost->h_length; j++ )
{
if( j > 0 ) csIP += ".";
CString addr = "";
addr.Format("%u", (unsigned int)((unsigned char*)pHost->h_addr_list[i])[j]);
csIP += addr;
}
AfxMessageBox( csIP );
}
}
|
|
|
|
|
use inet_ntoa fucntion:
char szIP[16];
struct hostent *host = gethostbyname( szHostName );
struct in_addr *InAddr = (struct in_addr*)host->h_addr_list[0];
strcpy(szIP,inet_ntoa(*InAddr));
|
|
|
|
|
Anyone ever done this? Specifically, I have a crapload (well, five of the little beasties anyway) of 122x32 LCD panels that use the SED1520 controller, and I wanna play with them, maybe monitor case/cpu/gpu temperatures.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
When you use overloaded methods and generate a COM proxy, how do you access each overload of the method? Can you even do it? (I'm wanting to host script.)
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
I don't think you can overload methods in COM.
|
|
|
|
|
That's the point - what happens? But I suppose the answer is that only the default method def is used in the COM interface definition. (Sigh)
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
|
|
I'm trying to prevent the root node of my subclassed CTreeCtrl from being collapsed. The root node is guaranteed to have children. I've reflected TVN_ITEMEXPANDING to the control and am returning TRUE in its handler to prevent the root from being collapsed, but the user seems to be able to collapse it anyway.
BOOL CProjectTreeCtrl::OnItemExpanding
(NMHDR* pNMHDR, LRESULT* pResult)
{
NMTREEVIEW* pNMTreeView = (NMTREEVIEW *) pNMHDR;
HTREEITEM hItem = pNMTreeView->itemNew.hItem;
if (pNMTreeView->action == TVE_COLLAPSE)
if (hItem == m_hRoot)
return (TRUE);
return (FALSE);
}
I can get around the problem by handling TVN_ITEMEXPANDED , but that's ugly because the node collapses then expands.
Any clues as to what I'm doing wrong? Thanks,
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
Thanks, Nick but I'm already able to re-expand the collapsed node by calling Expand() . I was hoping to prevent the about-to-be-collapsed node from collapsing.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
You have to set *pResult = TRUE; and the notification handler has to be void!
void CProjectTreeCtrl::OnItemExpanding(NMHDR* pNMHDR, LRESULT* pResult)<br />
{<br />
NMTREEVIEW *pNMTV = (NMTREEVIEW*)pNMHDR;<br />
*pResult = pNMTV->action == TVE_COLLAPSE && pNMTV->itemNew.hItem = m_hRoot;<br />
}
Regards,
BB
|
|
|
|
|
Of course, of course, of course!!! Thank you, thank you, thank you! (Lesson learned: don't try to code when you're sick!)
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
You're welcome. I've just added a sample code, but I guess you've already fixed it. OK then - yet another reason to feel more healthy )
Regards,
BB
|
|
|
|