|
Hi all,
Please clarify my doubt.
In my application i created the buttons using CBitmapButton class. Using the method LoadBitmaps() i load the bitmap over the button.
I need to load the Bitmap over the button as per the button size... ie., how to stretch the bitmap and loaded to the button...
Or is there any other way to implement this ??
Thanks and Regards,
Prakash
A Journey of thousand miles must begin with a single step.
|
|
|
|
|
Owner draw the button and
use StretchBtl(...)
to stretch the bmp
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Try CButtonST class. It has some memory leaks. But good control
|
|
|
|
|
See if this class helps.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Sorry my question is long. I try to use colour and fonts to make it clear.
I have a class and I now want to make a list of my objects and so I want to make a class which is a list of my objects.
So I have my object: CMyObject
My list of my objects: CMyObjectList
CMyObjectList has a CList member which is declared like this:
CList <CMyObject, CMyObject> m_ObjectList;
I have a member function in my CMyObjectList class called addMyObject() .
Now my question: should I add a CMyObject instance by pointer or by reference? When I add CMyObject to my list should I create a new object in the add() member function so that my caller can delete his copy or allow it to go out of scope? Does the CList addToTail() function create a copy? What is good form for this sort of problem? Should the list create a completely new object to store or should the client make sure the object is not deleted or go out of scope?
Example:
...
CMyObjectList myList;
CMyObject myObject;
myList.add(myObject)
myList.add(&myObject)
...
CMyObjectList.add(CMyObject myObject)
{
...
}
CMyObjectList.add(CMyObject *myObject)
{
...
}
Thank you.
|
|
|
|
|
My recommendations are as follows:
If you don't expect to derive classes from CMyObject, and all the objects you want to store are independent from each other, I would use a CList< CMyObject, const CMyObject& > . Specifying the second parameter as a const T& means that the compiler won't make a copy of the object simply to call the function. For a simple object (one smaller than 4 bytes), use CList< T, T > instead, since the copy is trivial.
If you need to be able to invoke virtual behaviour through the list, or store objects derived from CMyObject in a CMyObjectList, use a CMyList< CMyObject*, CMyObject* > . Also do this if you might need to refer to the same object at two different positions in the list, or if copying your objects will break any object relationships you may have.
CList always stores a copy of the object that is passed to AddToTail (in the pointer case, it copies the pointer).
I prefer to store actual objects in the list in the simple case, because it's a lot easier to manage.
|
|
|
|
|
hello everybody,
my project module is to develop a graphical language in vc++. we have to declare a few keywords,graphical routines,looping statements etc.
Using the syntax that we declared earlier, telling the user to follow that syntax to code it.
My problem is, how can i define these langauage primitives and compile it to produce the output.
FOr example,
the user code in editor,
# start
text "Mahe" 123 232 Bold
cirlce 232 232 21
line 232 232 232 121
# stop
our compiler(VC++) has to read all this code and produce a graphical output.please guide me for , how to analyze this project.
first i have to spec it out the language keywords etc and all...please suggest me to workout this project
Mahesh Kumar,b'lore
|
|
|
|
|
Hello!
If grammar in your language is simple
You must learn about(as minimal) regular expression:
http://www.codeproject.com/cpp/OwnRegExpressionsParser.asp
if grammar in your language is difficult(above 50 grammar rules), you must learn compiler design theory and use compiler-of-compiler for example yacc.
|
|
|
|
|
I know this may be an easy beginner question but it drives me crazy and I've alredy spent 3 hours on this.
I added the followilng libs to the linker:
d3dxof.lib
dxguid.lib
d3dx9dt.lib
d3d9.lib
comctl32.lib
winmm.lib
and the included files:
#include "./Common/d3dfont.h"
#include <windows.h>
#include <d3dx9.h>
#include <stdio.h>
Now I'd like to create a global font:
static CD3DFont* Font1 = new CD3DFont(_T("Arial"), 20, D3DFONT_BOLD);
static CD3DFont* Font2 = new CD3DFont(_T("Arial"), 10, D3DFONT_BOLD);
when I compile the whole thing the linker gives me an LNK2019 error, unresolved external symbol.
I think I've had the same error when I first used a dx-function, but I could solve the problem with the right lib-file.
I searched through the Text3D-example of the sdk but I can't find the point my project file is missing
|
|
|
|
|
This link[^] could help you.
And IMHO, global variables suck!
In amongst the statues
Stare at nothing in
The garden moves...
|
|
|
|
|
I've made a Speech application with Visual C++ and I want to run it in other pc but when I do, I get an error message with initializating speech engine. Must I export some else other files (I've only exported .exe file) so I can run the .exe file in other pc's different from where I compile and debug the applications?
Thank you in advance!
I have no idea
|
|
|
|
|
hi,
open your exe with "dependency walker". Now you can see which files (dll, sys,...) your exe needs to run.
Paul
|
|
|
|
|
Thank you
|
|
|
|
|
In the past I used a speech SDK from Microsoft and in the documents it lists the modules that you need to include in your install program.. I don't remember any specifics (was quite a while ago), just thought you may have over looked that..
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Yes, thanks. I installed all that modules but it doesn't work... I think it's about some trouble of software
|
|
|
|
|
Hi!
My program joining a multicast group and recieves packets. But I will recieve the packets at the network device, so there will be no delays when it is placed in a queue at my computer.
Does anyone know how listening at the device in c++?
I'm using linux mandrake.
Thanks for your help,
Stefan
|
|
|
|
|
|
I am using tree view control in order to enumerate all the application with window. I am using CreateWindowEx to create window to obtain the handle.Presently my output is very similar to that of Spy++ . But what I want window from CreateWindow should be hidden (a/c to requirment). nOT GETTING ANY WAY TO DO IT.
|
|
|
|
|
I want to print bitmap on full page, so i wright:
[code]
void CtestView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
int cxPage = pDC->GetDeviceCaps(HORZRES);
int cyPage = pDC->GetDeviceCaps(VERTRES);
Graphics g(pDC->m_hDC);
g.DrawImage(m_pBitmap, 0, 0, cxPage , cyPage );
}
[/code]
Thats ok in preview but not in printer. What transformations i need to do?
|
|
|
|
|
This is due to a printer DC and a screen DC having different levels of support. Take a look at my "Printing tips and tricks from the trenches" article in the printing section. It has a method to solve this problem.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
I read that article, but it dont contain answer: What and how i need to transform to see preview and printing page in the same style, using GUI+ ...
|
|
|
|
|
You need to make use of the procedure that changes a DDB to a DIB and use StretchDIBBits() to plot it. This command is much better supported by printer DC's. BitBlt usually fails miserably.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
I use GUI+, object Graphics and Bitmap. No BitBlt or StretchDIBBits!
|
|
|
|
|
Here is answer if somebody whant in:
void CtestView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
int cxPage = pDC->GetDeviceCaps(HORZRES);
int cyPage = pDC->GetDeviceCaps(VERTRES);
Graphics g(pDC->m_hDC);
g.SetPageUnit(UnitInch);
g.DrawImage(m_pBitmap, 0, 0, cxPage/g.GetDpiX() , cyPage/g.GetDpiX() );
}
|
|
|
|
|
Hi,
In a thread function exception is occured. exception in CInternetException. while throwing exception the thread is terminated with value 0. any one help to me.
Thanks in Advance.
Have A Nice Day!
Murali.M
|
|
|
|