|
GauranG033 wrote: But I want Only the text selected By user. So I am using EM_GETSELTEXT, but as i told you its not working.
This is just a guess, but have you considered selecting some text in the edit control before calling SendMessage() ?
<notice>
Please fix your screen name. I'm really tired of having to modify my posts as a result of your broken tag.
</notice>
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes, I am selecting the text before making a call.
And By the way I check the sup tag in my name and it is closed properly.
|
|
|
|
|
GauranG033Yes, I am selecting the text before making a call.
Then something else is going on, like the value of the cb member.
<blockquote class="FQ"><div class="FQA">GauranG033</sup wrote:</div>And By the way I check the sup tag in my name and it is closed properly.</blockquote>
Notice that it is not (two examples above). I'm not sure what you are looking at, but a quick look at the HTML source will show you otherwise. You can also respond to your own message, select a few words and click the Quote Selected Text button.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Please fix your name. You have a </sup> tag that is not closed properly.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
sir,
In My sample project i used IActiveDesktop::SetWallpaper method,But it is giving an RunTime error like The Instruction at "0x0041432a" referenced memory at "0x00000000". The memory could not be "read"
here the code is...................
void CSlidercontrolDlg::OnButtonSetdesktop()
{
// TODO: Add your control notification handler code here
USES_CONVERSION;
lp=A2CW(stWallpaper);
pIActiveDesktop->SetWallpaper(lp,0);
}
In this regard please rectify the runtime error what i am getting or send me an complete example which is using IActiveDesktop::SetWallpaper() and some other methods in IActiveDesktop.
Please send a solution as soon as possible
|
|
|
|
|
|
Hi there,
I've got a weird problem with Subclassing in MFC:
What I want is the following:
I want to create a custom control (CRotarySlider) based on the CSliderCtrl-Class of MFC. I want to disable the Paint-Function of the CSliderCtrl and draw myself.
Now I did this by overriding the OnPaint() and NOT calling the CSliderCtrl::OnPaint().
Also I want to create a MemDC and draw to this DC and then simply BitBlt the MemDC to the DC of the OnPaint() Function.
In a Test-Application where I create one of my SliderCtrl it all works out fine.
I put a CSliderCtrl onto the Dialog, then add a Member-Variable to the Dialog.h:
CRotarySlider m_mySlider;
Also, I add the control to the DoDataExchange():
DDX_Control(pDX, IDC_SLIDER1, m_mySlider);
As I said, everything works fine.
BUT: In the real project I need 10 of these Sliders. So I define them as before, but now in an array of Controls:
CRotarySlider m_mySliders[10]
and:
<br />
DDX_Control(pDX, IDC_SLIDER1, m_mySliders[ 0]);<br />
DDX_Control(pDX, IDC_SLIDER2, m_mySliders[ 1]);<br /> and so on.
The Dialog is created when I start the application, and shown at a specific point. But then I can't see anything of my controls.
They're not drawn.
And it seems that the creation of the MemDC fails. But I get NO message like WM_CREATE, or WM_SHOW. Nothing.
The only thing I receive is WM_CHILDACTIVATE. But at that time my DC seems to be incorrect. So the compatible MemDC is also incorrect.
I hope anyone of you has an idea about that. Sorry if this post is too long, but I don't know where the error may hide so I thought I give you as much information as possible.
|
|
|
|
|
You won't get WM_CREATE, as the initial sliders were created before WM_INITDIALOG was called. Off the top of my head, you can override a virtual CWnd::PreSubClass , as this is called when you're subclassing, or when you're creating a control.
For your problem, I'd comment out the memory DC bits until you are happy that its working without that.
Then, create the memory DC in your OnPaint handler. Check the ClientRect against the size of the MemDC, and recreate it if you have to. Then you don't need to worry about creation messages.
(Don;t forget to tidy up after it though!)
Iain.
|
|
|
|
|
Hi Iain,
thanks for your reply. Got a new Question:
When I override the CWnd::PreSubClass for my sliders. Do I have a correct DC at that point? Or is ist created afterwards? Or did you mean I should override PreSubClass and ALSO create the memDC in the OnPaint Handler? What for do I need the PreSubClass-Method then?
Thanks
|
|
|
|
|
I would ignore the PreSubClass completely (for this reason at least - for all I know you have other work to do).
And in your OnPaint handler, I would use Keith Rule's CMemDC class - creating the bitmaps will be pretty speedy, and it keeps your code clean. It will even blt the image to the screen with it goes out of scope.
Flicker Free Drawing In MFC[^]
I cannot recommend this article highly enough.
I used to cache my own memory DCs, but it wasnt worth the hassle, and the speed hit of recreating them is essentially 0.
Iain.
|
|
|
|
|
hi i am having ascii file for a model. how to draw the model by reading the ascii file using opengl. i am new bie to opengl. pls guide me
|
|
|
|
|
Have you looked to the articles section here in CodeProject?
There are a lot of samples at every level (also for newbie)
saisp wrote: i am having ascii file for a model
If it is a known format you can probally hope to find some ready code to import it...elseway you will need to write your custom code.
Russell
|
|
|
|
|
Hi,
I want to develop a Multithread SDI application where a ball(drawing an ellipse) is created for every thread.
The user is given the option of selecting N no of balls ( say N < 5).
The trajectory/movement of the ball is random of each other. These bounce-off once they hit any one of the sides of the client rect.
Assume that I have the points through which each ball has to traverse (which is different for each ball), how do i start of with this application?
|
|
|
|
|
I never made an application like this, but do you think it's necessairy to create
for each ball a thread?
If i should make it, i create a class Ball and instanciate for each ball a new object.
Because the drawing is made (in every case) at the main thread (The GUI-Thread)
Normally the balls are flying with the same speed, so with a timer you redraw each time
the new position of the balls. The new position of the ball is calculated into the object.
I hope i don't say bullshit
|
|
|
|
|
baerten wrote: I never made an application like this, but do you think it's necessairy to create
for each ball a thread?
What I had in mind was for each thread, within that thread, I Create a ball object and in a while loop, get the necessary paramerers (trajectory) of the ball by making call functions. Periodically I keep updating the UI with the info.
|
|
|
|
|
You really don't need to be using a thread for each ball. As another poster said, create an instance of a class for each and update the class on each loop of your code.
You also might want to do some searching for an algorithm called "collision detection" which is almost exactly what you are trying to accomplish.
Waldermort
|
|
|
|
|
Marimuthu.pesit wrote: how do i start of with this application?
this[^] is a good article to start.
.
Russell
|
|
|
|
|
Your application sounds very similar to the sample program MTGDI in the MSDN Library. It might help you get started.
MTGDI[^]
Best Regards
Cliff
|
|
|
|
|
it seems that ON_COMMAND_EX just works in doc/view architecture. Can anyone give me some tips about it?
thank you.
|
|
|
|
|
have a look
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=514836&SiteID=1
http://www.codeguru.com/forum/showthread.php?t=61254
http://www.codeguru.com/forum/showthread.php?t=216400
|
|
|
|
|
Thank you for your reply.
I already google it and search it on codeproject and codeguru before posting this message.
Yes, it works well for Doc & View architecture.
my architecture is CMainFrame and CMyView (derived form CWnd, not CView) and without Doc.
And it has a custom tool bar and a custom status bar.
|
|
|
|
|
Do you need ON_COMMAND_EX() instead of ON_COMMAND() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I need process the message in the child window and parent window.
child window uses ON_COMMAND_EX and parent window uses ON_COMMAND.
|
|
|
|
|
Rockone wrote: I need process the message in the child window and parent window.
Why would you need to do this?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
just add
<br />
if ( m_wndToolBar.OnCmdMsg(...) )<br />
{<br />
return TRUE;<br />
}<br />
in function
<br />
CMainFrame::OnCmdMsg(...)<br />
before return default process.
|
|
|
|