|
Assuming m_Static is your static control:
CDC *pDC = m_Static.GetDC();
pDC->MoveTo(0,0);
pDC->LineTo(100,100);
|
|
|
|
|
Hello,
Derive a class from CStatic using Class Wizard. Draw enough code in OnPaint(...).
Is it OK?
- NS -
|
|
|
|
|
the problem is that i have a window and a Cstatic control on it. I have to draw a line that goes on both. Knowing this, are your solutions still valid or i shoul build a bevelline(that what i need) class and set it's position with SetWindowPos?
tnx
|
|
|
|
|
I feel you have a better method than me! It will be fine if you set the zorder of bevelline control to the top of the static control in SetWindowPos(...).
- NS -
|
|
|
|
|
ginognaus wrote:
I need a fast help drawing a line (function lineto) on top of a programmatically created Cstatic Control.
This link might help you
http://www.codeproject.com/cpp/cppfaq10dec04-23jan05.asp#q214
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
i am working on a Database project thats one table in its Database contains an images, i am retrieving data with CRecordset.
the problem is when i try to get the retrieved data from CLongBinary to bitmap, i try:
////////////////////////////////////////////////////////
bitmap.FromHandle(HBITMAP(varValue.m_pbinary->m_hData));
::OpenClipboard(this->GetSafeHwnd());
::SetClipboardData(CF_BITMAP,HBITMAP(bitmap));
::CloseClipboard();
////////////////////////////////////////////////////////
but i colud not paste the data from the clipboard to Microsoft Paint.
any one has an idea about this.
|
|
|
|
|
A HBITMAP is a handle, it's not the actual bitmap data. How did your data get in there ? If the data is pixel data on a non paletised image, you can create an image of the same depth that's a DIBSection and copy the bytes in.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I'm trying to get the shell to start labeledit on an item
in a namespace exension I've created...
I've tried some things but nothing have worked, e.g. to get
the item's contextmenu, but since it's my application who supplies
that menu, it doesn't work...
Any one have a slightest clue how you do this?
"There is an empty room full of people who think you are creative"
|
|
|
|
|
Have you consulted Michael Dunn's nine-part article on namespace extensions? It might shed some light on the problem you are having.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Jepp, I've read them...
"There is an empty room full of people who think you are creative"
|
|
|
|
|
Hello Gurus,
I wish to build an application that will be a map designer for old fashionned 2D games.
The workspace will contain:
- references to tiles which are bitmaps either opened from existing bmp files or created by the application. So I will provide a simple bitmap editor. These bitmaps will be stored in separate .bmp files at a given path. I intend to save the path of the bitmap files in the main document. The tiles will be 3 sizes: 8x8, 16x16 or 32x32. The tiles are in 4 gray scales.
- tables: Once tiles are done (at least one tile), we can create tables of tiles. The tables will contain references to the tiles. All tiles in a table are the same size: 8x8 or 16x16 or 32x32.
- sprites, once tables are built (at least one table), we can create sprites, which are composed of tiles. the sprites's size are a multiple of the tile's size in width and eight.
- frames: These sprites can contain several frames. Frames are a set of sprites (of course). The size of sprites are any size but a multiple of the tiles in width and in height. all frames must be the same size.
- maps, like sprites, once tables are created (at least one), we can create maps. The size of map are any size but a multiple of the size of tile in widht and eight.
The document will open or save all these information.
I want to build all in visual with drag'n drop stuffs for the tables, sprites and maps editors.
I hope you see the application I wish to build.
How can I handle such application in MFC?
Thanks for the suggestions and helps.
Best regards.
Fred.
There is no spoon.
|
|
|
|
|
I would make an MDI application and associate different views (CView derived classes) with your MAP file. The reason to be MDI is so you can open your MAP file and BMP files at the same time, or copy and paste between different MAP files.
You can have different 'windows' open on the same document. Map overview, map editor, sprite placer, etc.
|
|
|
|
|
So, I should make a CView derived class for each type of files it must handle? one for a map (heart document), one for the tile, one for the table etc.?
There is no spoon.
|
|
|
|
|
Typically, there is a CDocument-derived class for each file TYPE that you will want to manage and at least one CView-derived class associated with each document. If you want to 'look' at the data in a a particular document in different ways, then you can attach different CView-derived classes to the same document. For exmaple, I might have a doument with some histical stock prices in it. One CView might be a grid of the symbols in rows and their values in columns. Another CView on the same document might contain picotorial graphs.
In your case, the map data might be contained in one document, tables another document, sprite lists another document. The map data might have different views - one view might be a spreadheet of the map data another view might be a picture of the map, etc.
|
|
|
|
|
It's not quite what you're after, but this article[^] might help.
|
|
|
|
|
hi, all
I got the "First-chance exception in PrevCheck.exe: 0xC0000005: Access Violation" when the program try to access one of the library file, the application is linked to .lib file, it's accessable....
cfg.Step().Format( "Checking Day Bucket for %s", m_tmDay.Format( "%D-%b-%y" ));
if I do F11, It should go to the function of cdate.h in library
string_t CDate::Format( const char * szFormat ) const
it will go there, but the same time, Access Violation come up....
also,
"First-chance exception in Pre.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception"
could anyone tell me what to check?
Cheers,
|
|
|
|
|
valerie99 wrote:
cfg.Step().Format( "Checking Day Bucket for %s", m_tmDay.Format( "%D-%b-%y" ));
could anyone tell me what to check?
The first thing I would do is break this statement down into three separate statements so that you can concentrate on one of them instead of all three.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Thanks for your reply. I broke it down, the access violation happened when the m_tmDay.Format( "%D-%b-%y" ) calling cdate.h function
string_t CDate::Format( const char * szFormat ) const
it's definited as "CDate m_tmDay;" in header file.
Thank you!
|
|
|
|
|
My suspicion is this correction required:
cfg.Step().Format( "Checking Day Bucket for %s", (LPCTSTR)(m_tmDay.Format( "%D-%b-%y" )));
|
|
|
|
|
Thank you. I just tried it, but it still gave me the access violation....
I think the problem is in cdate.h
string_t CDate::Format( const char * szFormat ) const
the "string_t" is another string library file......
don't know what to do........thanks ....
|
|
|
|
|
you saved me from hell...............!!!!!
it works!!!!!!!!!
|
|
|
|
|
Hi everyone,
I have a question. Do anyone know how to detect calibration in ATM machines?
I have a autoscript .exe file. When I run the file, it opens a dialog box having CAlibration button on it. When I hit the calibration button, it does the calibration and ends without showing that when it is done.
So, what my problem is, I want to detect that calibration window and see when it closes.
Your help will be appreciated.
Thanks
Preeti
Preeti9
|
|
|
|
|
you calibrate an automatic teller machine ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Yes,
Please help
Thanks
Preeti
Preeti9
|
|
|
|
|
Assuming it's running Windows (is it?), then you can use the standard techniques for any displayed window. For example: Use FindWindow to locate the dialog box. Periodically check if the window still exists (IsWindow). There are other methods to detect the process and when it closes provided that the process doesn't keep running after calibration is complete.
|
|
|
|