|
If ADMIN$ is unavailable there is nothing you can do. Sorry for that!
|
|
|
|
|
hi friends,
i want to display a static object on screeen(like rectangle, circle etc).
Problem arises when static objects are overlapped.
how to avoid that flicker when objects are overlapeed.
The drawing routine is continuosly called thro' OnDraw() or OnTimer metode.
plz help me
Thanksin advance
Rahul here
|
|
|
|
|
you need to use double buffering. In your OnPaint you need to use an extra HDC. The process is pretty simple.
1. Create a compatibleDC with the window HDC to be used as a buffer.
2. do all your drawing to the buffer.
3. draw it back to the window DC in one call to BitBlt.
|
|
|
|
|
This annoyance has been bugging me for a long time now.
Lets say I have a class called cParse contained in a .h and .cpp. Now a member of this class is a vector, declared as a member "std::vector<short> S_data;" in the header file.
Now normally with vectors and similar when you typr the name followed by a period you are shown a menu for all the functions/variables. But when it's declared as a class member in a header file you are not.
Is it possible to add something to the top of the source file which will enable this feature? It would cut down on typing errors if you can use the auto-complete feature of these menu's.
|
|
|
|
|
I tryed the same and I think it's a IDE bug. Sorry for that! Good luck!
|
|
|
|
|
1st of all, what IDE do you use ??
then, show us a piece of the code, because i suspect you to forgetting something in it...
one last thing ; when posting for template code, use < instead of < and > instead of > otherwise, the browser will try to interpret then as html tags, and not show them then...
ps: you've been asking so many easy questions these days, that i wonder if you are OK with C++... maybe you should learn for it a bit more deeper
|
|
|
|
|
v2.0 wrote: ps: you've been asking so many easy questions these days, that i wonder if you are OK with C++... maybe you should learn for it a bit more deeper
Hey I'm sorry if my questions are too easy for you. Maybe if I made them a bit more difficult you would actually answer some of them. Perhaps I should take my easy questions over to the easy C++ message board.
|
|
|
|
|
not what i said... ;P
you are always welcome to ask C++ questions on the C++ forum
but if you're new to it, or need more subtle needs of the language, then you should look at a technical book or something (my favorite, The C++ language form Bjarne Stroustrup - but ok, i know it's not that easy to start with for newbies)
now, you can answer my previous questions :->
|
|
|
|
|
v2.0 wrote: ps: you've been asking so many easy questions these days, that i wonder if you are OK with C++... maybe you should learn for it a bit more deeper
Diplomacy is my first name
~RaGE();
|
|
|
|
|
Rage wrote: Diplomacy is my first name
ok, since then, i'll have to name you "Diplomacy" then
|
|
|
|
|
v2.0 wrote: i'll have to name you "Diplomacy" then
What about Diplomat
|
|
|
|
|
He said "Diplomacy", so...
|
|
|
|
|
v2.0 wrote: v2.0
you changed you name, Why?
|
|
|
|
|
shhhh
i'm incognito brother
i'll be back on May 2nd
|
|
|
|
|
I've had reasonable luck in VC6 with auto-complete for std template container declarations by wrapping them as trivial classes.
Example:
<br />
class CStdVector_BYTE : public std::vector< BYTE ><br />
{<br />
};<br />
<br />
class CMyClass<br />
{<br />
CStdVector_BYTE m_vecBytes;<br />
};<br />
Regards,
Dan
Remember kids, we're trained professionals. Don't try this at home!
|
|
|
|
|
From what I remember of typical compiler behaviour, include files are inserted into the main file at compile time. If you want the IDE editor to understand structures and such, they have to be in the main file.
I suggest you move the declaration of the vector to the main source file while you are doing the serious code-writing, and once the program is more-or-less finished, move the declaration to the header file? If you use the header in various places, you may need to use IFNDEF, etc.
|
|
|
|
|
I hope someone can help with this...
I am trying to select a bitmap into a device context. When I do this by creating a handle to the bitmap as follows everything works fine
*pm_hBmpNew = (HBITMAP) LoadImage(AfxGetInstanceHandle(), // handle to instance
filename, IMAGE_BITMAP, // image types
0, // desired width
0, // desired height
LR_LOADFROMFILE);
And then later on I select the object by doing
VERIFY(*pm_hBmpOld = (HBITMAP)SelectObject(*pm_dcMem, *pm_hBmpNew));
HOWEVER if I create that handle by creating a bitmap by calling CBitmap::CreateBitmap like so
p_cbmME->CreateBitmap(256,256,1,32,imagedata);
*pm_hBmpNew=((HBITMAP)*p_cbmME);
and then Select the object like before
VERIFY(*pm_hBmpOld = (HBITMAP)SelectObject(*pm_dcMem, *pm_hBmpNew));
then it works if I select a file(and create imagedata by reading in the file) the first time. But if I then press the same button again and select then another file without closing the application the application just hangs!
Also, I don't know if this is relevant but I am calling this function with two different buttons. And if I first call it with Button1 and then with Button 2 there is no problem. But if I then again press either of the buttons the application just stalls.
Can anyone help with this? Also is there any reason why AfxMessageBoxes should not work in my application? I am happy to explain my problem further, but just did not wanna put people off with long code if it is not necessary. I hope I explained my problem ok. Please someone help!
|
|
|
|
|
Hi Laughing Buddha ,
You wrote then it works if I select a file the first time. But if I then press the same button ...
I guess that your problem is p_cbmME->CreateBitmap(256,256,1,32,imagedata); I think that you need
to detach first HBITMAP from CBitmap and again use createbitmap
maybe it is some helpful to you
|
|
|
|
|
Oh maybe that is it although why does the handle work fine when I use LoadImage instead? If I just use Detach() then i get a microsoft error right away when I press the button because I assume then the handle to the temporary handle is deleted as well.
|
|
|
|
|
Laughing Buddha
I think if you create or attach a bmp file to CBitmap you need to detach bitmap but I suggestion that you detach previous variable Cbitmap,and if you use LoadImage I think DeleteObject(yourvariablegdi)
use Detach if you use attach or create to CBitmap
maybe it is some helpful to you
|
|
|
|
|
I think it is because you are not (closing the handles?) deleting etc the object. I think if you Create a graphical object like a bitmap, you should delete it also before reusing it. DeleteObject(...) should help with that.
I did not check your code thoroughly though.
this is this.
|
|
|
|
|
I do delete the objects like so at the beginning of the function:
if(pm_hBmpNew != NULL )
DeleteObject(*pm_hBmpNew);
if(p_cbmME !=NULL)
DeleteObject(*p_cbmME);
if(pm_hBmpOld != NULL)
DeleteObject(*pm_hBmpOld);
if(imagedata != NULL)
DeleteObject(imagedata);
if (prectStaticClient !=NULL)
DeleteObject(*prectStaticClient);
if (pm_st !=NULL)
DeleteObject(*pm_st);
but it is still not working. Am just deleting all of the ones that could possibly be involved but just not working. Could it be anything else? How would I go about detaching the bitmap from the CBitmap? Thank you for all your help so far
|
|
|
|
|
Oh my dear god I just finally found that detach handle and
IIIIITTTT WWOOOOOORRRKKKKKSSSSSS!!!!!!!!!!!!!!!!!!!!!!!
Oh thank you both so much, you don't believe how long I was working on this and just did not know that. Oh thank you! Thank you! Thank you!
|
|
|
|
|
hi all
i had made applicaton that generate the barcode and now i want the to make it as com component and acces through site. i mean online barcode geneator. it works fine as destop application.
i want to know how to use mfc classes in atl. or these allowed or cannot use these classes in atl 7. im using visual studio.net 2003. and atl 7 project.
Tasleem Arif
|
|
|
|
|
Yes, I think you can. It is just a COM dll using MFC. But in the project options, there is this option of "Attributes". Just uncheck it, now you could select MFC also. If you don't specifically include similar ATL header files, (like for CString, which is available in both MFC and ATL), it is all ok. I never had a problem with using both of them in one project (although I only used VC6).
this is this.
|
|
|
|