|
Paint the bitmap as a background and store the brush strokes as an array of points. When you save, redraw these points to a memdc, extract the bitmap from the memdc and write it. You may want to consult the good old Scribble sample app for details on how to save and draw the points.
onwards and upwards...
|
|
|
|
|
I need to use several classes like:
CString , CRecordset and e.t.c.
What should I do to include them?
|
|
|
|
|
no way.
use other classes that the WinAPI provides
TOXCCT >>> GEII power
|
|
|
|
|
Include MFC support in your project.
Or....
Dont use them.
Simple. Some of the smaller classes you can actually copy and paste into Win32 code and they work with a bit of tweaking. But there is much more to MFC than a bunch of classes that can be used independatly of the framework im affraid... So you either use MFC, or you dont.
The best bet is to forgo MFC ....
For CString - id just use std::string or one of the billion other string classes out there.
For CRecordset - well, personally I'd use ADO anyway but thats just me.
|
|
|
|
|
what is std::string and how to use it?
|
|
|
|
|
hey, do you know MSDN ?
std::string is the C++ standard string template class
have a look at the file STRING (without the .h) in you compiler includes folder to see how it work is you prefer... (if you use visual C++ 6, it could be something like that : C:\Program Files\Microsoft Visual Studio\VC98\Include\STRING[^])
TOXCCT >>> GEII power
|
|
|
|
|
It's part of the standard template library (STL).
STL is sorta like MFC, but unlike MFC it's not a framework and is more geared to data storage/manipulation etc - providing you with things such as map's, linked lists, vectors, dynamic arrays etc. IMHO it's actually better than MFC's version of these classes - far more standard and MFC's versions were only really created as a stop gap when STL was being developed.
Though while map is better than CMap, and list is better than CList (IMHO), std::string isn't quite as good as CString, but its a string class you get free.
To use it:
#include <string>
#include <algorithim>
using namespace std;
void Blah()
{
// contact
string myString = "Hello ";
myString += "word"
// make the string lower case
transform(myString.begin(), myString.end(), myString.begin(), tolower);
etc etc.
}
One word of warning. STL does have quite a learning curve (for the very basic, just learn what an iterator is) and the provided docs (with MSDN) are very poor. Search the web for "STL Documentation" and find youself a better set.
If you can't be biffed to learn STL (its worth it in the end) then just grap a free string class from CP etc - im sure there are 100's.
|
|
|
|
|
|
std:string is a class template for handle strings in STL.
If you only want a string class, I think that is good choice.
to use, simple add
#include <string>
using namespace std;
Also, the best string class outside MFC is CStdString.
http://www.codeproject.com/string/stdstring.asp
Enjoy it.
Rodrigo Pinho Pereira de Souza
|
|
|
|
|
Hi beautiful people,
we are two poor italian students, we have a big trouble with our thesis...
we have to implement an image selection function in our MDI application, and we succeed in drawing the focus rectangle but when mouse moves(to resize the rectangle) all the window is redrawed,because of the command invalidate() in the OnMouseMove function. we wish the application to redraw only the focus rectangle and not the whole background. we tried to use the instruction invalidate(FALSE) but is worst than the other one. please,HELP US!
Thank you so much for answers.
Bye Bye, Cruscoz
|
|
|
|
|
Its more about your OnDraw method. I suspect what you are doing now is redrawing the entire view when OnDraw gets called. What you need to do is find out what area of the CDC passed in is invalid, and only repaint that area.
Look up CDC::GetClipBox which should get you started.
In this case, you would need to call GetClipBox and only repaint what lies within this box.
Also lookup InvalidateRect.
|
|
|
|
|
Drawing a fucus rectangle while the mouse is being moved is one of the very, very few operations where you might draw directly instead of in OnDraw.
Basically, you:
draw and save using the initial mouse position in OnLButtonDown
erase the saved rect, updating it, drawing the ract and save it again in OnMouseMove
erase the saved rectangle in OnLButtonUp
You might want to use DrawFocusRect, which uses XOR as the drawing operation (that is, erases the rectanle if it is already drawn).
|
|
|
|
|
If you are drawing the focus rect using DrawFocusRect, then you would just capture the mouse, and when it moves, call DrawFocusRect with the old coordinates (which will erase the old focus rect) and call it again with the new coordinates to draw the new one. Very fast and no flicker.
onwards and upwards...
|
|
|
|
|
CWnd::Invalidate - This method invalidates the entire client area of CWnd.
Maybe you should only invalidate the rectangle that is the union of where you 'were' and where you 'are', which might be a LOT less than the entire client area of your window.
When you invalidate the entire client area of your window, your OnDraw will get a paint message with the ENTIRE client area of your window in the rcPaint of the PaintStruct. Not good, if you moved a little rectangle down in the lower right corner of your window.
|
|
|
|
|
i have a buetooth sockets project which i program under Visual .NET under Windows XP (bluetooth is supported only fros WinXP SP1 or later).
from the MSDN, i read i have to include the Ws2bth.h and the BluetoothAPIs.h , bt none of them exist on my disk...
i really don't know where it can come from.
does anybody have an idea ?
TOXCCT >>> GEII power
|
|
|
|
|
I would say SERIES 60 SDK 2.1 FOR SYMBIAN OS
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
don't be influenced by my bio.
i am programming on Visual C++ 7 cause the target of my program is Windows...
and you don't answer me. i wrote something i found in the MSDN, so it might exist !
TOXCCT >>> GEII power
|
|
|
|
|
...and more, our project is not fo nokia but for Sony/Ericksson... ;P
TOXCCT >>> GEII power
|
|
|
|
|
So its not windows after all its a symbian OS
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
|
Man dont get angry easy
Try to download the Feb 2003 platform sdk
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
i use the october 2003 one...
TOXCCT >>> GEII power
|
|
|
|
|
Just try to get the latest
i have the feb 2003 and i have the file on my drive
i noticed that you get angry easily
its not good
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
hummm ???
how can it be ?
do you have an idea on why it is not neither on my Oct2003, nor on my Feb2003 MSDN package ?
TOXCCT >>> GEII power
|
|
|
|
|
Did you downloaded it? or installed it from a CD?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|