|
There are lots of differences, and CView makes many assumptions about it's environment.
(see Inserting a Doc/Frame/View in a dialog using a custom control[^])
If all you're interested in is OnDraw instead of OnPaint, why don't you look at the CView::OnPaint in the MFC code, and imitate that in your CMyWnd?
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
im a semi newbie to MFC. Im developing an application where in i have to copy the text whereever my mouse navigates and selects some texts. It can be like i select some texts by the mouse cursor and then hit a hot key(ctr+T etc..)so that my Application reads the texts and dumpsand then further process the received texts. Can any one please suggest me that idea that what functions or classes i can use.
|
|
|
|
|
you need Mouse and Keyboard Hooks[^]
See SetWindowsHook etc.
Correction!
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
modified on Thursday, April 16, 2009 7:43 AM
|
|
|
|
|
Mouse and keyboard hooks will be of absolutely no use in retrieving text. (A keyboard hook might be of benefit, to trap the hotkeys however.)
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
umm! thanks for correcting. I will go through the link you provided.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
|
This is not an easy challenge.
1/ Detect the key being pressed! Keyboard hook, or a global hot key (see RegisterHotKey) which I'd recommend more.
2/ Then you have to get the window user the mouse. (RealChildWindowFromPoint)
3/ Then you have to extract the actual text. The way of doing this will vary from application to application. Firefox will be different from iexplore. FoxitReader will be different from Acrobat.
4/ You could get the pixel in the window, maybe using WM_PRINT, but then you'd have to OCR them to get the text...
5/ pdf and html viewers already have clipboard filling functions... It's a lot less work to use them!
Good luck though, as this would be a major challenge to a pro. Maybe a semi-newbie who isn't afraid is the best person!
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
I am not 100% sure, but you can go in below way.
1) Register your hotkey (RegisterHotKey).
2) When hotkey pressed.
a. get focused or current window handle using "WindowFromPoint" API
b. send below message to window using handle to get text.
WM_GETTEXT or EM_GETSELTEXT or EM_GETSEL
Parag Patel
Sr. Software Eng, Varaha Systems
|
|
|
|
|
In pure win32 code. I need to set VScrool Position at the Bottom of the EditBox.
SendMessage( hWnd ,WM_VSCROLL, SB_BOTTOM, 0 ); is not working for me.
|
|
|
|
|
MFC, STUDIO 2008, MDI-project
if J know the name of class then
how can to define the identifier
of dialog wndow on base that
was created this class?
|
|
|
|
|
CHIVOTIOV wrote: MFC, STUDIO 2008, MDI-project
if I know the name of class then how can to define the identifier of dialog window on base that was created this class?
If I get you correctly you are on the lookout for GetParent()
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hello,
I am doing an application with an "exe" file and some "dll" that are called from the exe.
When I run the exe in Debug (or Debug64) mode and the dll are compiled in Debug (or Debug64) mode the application runs without any problem. But if I mix Debug with Release (or Debug64 with Release 64) the application does not run, and I get this error:
"Unhandled exception at 0x77d4dd50 in PruebaLinkado.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0012c160.."
The dll has "Multi-threaded DLL (/MD)" option
And the exe file has "Multi-threaded (/MT)" option.
Can anybody help me with this problem?
Thanks in advance
|
|
|
|
|
Why would you mix debug and release mode binaries?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Just during debugging phase.
If I want to debug in the dll and the exe file is working I don't want to change the exe file each time.
|
|
|
|
|
I don't understand. My question was - why would you have the executable in release mode and the dll in debug mode?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
For example,
I have a develope Team with 5 developers.
One exe that runs the dlls that each developer builds.
If a developer wants to check his work it is not necesary to complie the exe file in debug, he has just to compile his dll in debug mode and check it.
Regards
|
|
|
|
|
And how will you know what is happening in the executable if it is built with no debug information? For instance, if an assertion occurs in the executable (even while loading the DLL), you won't know it. You don't have to compile the executable every time. You say the executable remains the same, so, you can have it built with debug symbols in it. After your bugs are fixed, you can build binaries without debug information in it.
Somehow, the idea of mixing separate binaries, some with and some without debug information doesn't look strikingly impressive.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
A warm welcome to 'The Legend' [^].
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
[My articles]
|
|
|
|
|
Ah, thanks.
The link you provided doesn't work, BTW. I went to your profile to view the updated post.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: The link you provided doesn't work, BTW. I went to your profile to view the updated post.
Yeah, it looks like the 'Permalink' mechanism is broken.
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
[My articles]
|
|
|
|
|
So if you you make a macro in Excel, and in this macro you call to a function located in your dll, you are able to put Excel.exe in debug?
|
|
|
|
|
It would be of help to know the difference between Excel and your program: Excel doesn't throw a bad_alloc exception and crash to death. Your application does.
Which means that there's something wrong (you don't know if it's at the library side or at the consumer side), so I asked you to debug them together. You may drop my idea of using debugging symbols if you didn't like it.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Yes, acctually that's my problem.
I have done a simple test:
Create a dll with a function. (for example:
__declspec(dllexport) int test1(const std::string& chain)<br />
{<br />
std::string test;<br />
<br />
test = "testing: ";<br />
test += chain;<br />
return 13;<br />
} )
Create a exe that import the funtion. (for example:
#pragma comment(lib, "DllTest.lib")<br />
__declspec(dllimport) int test1(const std::string& cadena); )
Call to the function of the dll form the exe. (for example:
int io;<br />
std::string stTest;<br />
<br />
io = test1("testing testing"); )
And the results are:
Both in debug -> works (so I cannot find information about the crash)
Both in release -> works
One in debug and one in release -> Crash to death
I think that the problem is in the project options, because there is nothing strange in the code.
|
|
|
|
|
Yes he can.
Be careful: don't challenge Rajesh...
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
[My articles]
|
|
|
|
|
Ok Ok.....
|
|
|
|