|
I developed a small SDI sample application in MFC. when I run the application and set break point inside CView::OnDraw(), it is not getting called at all. can anyone suggest the reason and clearly explain the significant difference between ondraw and onpaint methods
|
|
|
|
|
MSDN:
OnDraw-
The framework calls this function to perform screen display, printing, and print preview, and it passes a different device context in each case. There is no default implementation.
OnPaint-
The framework calls this member function when Windows or an application makes a request to repaint a portion of an application's window.
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Is the only way to call OnDraw() is by calling Invalidate?
Tell me the other ways how i can Call OnDraw()?
Also pls confirm that Is not OnDraw() called by the framework under any circumstances?
If it is called by the framework under any situation describe it.
Thanks in advance.
|
|
|
|
|
OnPaint () is called to draw dialog boxes, OnDraw () is called to draw views. There's no good reason to have two separate methods to do this, and .NET has eliminated this.
Calling Invalidate () right after you've made the change you want to appear in your view may solve your problem.
|
|
|
|
|
I just discovered exactly the same problem. I open a txt file and expect OnDraw to be called automatically but it doesn't. I added UpdateAllViews and setmodifiedflag() to the doc class after loading the file but still nothing. If I alt-tab to another app and then back to my SDI app OnDraw still doesn't get called. Is it something to do with the view being embedded in the Cmainframe as the only view ?
I solved it by putting a WM_PAINT handler in the view and that performs as expected - seems odd though to have the OnDraw function in there now.
|
|
|
|
|
ondraw gets called when u draw something on the dc and call invalidate();
next if u have also mapped wm_paint message the ondraw method will never be called.
any one of them must be used..........
best regards
|
|
|
|
|
how to load bitmaps or icons on a list box control?
thanks in advance
|
|
|
|
|
|
See here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I suppose that
The Image List Box shows a list of images. It is not possible to display text.
clashes with his previous requirements.
On the other hand, if the requirements changed, I should edit my 'repost' reply.
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]
|
|
|
|
|
Hi all,
in my simple C++ application I want to use a c# com dll how can i do that.
Can anybody suggest me the right approach for doing that??
Thanks in advance...
|
|
|
|
|
|
|
Hello,
i want to try to read data from mobile phone, but i never do something like this!
So if you have good reference how to start with this, pleas give me a link/url!
It should be a simple project for beginners, just do establish the connection with them,
and if possible read from addressbook
Thanks in advance!
termal
modified on Friday, November 14, 2008 6:18 AM
|
|
|
|
|
termal wrote: i want to try to read data from mobile phone......It should be a simple project for beginners, just do establish the connection with them,
and if possible read from addressbook
There is no such thing.
I've done this a lot so I know what to expect. There's a lot to be done and questions to be answered before you can "establish a connection" or "read from the address book".
Your question is quite comparable to the question "I have never used a hammer, but can you please tell me in a few sentences how to build a house".
Things to consider:
What media will be used to communicate with the mobile device? Bluetooth, USB, RS232?
What drivers are you using for this and how does the device present itself?
You may use the Bluetooth Serial Port Profile and open the device as a virtual COM-port and then you may "establish a connection", but what are you supposed to write to it and read from it? AT-commands? If so you need to know what AT-commands the mobile device supports. It may have a non-standard command set that may provide functionality for reading and writing to and from the address book, but how are you supposed to know?
And this is the easiest way to do it.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi,
ups, yes you have right!!
I have a 2 old mobile phones so i can tested with them, siemens me -> try to connect over RS232 and
Motorola A780-> try to connect over usb!
regards
termal
|
|
|
|
|
termal wrote: siemens me -> try to connect over RS232
I suggest you opt for this one because it's the simplest interface to "establish a connection" through.
Read here[^] for guidance on how to do that.
Note that you have to know what COM port your device is connected to.
But what happens when you've established the connection?
Then you're supposed to start communicating with the device. What protocol should you use? Do you know the protocol the device expects on that port?
Usually, as I said in my previous post, it's possible to send AT commands using the device as a modem. But the command set may be extended by vendor specific commands that are supposed to be used when "reading from the address book", if this functionality is supported at all through this interface.
You can have a look at this list of AT commands for Motorola phones here[^], but you'll notice that there are a lot of question marks which means that a lot of unknowns.
My point is that you have to know a lot about your device in order to start communicating with it, such as HW interface (RS232) and protocols supported. Protocols may even be nested, i.e. one protocol is wrapped inside another.
You have to know all this before having a chance of doing something right and get answers from the device that actually makes sense.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
termal wrote: i want to try to read data from mobile phone, but i never do something like this! It should be a simple project for beginners...
Are you sure this is something you want to try and tackle? Ambition is one thing, but by being a beginner, you're going to run into so many roadblocks.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi Experts,
I m working on a project which have two application which uses
one common DLL.and I wanted to share one common variable.But its not worked.
So I decided to use Windows Registry.
So can anyone tell me simple steps in C++ for.
1.Creating new Registry key
2.Setting its value as per requirement
3.Read the updated values when need.
4.Close registry ( i dont know when to use it..if my application is ruunig)
Plz help me..
Waitng for ur great solution.
regards,
Vijay
|
|
|
|
|
|
Thnax Saurabh,
THanx for replying dud..
but I cant open this site.(RESTRICTED ACCESS).
so If u know
plz tel me.
or
suggest any other option,
Regards,
Vijay
|
|
|
|
|
You are restricted from using MSDN? How is a developer supposed to get anything done without access to a toolbox? Do you have MSDN on CD/DVD?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Member 3220373 wrote: I m working on a project which have two application which uses
one common DLL.and I wanted to share one common variable.But its not worked.
In fact, you can make it working, see [^].
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]
|
|
|
|
|
i want to display icon/bitmap and some text in front of that icon or bitmap in a list box. how can i do this?
for ex
BITMAP1 "SOMETEXT"
BITMAP2 "SOMETEXT"
thanks in advance.
|
|
|
|
|
There's the List-View [^] control for that.
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]
|
|
|
|