|
you can create console application with win32 support
-Prakash
|
|
|
|
|
|
As was said before, VC++ is the Microsoft version of C++. It contains several extensions to the official C++ standard, many of wich i find quite compeling. Microsoft makes a habit of "extending" broadly accepted standards. I don't like it most of the time, but i think that in this case, they did a good job (if you disregard the heap if compatibility issues even between their own different compiler versions).
If you read your way through th MSDN-Library VC++ articles, you will stumble upon paragraphs marked "Microsoft specific" once in a while. That's where the difference is.
|
|
|
|
|
Mr.Brainley wrote: if you disregard the heap if compatibility issues even between their own different compiler versions
I know this isn't what you were getting at, but just a note that the VS.Net2005 compiler is something like 98.5% compliant with the C++ standard, which was a lot higher than any other compiler available.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
i am doing an application where i need to load a bitmap from a file like C:\MyFolder where my bitmaps are stored. i don't want use bitmap as resource to add bitmaps to my application. Now the problem is when i run the application using LoadImage() function it is showing my bitmap in scratched or crushed format(bad format). i want to show it as it is i.e. in actual size. i have attached the code snippet i m using. please help me immediately.
thanks to everyone..
void CPictureBox::ShowBitmap(CPaintDC *pdc)
{
//Create a device context to load the bitmap into
CDC dcMem; dcMem.CreateCompatibleDC(pdc);
//Get the Display area available
CRect lRect;
GetClientRect(lRect);
lRect.NormalizeRect();
//select the bitmap into compatible device context
CBitmap* pOldBitmap = (CBitmap*)dcMem.SelectObject(&m_bmpBitmap);
//m_bmpBitmap.SetBitmapDimension(lRect.Width(),lRect.Height());
//copy & resize the window to the dialog window
int bmw, bmh ;
m_bmpBitmap.GetBitmap(&bm);
bmw = bm.bmWidth;
bmh = bm.bmHeight;
int xo=0, yo=0;
pdc->BitBlt (xo, yo, lRect.Width(),
lRect.Height(), &dcMem,
0, 0, SRCCOPY);
pdc->StretchBlt(0,0,lRect.Width(),lRect.Height(),&dcMem,0,0,bmw,bmh,SRCCOPY);
dcMem.SelectObject(pOldBitmap);
}
void CPictureBox::OnPaint()
{
CPaintDC dc(this);
// device context for painting
RECT rect;
GetClientRect(&rect);
dc.FillSolidRect(&rect, RGB(255,255,255));
if(m_sBitmap!="")
ShowBitmap(&dc);
}
void CPictureBox::SetBitmap(CString strBitmap)
{
m_sBitmap = strBitmap;
HBITMAP hBitmap = (HBITMAP) ::LoadImage(AfxGetInstanceHandle(),
m_sBitmap, IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE | LR_CREATEDIBSECTION );
// Do we have a valid handle for the loaded image?
if (hBitmap)
{
// Delete the current bitmap
if (m_bmpBitmap.DeleteObject())
m_bmpBitmap.Detach(); // If there was a bitmap, detach it
// Attach the currently loaded bitmap to the bitmap object
m_bmpBitmap.Attach(hBitmap);
}
m_bmpBitmap.GetBitmap(&bm); //Get Bitmap Structure
Invalidate();
jIteen
|
|
|
|
|
Whats wrong in your code?
|
|
|
|
|
http://www.codeproject.com/tools/imageviewer.asp[^]
I wrote this tool to help solve problems like you are having. With this tool I could check that LoadImage() actually loaded the image the way I wanted it loaded, I could check every bitmap manipulation immediately after it was done etc.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
yes your article But I think its a good article well done Arends
|
|
|
|
|
First of all i dont understand why are you using a BitBlt and StretchBlt in your drwing code.. shouldn't you be using one of them. Anyways your logic.
By the way if you only want to display the bitmap on the dialog try removing the LR_CREATEDIBSECTION flag from LoadImage call. This will create a DDB compatible with your Display and u dont have to worry about the palette and other petty issues :P.. just select it and BitBlt or StretchBlt it
Peace!
|
|
|
|
|
|
hi
can anyone please tell me how can we override the expansion and collapsing of the tree control when we double click an item in a tree
my basic aim is to display the tree contents below a parent tree item whenever the parent item is double clicked.
regards
partho
|
|
|
|
|
partho5 wrote: expansion and collapsing of the tree control when we double click an item in a tree
Subclassing is a possible solution to this problem. You can Derive a class from CTreeCtrl and then override the methods in the derived class.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
thanks for the reply anshuman
i have already derived a class mytree from ctreectrl ..but i need to disable the expand and collapsing of the tree item whenever i double click a parent item.
so for example whenever i double click a root, the root should never collapse untill i click on the button (+ left of the node)
|
|
|
|
|
I've developed a bho.dll and it works fine with internet explorer.
I know maxthon/myie are also IE-cored browser and the bho.dll should be loaded into them automatically.
But to my surprise they don't load it at all.
How to solve this problem?
thanks!
|
|
|
|
|
Is C++ is 100% OOP language?
If yes, Justify
If not, why
|
|
|
|
|
what do you want to know exactly ?
C++ inherits from C, so, no, not 100% OO. but what is a language 100% OO finally ?
|
|
|
|
|
I would say it's closer to 40% maybe 60% if using MFC.
|
|
|
|
|
waldermort wrote: would say it's closer to 40% maybe 60% if using MFC.
That doesn't make really sense. A language doesn't becomes more object-oriented if you use a specific library. And what if you used wxWidget instead ? MFC are juste wrapper classes around the WIN32 API. What if you would have written these classes yourself ?
|
|
|
|
|
anilFirst wrote:
Is C++ is 100% OOP language?
AFAIK,C++ is not 100% OOPS.
anilFirst wrote: If not, why
A language is OOPS if it encompasses all the four laws:
1) Encapsulation: Binding of data and member functions in one unit.
2) Polymorphism: One thing taking many forms.(Overloading etc).
3) Inheritence: Extending functionalities of classes.
4) Abstraction: Hiding of functionalities.
But in C++ there is a friend function, using which you can not only access the variable's value you can also modify it that even from outside the class. Thus violating Encapsulation.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: But in C++ there is a friend function, using which you can not only access the variable's value you can also modify it that even from outside the class. Thus violating Encapsulation.
This is not true. The explanation is written here :
http://www.parashift.com/c++-faq-lite/friends.html#faq-14.2[^]
To answer the original question: No, C++ is not 100% OO, simply because it remains compatible with C. It's a sickness that does seem to be defeatable, that people insist on regarding C++ as an extension of C and therefor being totaly OK with producing crazy mix code that is bad in both worlds. I believe, that one can write 100% OO in C++, but i really can't proof that. Does anyone know of a certain problem that requires a non OO-workaround in C++ ?
|
|
|
|
|
Mr.Brainley wrote: The explanation is written here
Thanks for that lovely article.
Actually what's written in the books are the very basics that could go wrong (Just like this one ditched me) when you grow up in this world.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Mr.Brainley wrote: Does anyone know of a certain problem that requires a non OO-workaround in C++ ?
main()
|
|
|
|
|
See, that's my problem. Too often I don't see the obvious ...
|
|
|
|
|
why should this be a problem ??
codito ergo sum
|
|
|
|
|
main() isn't the member of a class, it's a global function, which doesn't fit with the OO paradigm
|
|
|
|