|
|
I did like this
<br />
if (SUCCEEDED(AccessibleObjectFromPoint(pt, &pacc, &vtChild)))<br />
{<br />
BSTR bsName = NULL;<br />
BSTR bsValue = NULL;<br />
pacc->get_accName(vtChild, &bsName);<br />
pacc->get_accValue(vtChild, &bsValue);<br />
}<br />
The question is - How do I get the place of the marker in a text box
Thanks a lot
|
|
|
|
|
Hi,
I think u need to use Text Capture GDI hook to get selected text from any application. The Word Web dictionary is using technique.
thanks
Nitheesh
|
|
|
|
|
I've solved this problem months ago and I build an application doing exactly what you need!
Now for starters, how did I solved users choice for dialing the number from screen. I've notated that user must select something (he can select the whole screen for what I'm concern) then I send commands to simulate CTRL+C action, this forces to copy all selected to an a clipboard. It is easy to get selected data from clipboard, then parse for telephone numbers.
At the time I was furious and was google-ing all kind of forums for accessibility and other stuff. Getting sick only remembering!
Now I'm hoping this helps you a bit, feel free to replay me!
P.S.
For me the key thing was introducing the 'select what you want to dial', I could not seem to find another way for achieving my gold at the time!
|
|
|
|
|
It's a good idea...
I want a perfect way... not a easy
|
|
|
|
|
Anyway glad if I could help. It would be great to see final result when you do it. If you have time please send me an e-mail with brief description of yours solution!
Hope to hear from you.
Bye
|
|
|
|
|
Hello everyone,
I searched all of my VC folder files, but can not find where and how _ATL_SIMPLEMAPENTRY is defined. Any ideas?
thanks in advance,
George
|
|
|
|
|
atlbase.h
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks CPallini,
Windows native search tool does not work this time.
For this statement,
#define _ATL_SIMPLEMAPENTRY ((ATL::_ATL_CREATORARGFUNC*)1)
I think it means a function pointer of type CREATORARGFUNC is located address 0x00000001?
I think ((ATL::_ATL_CREATORARGFUNC)1) should be enough, since _ATL_CREATORARGFUNC itself is defined to function pointer type. Why add an additional * here?
regards,
George
|
|
|
|
|
George_George wrote: I think ((ATL::_ATL_CREATORARGFUNC)1) should be enough, since _ATL_CREATORARGFUNC itself is defined to function pointer type. Why add an additional * here
pointer to pointer
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Thanks ThatsAlok,
From the ATL definition, _ATL_CREATORARGFUNC is a function type, other than function poniter type, right?
typedef HRESULT (WINAPI _ATL_CREATORARGFUNC)(void* pv, REFIID riid,
LPVOID* ppv, DWORD_PTR dw);
I can not think why it defines a function type, other than function pointer type. To use the function type variable, we always need to use the function pointer form of it, right? So, why not just define a function pointer type? Could we use function type directly?
regards,
George
|
|
|
|
|
The above is typedef , i.e. an alias for a type representing a function having the given prototype. Nothing to do with pointers.
To make things a bit clearer:
typedef int (MYFUN) (int x);
int square(int x) {return x*x;}
void main()
{
MYFUN p = square;
MYFUN *p = square;
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks CPallini,
I have tried your sample, and it is correct. I found when we define a function type, we always use its pointer form/type (e.g. in your sample, using type MYFUNC*, other than type MYFUNC*).
So, why not use function pointer type other than function type directly?
regards,
George
|
|
|
|
|
George_George wrote: I have tried your sample, and it is correct. I found when we define a function type, we always use its pointer form/type (e.g. in your sample, using type MYFUNC*, other than type MYFUNC*).
This is up to you (i.e. the designer).
Usually Ms code specifies when a the typedef relates to a pointer (e.g. PTHREAD_START_ROUTINE).
George_George wrote: So, why not use function pointer type other than function type directly?
Ask ATL development team. Ms has a lot of different teams, each one with his 'little standard' inside company general guidelines, I suppose.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks CPallini,
Can you show me a sample of how to use function type directly, other than define a function type, but using pointer to function type please?
I can not imagine a case.
regards,
George
|
|
|
|
|
George_George wrote: how to use function type directly, other than define a function type, but using pointer to function type
How to unroll you sentence?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks CPallini,
What I mean is, suppose you define a function type tfunc, you always use type tfunc*, right? For example, in your sample code.
Could you show me how to use tfunc directly, other than using tfunc* type? Please.
regards,
George
|
|
|
|
|
class MyFunObject
{
MYFUN * fun;
public:
MyFunObject(MYFUN f){fun = &f;}
int Invoke( int i ){ return (*fun)(i);}
};
int main()
{
MyFunObject mfo(square);
printf("%d\n",mfo.Invoke(4));
getchar();
return 0;
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks
You still use the pointer type when making the final call.
return (*fun)(i);}
where fun is a type of pointer,
MYFUN * fun;
So, I think there is no case to use function type directly, without using its pointer type form.
regards,
George
|
|
|
|
|
Sometimes code don't need to directly execute functions to be useful, IMyFunContainer , for instance, specializes the IMyContainer interface to MYFUN type.
typedef int (MYFUN) (int x);
template <class T>
class IMyContainer
{
public:
virtual int add(T t)=0;
virtual void remove(T t)=0;
};
class IMyFunContainer : public IMyContainer <MYFUN>
{
virtual int Invoke(int iIndex, int arg)=0;
};
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks CPallini,
But to use the function in the container, we have to use T* or MYFUN* type, other than T or MYFUNC, right?
regards,
George
|
|
|
|
|
Yes.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks CPallini,
Question answered.
regards,
George
|
|
|
|
|
Nope. simply pointer to function, since George hypothesys about _ATL_CREATORARGFUNC nature was wrong.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I have a CString object and I want to know if it ends with a \ (backslash)
But I can't write if (csText == "\") because the "\" gives an error...
|
|
|
|