|
Nothing... What Doesn't come out Right the Text in The Static Text I edit by hand
Thought leon had something better
|
|
|
|
|
ForNow wrote: ...the Text in The Static Text I edit by hand Please elaborate.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
When I drag a Static Text to my Dialog and I Drag the corners sometimes the text get chopped off
So I manually edit the .rc file its a lot easier
|
|
|
|
|
Clearing some confusions between Richard and yourself. The free version of Visual Studio doesn't have the visual resource editor. It only has the resource view window in the IDE that allows you to see the names in the RC file, but does not let you visually edit it. If you only have the free version of VS you will never have seen the visual resource editor.
That aside all any visual resource editor does is allow you to play around visually with the files in the RC file and then save that file. Things that drive you nuts like TAB order, or aligning text inside or around bitmap backgrounds or text cutting off like you described. As I said there are a couple of free options that will allow you to do that if you haven't seen the visual editor it's worth looking at.
Now I will explain the real world complication when you do this commercially for a product.
The default setup for Visual Studio is to bind your resources directly into your EXE. The first obvious fallout is as the size of your resource file increases so does your EXE file and that can become problematic. Now if you are just using dialog templates and resource ID's, they are tiny and I wouldn't worry. However if you are using lots of bitmaps and icons in resource form that is another thing entirely. The old Win16 exe stub format had the good sense to limit the bound resource size to 64K but win32 allows a full 4GB which is a bit crazy. I sometimes run across 2GB+ EXE from amateurs and the moment you see it you know what is in it, lots and lots of graphic resources. It doesn't even usually dawn on them that having a 2GB EXE is putting stress on windows itself.
The second problem we usually face commercially is human language and monitor specifics. We need different text, fonts and bitmaps for different countries and often different setups for different aspect monitors. So you either need some clever installer, or at runtime you detect windows language and monitor scalings and then load different resources appropriately. The later is almost always how all Microsofts own products do it.
So commercially for large projects the EXE itself usually only binds limited vital resources, all the rest of the resources are bound in at runtime either from File/DLL. Once you have done the code to do that feature, you will find you will always tend to use that rather than resources in your EXE because frankly it's faster and easier. You get a nice clean separation between resources and code and you can manage both independently.
In vino veritas
modified 17-Aug-16 20:23pm.
|
|
|
|
|
I am using Visual Studio 2012 Professional The Bitmap is dashboard how to use the application/product
If you provide me with e-mail I have .png image of what I am doing and it will all make sense
Thanks
|
|
|
|
|
leon de boer wrote: Clearing some confusions between Richard and yourself. Can't see anything in my messages that you may be referring to. I made no mention of the resource editor, and it's pretty obvious from OP's messages that he is using a version of VS that does include it.
|
|
|
|
|
I'm not a huge fan of MFC but have used it extensively in the past. I never had trouble mixing Win32 and MFC at all, in fact I found doing so essential and just part of a regular day MFCing.
Steve
|
|
|
|
|
okay im done with my C++ book and know each bit of what it has.
now o need to master it ... i guess the bookinh knowledge wont be enough and i need to get some more experience and expertise with c++ ... what do i need to do..?? what might be good ways to gain more experience?? what i can do next to increase my programming experience??
i also have a bit of knowledge of python, java, C#, javascript and HTML an xml.
i have experience in operating WINDOWS( and of course DOS) and LINUX(or UNIX)
|
|
|
|
|
Ratul Thakur wrote: okay im done with my C++ book and know each bit of what it has. That's impressive. I've been working with it for over 25 years and have yet to master it.
Ratul Thakur wrote: what do i need to do..?? what might be good ways to gain more experience?? what i can do next to increase my programming experience?? Quit looking for gimmicks or "silver bullets." How do you gain experience with anything? You just get out and do it. No need to ask others. Look for problems to solve. If no problems exist, create one, then solve it. It is a never-ending process.
Prior to having kids and land to care for, I would create dozens of little side projects each week to do various things. Some were one-time apps, some were more general purpose, others were to prove a concept. The only limit is your imagination. My "Projects" folder is bottomless.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
|
DavidCrow gave awesome answer In addition you can do following things
1. try to code out projects in other languages in c++ this will give u syntactical perfection
2. figure out things around you which can be renewed using c++
3.create your own problem statement and try to solve them
4.make an excel sheet about what you have done on dayly basis
5.u can do any thing if u decide
6.give yourself exposure in market by talking about c++ in Fouroms
best of luck find your way to success
|
|
|
|
|
Usually it is quite the opposite: C++ masters you.
|
|
|
|
|
Make your hands dirty by entering into solving some problems
|
|
|
|
|
Function containing for are not expected inline
|
|
|
|
|
|
Hi
The Win32 OWNERDRAWITEM is handled by WS_DRAWITEM in the form of wParam lParam message
While framework virtual function CStatic::DrawItem takes a LPDRAWITEMSTRUCT for a parameter
Am I missing something ?
|
|
|
|
|
That seems right, that kind of thing is common in MFC. In this case the lParam would need to be cast to a LPDRAWITEMSTRUCT. In MFC you don't need the cast, it's actually pretty similar.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Doi need a message map entry to get my CStatic::DrawItem to be called I have SS_OWNERDRAW but it is not being called
|
|
|
|
|
Are WS_VISIBLE and WS_CHILD styles set?
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Just came back home yes both are set do I need to subclass the Static control
|
|
|
|
|
Yes, I believe so.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Have to Use Create DDX_Control wont do it
As aside what is the best tool to draw a nice bitmap of Text
|
|
|
|
|
How did you set SS_OWNERDRAW if you did it by PreSubclassWindow in MFC there is a big gotcha with Static Text.
ModifyStyle(0, SS_OWNERDRAW);
ModifyStyle(SS_TYPEMASK, SS_OWNERDRAW);
If you look at the bit field assignments you will see why you have to mask because unlike buttons with SS_OWNERDRAW there is overlap in bits between SS_RIGHT of static text and SS_OWNERDRAW.
In vino veritas
|
|
|
|
|
I set it in my resource file just SS_OWNERDRAW WS_CHILD WS_VISIBLE I tried many methods including SETBITMAP to display the bitmap nothing worked until I used Create and Drawitem
|
|
|
|
|
I use the bellow code to read binary file but it throws an exceptions at run time and sometimes gives a wrong results , please tell me what's the wrong ?
#include <stdio.h>
#include <stdlib.h>
unsigned long size,n;
int main()
{
unsigned char *buf;
FILE* fp;
fp=fopen ("myfile.bin","rb");
if (fp == NULL) {
fprintf(stderr, "Can't open the file");
exit(1);}
fseek (fp,0,SEEK_END);
size=ftell (fp);
fseek (fp,0,SEEK_SET);
if ((buf=(unsigned char*) malloc (size+1))==0)
printf("\n%s","allocation Error");
n=fread (buf,sizeof (buf),size,fp);
printf ("\n%02x %lu bytes read",buf[15],n);
free (buf);
fclose (fp);
return 0;
}
modified 11-Aug-16 16:40pm.
|
|
|
|