|
Hi,
Is there any way to detect if another program is reading stuff from a control in my software?
Let's say I have a program with a SysListView32 control. If there is another program in my system that reads the entries in that control using windows API calls or AutoIt, is there any way for me to detect it?
thanks
|
|
|
|
|
SHORT ANSWER: NO! (Well none I know of).
LONG ANSWER: YES! I have never done it, but you would have to write your entire program so that each command message would require that it set some internal flag before sending or make the flag (some how) part of the message. This, of course, would mean you could not use MFC or any other frame-work, to design you program.
It gets a lot more complicated from there on.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hi All,
I'm having a problem with the HeapAlloc and HeapFree functions. I'm using those functions on the default process heap and they seem to work okay upto a particular point. At one point, when a request for a big chunk of memory (~118 MB) was made, the call failed.
A snapshot of the virtual address space showed that the HeapManager never released the memory to the OS, instead, it kept it reserved, committing and decomitting it as necessary. I'm wondering if that was what actually caused the request to fail, maybe the HeapManager wasn't able to find a contiguous region of the requested size?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Although not technically correct, you process only has 2GB of virtual address space available to it. If you request 118MB, you have requested 5% of your virtual address space. That is a huge chunk.
Can the problem be that you don't have the contiguous space available? Yes, that can happen. On other VM systems, I have had to change allocation strategies to avoid this problem.
Not knowing if your program is multithreaded or what you allocation requirements are, I can't tell you what you can do. However, using such systems as VirtualAlloc to set aside a permanent block of memory can work. That is how we solved our issues.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
There are many object in the same windows,How to let the CListCtrl selected by program othe than by tne mouse?
|
|
|
|
|
i is the item number in the list you want to select
SetItemState(i, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED);
|
|
|
|
|
|
If you have a pointer to the CListCtrl object, you can simply use CWnd::SetFocus[^] this way:
m_pListCtrl.SetFocus();
If you don't have a pointer to the CListCtrl, you can use CWnd::GetDlgItem [^] on the parent window to obtain one.
CTheControlParent::SetFocusOnListCtrl()
{
CWnd* pWnd = GetDlgItem(THE_ID_OF_THE_LIST_CTRL);
if (pWnd != NULL)
pWnd->SetFocus()
}
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hello
I need to make a COM-DLL for use in VB and C# projects in vc6. I don't know how to start the vc project (what kind of new project), how i can see this dll from vb or c#. I need some documentation/sample.
Thanks,
Mihai
|
|
|
|
|
VC++ 6.0
NEW PROJECT: ATL COM AppWizard. (And a good book on the subject.)
Once you create/build it, it should be available to select in the commponts dialog in VB (as it is automaticaly register when you build it).
If you want the extension to be ocx instead of dll, then you need to change the output file extension (in the Project->Setting->Link[tab]) to ocx before building it.
For testing puposes, there is Tools->ActiveX Control Test Container.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
I tried using
SetupDiGetDeviceRegistryProperty(dev_info,&DeviceInfoData,SPDRP_DEVTYPE,
&prop_datatype,prop_buffer,100,&req_bufsize);
Its gives an error SPDRP_DEVTYPE undeclared identifier. I checked the included "setupapi.h" and could not find SPDRP_DEVTYPE defined. But this is a property given in the msdn.
Is there any other function to access the DeviceType from the regisrty.
Regards,
Nripun
|
|
|
|
|
Maybe you need a more recent Platform SDK? I have that define in my setupapi.h file. Here's an extract:
#define SPDRP_ENUMERATOR_NAME (0x00000016) // Enumerator Name (R)
#define SPDRP_SECURITY (0x00000017) // Security (R/W, binary form)
#define SPDRP_SECURITY_SDS (0x00000018) // Security (W, SDS form)
#define SPDRP_DEVTYPE (0x00000019) // Device Type (R/W)
#define SPDRP_EXCLUSIVE (0x0000001A) // Device is exclusive-access (R/W)
#define SPDRP_CHARACTERISTICS (0x0000001B) // Device Characteristics (R/W)
#define SPDRP_ADDRESS (0x0000001C) // Device Address (R)
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hello.
I need to create ActiveX for IE. When user click on some document in IE this ActiveX mast do somthing with this document. I do not know how can I get user click message. Please help me.
|
|
|
|
|
Shapovalov Alexandr wrote:
When user click on some document in IE this ActiveX mast do somthing with this document. I do not know how can I get user click message. Please help me.
I Believe you are looking for BHO (Browser Helper Object).
This link certainly going to help you
http://msdn.microsoft.com/library/en-us/dnwebgen/html/bho.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
|
|
|
|
|
Thank you, I read this arcticle, and I trying to do it. I create Class
class IMyIEExtention :<br />
public IOleCommandTarget,<br />
public IObjectWithSite,<br />
public IDispatch<br />
and in function STDMETHODIMP IMyIEExtention::SetSite(IUnknown *pUnkSite);
i write
<br />
m_pMyWB = (IWebBrowser2*)pUnkSite;<br />
IServiceProviderPtr pServProv(pUnkSite);<br />
pServProv->QueryService(SID_SWebBrowserApp, IID_IWebBrowser2, (void**)&m_pMyWB);<br />
m_pMyWB->QueryInterface(IID_IConnectionPointContainer, (void**)&m_pCPC);<br />
if (m_pCPC)<br />
{<br />
IConnectionPoint *spCP = NULL;<br />
hr = m_pCPC->FindConnectionPoint(DIID_DWebBrowserEvents2, &spCP);<br />
if (spCP)<br />
{<br />
spCP->Advise(reinterpret_cast<IDispatch*>(this), &m_dwCookie);<br />
}<br />
}<br />
{
then i create function Invoce
<br />
HRESULT IMyIEExtention::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS __RPC_FAR *pDispParams, VARIANT __RPC_FAR *pVarResult, EXCEPINFO __RPC_FAR *pExcepInfo, UINT __RPC_FAR *puArgErr)<br />
{<br />
return S_OK;<br />
}<br />
and I never been in function Invoke.
|
|
|
|
|
Send me a mail at thatsalok#gmail.com , i will send you summy source code!
"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
|
|
|
|
|
i had created a ATL DLL now i wants to call the dll in mfc project
i know 1 way-->
include .H file and >C which contain the IID and CLSID defination
is there any other better way to call the dll
virender
|
|
|
|
|
virender chauhan wrote:
include .H file and >C which contain the IID and CLSID defination
is there any other better way to call the dll
Other ways.... Hmm.. Import the Dll in your Mfc code using the #import directive, this will provide a COM Runtime wrapper just like VB provides like.
Have a look at this discussion:-
http://www.codeproject.com/atl/SimpleATLCom.asp?msg=978969#xx978969xx[^]
"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
|
|
|
|
|
how can i detect a file's name(in a specified directory) has changed by other user in my program written with visual c++ 6.0? i want to do something when the filename has changed.
any help is appriciated.
|
|
|
|
|
|
the code smooths the problem,thanks a lot!
|
|
|
|
|
sophia2288 wrote:
thanks a lot!
My Pleasure!
"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
|
|
|
|
|
Hello All,
Recently our VC++ application is ported to .Net. I don't the why appliaction is started crashiing.Please could any one help me on this.
Error - Buffer over run at atlsimpstr.h - IAtlStringMgr* pNewStringMgr = pData->pStringMgr->Clone();
see the Code below.
static CStringData* __cdecl CloneData( CStringData* pData )
{
CStringData* pNewData = NULL;
IAtlStringMgr* pNewStringMgr = pData->pStringMgr->Clone();
if( !pData->IsLocked() && (pNewStringMgr == pData->pStringMgr) )
{
pNewData = pData;
pNewData->AddRef();
}
}
Thanks in Advance,
Chandu
|
|
|
|
|
when using windows media player to play a ".mpg(mpeg4)"video ,i always want to capture it into a file directly from screen.but i tried lots of software such as "windows media encorder" "Snagit" ,finaly i haven't yet seen what i want.help me to solved this problem
|
|
|
|
|
atemperman wrote:
i tried lots of software such as "windows media encorder" "Snagit"
Are you looking for Software or Source code? , Please Clarify!
"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
|
|
|
|