|
Sakthiu wrote: How Can i Do Windows Services program?. So that my application starts when system turns "ON".
You do not have to create a service to accomplish this goal.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I made a dialog application that draws text into the window using the device context:
CDC* pCD = GetDC();
pCD->TextOut(x, y, "some text I want to print");
I also made an option in which you can change the font. But you choose the print preview it is all messed up. Depending on what font size you choose it shows the letters overlapping each other or too far away from each other in the print preview.
Anyway to fix this?
This is how it looks like in the print preview depending on font size chosen:
http://www3.shrani.si/o.php?printpre951564.jpg
|
|
|
|
|
It seems I need some sort of ratio conversion between logical and physical pixel inside OnPrepareDC. I just can't figure out how to do this. Can anyone help me please?
|
|
|
|
|
Hi,
I am doing an sdi application with different views .In one of the form view i placed a list control.How can i color the list control header.
Thanks,
Radhika.
|
|
|
|
|
radhika28 wrote: I am doing an sdi application with different views .In one of the form view i placed a list control.How can i color the list control header.
You can ownerdraw the header control. But before that you must subclass the header control.
First get the header control and subclass it. Use CListCtrl::GetHeaderCtrl() for this purpose.
Read this[^] for more info.
|
|
|
|
|
Create customized HeaderCtrl class Say MyHeaderCtrl then create a member variable of this is in class of Listcontrol ,Then override the InsertColumn(...) there do the following code
InsertColumn(...)
{
CListCtrl::InsertColumn(...)
CHeaderCtrl *pHeaderCtrl = GetHeaderCtrl();
if(( 0 != pHeaderCtrl ) && ( FALSE != IsWindow( pHeaderCtrl->GetSafeHwnd())))
{
HeaderCtrl.SubclassWindow( pHeaderCtrl->GetSafeHwnd()); // HeaderCtrl is the member variable of type MyHeaderCtrl
}
........
}
|
|
|
|
|
How can i get HPALLETE from CPalette Object?
Best Regards.
MJM.
|
|
|
|
|
CPalette::GetSafeHandle();
nave
|
|
|
|
|
mostafa_pasha wrote: How can i get HPALLETE from CPalette Object?
CPalette cpPalette;
HPALETTE hPalette = cpPalette;
|
|
|
|
|
I'm working on a project where the settings will be stored to and loaded from a file on disk. The registry is unsuitable since I want these settings to be distributable and easy to be modified by a user.
I have worked with INI files many times and found them to be suitable for very simple data (like the registry), also they are easy to read (by eye) and edit. However I have noticed that quite a few apps these days are using XML files. I have never used them in an app before but it looks simple enough. So I was wondering what other coders would prefer to use, especially for the type of app as described above.
|
|
|
|
|
INI files are arguably more human readable, but an XML file is able to describe things better and is less prone to typos. If someone makes a mistake with an XML config, odds are it just won't load.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Wow, "... and the medal for fastest response..."
The files I am going to create will be a set of rules for a game. Since the game would eventualy be Multiplayer, it is important to quickly be able to share the same set of rules. I'm tempted to go with XML simply because I didn't do it before.
|
|
|
|
|
Christian Graus wrote: If someone makes a mistake with an XML config, odds are it just won't load.
The same holds true for .ini files.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
What he means is that it will fail to parse. An INI file will still load, but you will get invalid data back when calling GetProfileString/Int/etc at some point.
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
|
|
|
|
|
Typically, I would use XML. I used INI before but in some case it is quite limited.
I use a nice library, it's called tinyXML[^]
|
|
|
|
|
Thanks for the link. I was tempted to go with one those here on CP, but since this one comes recommended, and it's on SourceForge (always a good sign) I will use this one.
|
|
|
|
|
I agree with Cedric XML is better
|
|
|
|
|
waldermort wrote: I was tempted to go with one those here on CP, but
are you saying that CPians are not recommandable ?
|
|
|
|
|
INI is old and outdated, but is useful for simple data (strings, integers).
XML is expensive to parse, but does offer the ability to do preliminary type-checking during the parse, as well as schema validation. This is very useful for complex data types.
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
|
|
|
|
|
how can i search from CEdit to a database ?
i have CDialog base aplication i use 3 CEdit controls .
Database : Visualfoxpro 6.0 on ODBC name : "name".(1 table , 3 columns)
all i want is to find if the txt from CEdit1 match the txt from database , and if is , the answer i need in CEdit 2 .
ex:
Database table
database type : snapshot.
----------------------------------
| names | city | country |
__________________________________
|george|london | england |
|michael|paris |france |
__________________________________
CEdit1 m_edit1
CEdit2 m_edit2
i write : "george" in m_edit1 and i need "london" in m_edit2.
i have onchange on m_edit1.
please help me !
thank you in advance !
Bravoone
|
|
|
|
|
Flaviu_2006 wrote: how can i search from CEdit to a database ?
1)Read the string from CEdit using the GetWindowText.
2) Read the entries from the database.
3) Compare both these values.
if these values match do something...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
i have try this :
CString sEdit1,sEdit2;
m_edit1.GetWindowText(sEdit1);
CDatabase_Name* pName = new CDatabase_Name();
if(sEdit1 == pName->m_name)
{
m_edit2.SetWindowText(pName->m_city);
}
yes it works but i have 260.000 records and i have to wait about 6 min. to have an answer !!!!!!
can you help me !
please an example !
Bravoone
|
|
|
|
|
See what just Christian Graus said. You can search for the string in the database that is in the edit box, Create a database query and then fire it...
Thanks...Christian. I just missed that point...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
how ? i dont have that information !
can you help me , please man !
Bravoone
|
|
|
|
|
_AnShUmAn_ wrote: 2) Read the entries from the database.
3) Compare both these values.
if these values match do something...
This would require reading all rows from the table. Yuck!
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|