|
|
How can I get Bitmap object from CBitmap object?
here Bitmap is in GDI+
|
|
|
|
|
CBitmap is a wrapper around HBITMAP - which you can get using GetSafeHandle.
I'd be shocked if the GDI+ Bitmap object doesn't have an HBITMAP initialiser.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Hi all,
I have made a Dialog based application in that i want to make a variable static text control i.e when at runtime value is specified its size should increase accordingly... How can i do so...
Can anybody help me in this????
Thanks in advance
|
|
|
|
|
If it's a static control, just make it big at design time, and only put a little text in it.
If there's not room to make it big to start, then there won't be room to grow later, will there?
Or will your dialog box grow too?
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
|
> dot net 2003
Then you might be better asking in a .NET forum? (eg, C++/CLI, or C#, etc)
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
In a Managed Extensions app or a native app?
Mark
|
|
|
|
|
For example:
void *p = new CArray<int>;
delete p;
It can't work, why?
modified on Thursday, June 26, 2008 6:27 AM
|
|
|
|
|
It can't work because CArray is a template, and you've not declared it properly.
Can I have my biscuit now?
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
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]
|
|
|
|
|
|
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]
|
|
|
|
|
void *a = new CArray<int,>;
CArray<int,> *q = (CArray<int,> *) a;
delete q;
Without digging into more detail than I care about, deleting a void * gives you trouble, as void is zero length, but you allocated a chunk of ram of a certain length. Also, void * won't have a destructor, so any clever things done inside CArray would not be tidied up.
Not so fussed about tea - got that already - but Iain wanna bikkit!
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Wait, the delete still crashes.
CItemData::CItemData(ItemType type, CArray<Gdiplus::PointF> *pFig)
{
m_type = type;
m_pFig = pFig;
}
CItemData::~CItemData()
{
delete m_pFig;
}
|
|
|
|
|
followait wrote: Wait, the delete still crashes.
1/ You missed out how your item is initialised: ie, where pFig comes from.
2/ The following code works just fine.
class CItemData
{
public:
CItemData (CArray<int,int&> *pFig)
{
m_pFig = pFig;
}
~CItemData()
{
delete m_pFig;
TRACE0("m_pFig deleted nicely\n");
}
protected:
CArray<int,int> *m_pFig;
};
CItemData i (new CArray<int,int&>);
I made the array a simple one, as I couldn't be fussed finding my gdiplus headers. I also make sure that pFig has been allocated with new - is that true for your code?
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
is the object pointed to by m_pFig deleted twice?
Mark
|
|
|
|
|
Yes
|
|
|
|
|
Well there's your problem right there
|
|
|
|
|
I have a filename like "D:\\myfolder\\aaaa.avi".
I have to extract the name of the avi file.have searched.but found methods for extracting only the first half.i use vc++
|
|
|
|
|
See PathFindFileName()[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Modified: Rajesh's answer is better - and has a link!
PathStripPath is your friend.
Or you could do it manually by putting the text into a CString, and using Find ('\\') and Mid to strip it away - but you might miss out on wacky things like /s, etc. Get the shell development people to do the heavy lifting for you!
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Can you use of FindFirstFile?
|
|
|
|
|
Hi all,
I m using a Validation for any CString type variable of Edit box control.
CString str;
if(str=="")
{
AfxMessageBox("It should not be blank");
}
if it is blank than it is working properly.
if i use only space in edit control.(there is no text only space is used)
than it not gives error please tell me how can i check it in case of space .
Please help me for this .
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
if (str.trim().IsEmpty()) {
}
modified on Thursday, June 26, 2008 5:32 AM
|
|
|
|