|
I don't know, what is a Custom font. But generally, if you want to convert characters from Windows-125* (depending of localization of the OS) to Unicode encoding, use mbstowcs() function.
Robert-Antonio
"Love, truth and electric traction must gain victory over hate, lie and
diesel traction."
|
|
|
|
|
Thanks, I'll look that up....
What I meant by Custom font is an installed True Type font.
I have to read some data from an Excel file and write it as XML. Now the excel file uses this TTF for Devnagari Script. It contains Hindi characters. I have to convert these into Unicode if they are to be shown correctly in the XML (Or is there another way?)
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
Do you have the Devangari charset in your Windows localization?
Robert-Antonio
"Friends come and leave, but teddybears stay in forever."
|
|
|
|
|
Yes I do
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
So it's simple. If the Devangari charset is default on your system, use mbstowcs . When not, use MultiByteToWideChar , where you supply the Devangari charset codepage number. See MSDN for details about these functions.
Robert-Antonio
|
|
|
|
|
Hello:
I have MFC Dialogue based application , In the application I need to check the system time say for (12:00 AM) while the application is running , to do some code . I see that i should use worker threads , I read about it and tried to implement but with no avail.
I will wrote what i did :
in OnInitDialog()
_beginthreadex(NULL,0,myThread,NULL,0,0);
and my thread is :
UINT uCheckTime(LPVOID)
{
CCriticalSection cs;
cs.Lock();
SYSTEMTIME SystemTime;
GetSystemTime(&SystemTime);
DWORD dwHour = SystemTime.wHour + 2 ;
if(dwHour >= 13 )
{
//Do some work......
}
cs.Unlock();
return 0;
}
here this thread never fired!!
What can I do ?
Regards
|
|
|
|
|
Hi,
TRY USING AfxBeginThread function. The first parameter to this function is name of thread function in your case uCheckTime.
Hope this will help you
SUjan
|
|
|
|
|
This is because your thread function exits before the condition ins met. What I think you want to do is:
UINT myThread(LPVOID)
{
while (!ExitCondition)
{
}
} where you have an exit condition set in your dialogs OnDestroy() or something like that.
Basically, you want the thread to execute as long as your app is. Your thread as it is exits after one pass.
|
|
|
|
|
Hello,
I, in my opinion, the way to go lies here...[^]
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Hmmmm... Okay. Why is this the way to go? It looks like an interesting write up but I don't see an introductory statement explaining the purpose. Why not just use CWinThread since MFC already provides that in the library? MFC already provides interfaces for launching and managing threads using library functions.
Obviously, the original problem reported with this thread didn't have anything to do with a particular method for creating threads. It had to do with the thread function, simply being coded incorrectly. Since there was no loop, the thread would exit after one pass and it would appear to the casual observer that the thread never launched. I'm always open to new ideas but before I spend hours sorting through a long write up, it'd be nice to see a purpose statement that would entice me to believe that it is worth doing so.
|
|
|
|
|
Hello,
I'm currently working on my first multithreading application. At design stage, I spent hours looking for a simple way to manage threads. Since I don't want to stick to MFC too much, I couldn't use CWinThread.
IMHO CThread was the most complete (it even has a wizard to build your derived class) and simple class I could find.
I find my code more readable and manageble since all the thread dependant data is in one place.
Since you already solved your problem, I don't see why you should rewrite your code, but you when you work on an other multithreading application, you might find CThread as usefull as I do...
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
|
Hi
I'm a new starter of Codeproject in VC++ and working on list control. I'm very interested in the ReportControl written by BIN. I think it's useful to put it in my application. I try to add a new class with the same name with ReportCtrl class, and then copy all the line code in ReportCtrl.h, and ReportCtrl.cpp in those files of mine. After that I add a new member variable for my list control in my dialog with type CReportCtrl and I have this warning dialog: "Please ensure that XDlg contains the neccessary #include directives for using your class CReportCtrl(from the file "ReportCtrl.h" and I press OK. The member variable appears in the source code, then I compile the program. But I got these errors: :\temp\100304\1\1dlg.h(23) : error C2146: syntax error : missing ';' before identifier 'm_ctrlReport'
c:\temp\100304\1\1dlg.h(23) : error C2501: 'CReportCtrl' : missing storage-class or type specifiers
c:\temp\100304\1\1dlg.h(23) : error C2501: 'm_ctrlReport' : missing storage-class or type specifiers
1Dlg.cpp
c:\temp\100304\1\1dlg.h(23) : error C2146: syntax error : missing ';' before identifier 'm_ctrlReport'
c:\temp\100304\1\1dlg.h(23) : error C2501: 'CReportCtrl' : missing storage-class or type specifiers
c:\temp\100304\1\1dlg.h(23) : error C2501: 'm_ctrlReport' : missing storage-class or type specifiers
C:\Temp\100304\1\1Dlg.cpp(79) : error C2065: 'm_ctrlReport' : undeclared identifier
ReportCtrl.cpp
Couldyou tell me how to deal with this?
Thank you so much.
Thanks for reading!
|
|
|
|
|
add following line in 1Dlg.h
#include "ReportCtrl.h"
There is no spoon.
mail
|
|
|
|
|
Dear Friends,
I want to round the float/double value upto two decimal places and display in edit control. How can i do so.
Here is the scenario: I got an edit control on which a double variable is associated. I assign some value to this variable and call UpdateData(FALSE) . As such the edit control gets populated with the value, but value is appearing of the form 67.24678945. I want to get this value of the form 67.25 i.e rounded upto two decimal places.
Imtiaz
|
|
|
|
|
Hi,
Instead of associating a double variable with the edit control, use a CString variable. Before calling UpdateData(FALSE) use something like this strFloat.Format("%.2f", fFloatVal); where fFloatVal contains ur decimal value.
Regards,
Mahadevan
|
|
|
|
|
please please help me in this i would be greatful to you. Just reply to my mesaage leaving ur email address and i will send you the c source code which will be used in here. please help me. i am requesting you.
You are to write two classes, screen and field, representing a screen
layout and an individual field (either a label or an input region) that
appears on a screen.
The field class, which lets us display, and possibly edit, a character
string, is really intended as a base class from which we'll derive many
kinds of field (displaying/editing different kinds of data) in the
future. Because of this, and because the code for the screen class will
use the field class extensively, it is important that the screen class'
logic uses only features of the field class described below and not
extra features you may decide to add to the field class.
When instantiated a field must be passed between three and five values,
in the following order:
- required: the row on which the field is to be displayed (int)
- required: the starting column for the field (int)
- required: the field's width (int)
- optional: an initial value for the field (constant character string)
- optional: editability flag (true: editable, false: display-only)
If only three parameters are specified, the field begins empty. If fewer
than five parameters are specified, the field is editable. Note that
instantiating a field does not cause it to appear - there are member
functions (below) to do that. If the coordinates specified are not
valid, the closest on-screen coordinates to those specified are used. If
the field width is too long to fit on the screen, the width should be
reduced so that the field fits on the screen. Similarly, if the initial
value is longer than the field width, only as many characters of the
initial value as will fit are used.
A field has the following public member functions, all of which are
virtual:
void display() - causes the field to be displayed on the screen. On
systems where terminal output is buffered, this function does
not flush the screen buffer. Note that if the field's current
value is shorter than the field width, trailing spaces are
displayed to fill out the field. (Such trailing spaces are not
considered part of the data of the field, however).
int edit() - causes the field to be displayed (as in display()) and
then lets the user edit the field, using the keys just as
dt_edit() does. The key code used to terminate editing is
returned. The first time a field's edit() function is called,
the cursor is positioned at the beginning of the field.
Subsequent calls to edit() start the cursor where it left off at
the end of the previous edit() call, unless the string is now
too small (in which case the cursor is positioned just past the
end of the string).
In the case where the field is not editable, this function
simply displays the field and returns 0 without waiting for any
keystrokes.
bool editable() const - returns true if the field is editable, false
if it is display-only.
void *data() - returns the address of the string currently stored by
the field. Note that we expect that in derived classes this may
be the address of some other kind of data being edited.
field *clone() const - dynamically allocates another instance of the
field, making that field a copy of itself, and returns the
address of the copy. If a copy cannot be made, this function
returns NULL. It is the caller's responsibility to deallocate
the copy.
Since dynamic memory allocation is required to implement this properly,
the field class also has an appropriate copy constructor, = operator and
virtual destructor.
A screen manages up to 50 fields (although if you can remove this limit,
you are more than welcomed to do so). The fields are kept in order by
when they were added to the screen - the field that was added first is
known as field number 0, the field that was added next is known as field
number 1 and so on. The screen class has the following public member
functions:
int add(int, int, int) and
int add(int, int, int, const char *) and
int add(int, int, int, const char *, bool) - adds a field to the
screen, where the field added is constructed with the data
supplied to add(). These functions return the number of fields
in the screen after adding the field, or 0 if the field could
not be added for some reason.
int add(const field &f) - adds a copy of "f" to the screen,
returning the number of fields in the screen after adding the
field (or 0 if the add() failed for some reason).
void display() and
void display(bool clear) - displays all the fields managed by the
screen, in the same order that they were added to the screen. If
"clear" is specified and true, the screen is cleared before the
fields are displayed, otherwise the fields are displayed without
touching any other part of the screen. On systems that buffer
terminal output, this function does not flush the output buffer.
int edit() and
int edit(bool clear) and
int edit(int *pfield) and
int edit(int *pfield, bool clear) - Displays all the fields of the
screen (after clearing the screen if "clear" is specified and
true) and then allows the user to edit them, starting at field
number "*pfield". The user moves between fields with any of the
following keys:
Down arrow - moves to the next editable field
Up arrow - moves to the previous editable field
Tab - works just like Down Arrow
Enter - moves to the next editable field, except when pressed
in the last editable field of the screen, in which case it
causes edit() to end.
Here "next" and "previous" refer to the order in which the
fields were added to the screen. There is a wrap-around effect,
also, so the the next field after the last field is the first
field, and the previous field before the first field is the last
field.
All other keys which terminate a field's edit() function
terminate this function as well, setting "*pfield" to the number
of the field from which the user exited. The key code used to
exit the field's edit() is returned.
If "pfield" is NULL or not provided, then editing starts at the
first editable field the first time edit() is called, and
resumes at the field last exited upon subsequent calls.
If "pfield" points to an int, but that int is not the number of
en editable field, then editing begins at the next editable
field (where "next" is as defined above).
If there are no editable fields on the screen, this function
returns 0 after displaying all the fields.
field *getfield(int i) - returns the address of field numbered "i"
or NULL if "i" is not the number of a field.
int remove(int i) - removes field number "i" from the list of fields
being managed by the screen, and returns the number of fields
left on the screen after removal. If "i" is not the number of a
field, then nothing happens and the current field count is
returned.
Note that removing a field renumbers the remaining fields.
Also, the += operator can be used, with a screen on the left and a field
on the right, to add a field to a screen, returning a reference to the
screen.
Note that creating a screen, adding a field to a screen, or removing a
field from a screen causes no immediate visual effect. It is when the
screen is display()ed or edit()ed that the user sees anything.
Note also that since adding a field involves copying the field, and
since we plan to derive new types of field in the future, you must make
the copies of fields by using clone(), rather than by relying on the
copy constructor.
Since this means that your screen must use dynamic memory allocation
(clone() dynamically allocates a copy), you should be sure to code an
appropriate copy constructor, = operator and virtual destructor for the
screen class.
Both the screen class and the field class should be declared in a header
file screen.h, and coded in a source file screen.cpp. Including screen.h
should also make the dtio functions available for use.
|
|
|
|
|
|
I'd be happy to do this programming assignment for you. I can email you a .zip file containing the solution (guaranteed to work). Alternatively, you can download it from one of my password protected servers. I also provide free bug fixes for a period of upto 7 days after delivery.
My rates are as follows:- Charge for estimate (in hours) = USD 100
- Programming charges = USD 300/hr
The estimate charge will be refunded in full if you assign me the job. 50% of the payment is required up front. The balance is due on completion of the project. The full balance must be paid before I make the solution available to you.
I look forward to hearing from you!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
please please help me in this i would be greatful to you. Just reply to my mesaage leaving ur email address and i will send you the c source code which will be used in here. please help me. i am requesting you.
You are to write two classes, screen and field, representing a screen
layout and an individual field (either a label or an input region) that
appears on a screen.
The field class, which lets us display, and possibly edit, a character
string, is really intended as a base class from which we'll derive many
kinds of field (displaying/editing different kinds of data) in the
future. Because of this, and because the code for the screen class will
use the field class extensively, it is important that the screen class'
logic uses only features of the field class described below and not
extra features you may decide to add to the field class.
When instantiated a field must be passed between three and five values,
in the following order:
- required: the row on which the field is to be displayed (int)
- required: the starting column for the field (int)
- required: the field's width (int)
- optional: an initial value for the field (constant character string)
- optional: editability flag (true: editable, false: display-only)
If only three parameters are specified, the field begins empty. If fewer
than five parameters are specified, the field is editable. Note that
instantiating a field does not cause it to appear - there are member
functions (below) to do that. If the coordinates specified are not
valid, the closest on-screen coordinates to those specified are used. If
the field width is too long to fit on the screen, the width should be
reduced so that the field fits on the screen. Similarly, if the initial
value is longer than the field width, only as many characters of the
initial value as will fit are used.
A field has the following public member functions, all of which are
virtual:
void display() - causes the field to be displayed on the screen. On
systems where terminal output is buffered, this function does
not flush the screen buffer. Note that if the field's current
value is shorter than the field width, trailing spaces are
displayed to fill out the field. (Such trailing spaces are not
considered part of the data of the field, however).
int edit() - causes the field to be displayed (as in display()) and
then lets the user edit the field, using the keys just as
dt_edit() does. The key code used to terminate editing is
returned. The first time a field's edit() function is called,
the cursor is positioned at the beginning of the field.
Subsequent calls to edit() start the cursor where it left off at
the end of the previous edit() call, unless the string is now
too small (in which case the cursor is positioned just past the
end of the string).
In the case where the field is not editable, this function
simply displays the field and returns 0 without waiting for any
keystrokes.
bool editable() const - returns true if the field is editable, false
if it is display-only.
void *data() - returns the address of the string currently stored by
the field. Note that we expect that in derived classes this may
be the address of some other kind of data being edited.
field *clone() const - dynamically allocates another instance of the
field, making that field a copy of itself, and returns the
address of the copy. If a copy cannot be made, this function
returns NULL. It is the caller's responsibility to deallocate
the copy.
Since dynamic memory allocation is required to implement this properly,
the field class also has an appropriate copy constructor, = operator and
virtual destructor.
A screen manages up to 50 fields (although if you can remove this limit,
you are more than welcomed to do so). The fields are kept in order by
when they were added to the screen - the field that was added first is
known as field number 0, the field that was added next is known as field
number 1 and so on. The screen class has the following public member
functions:
int add(int, int, int) and
int add(int, int, int, const char *) and
int add(int, int, int, const char *, bool) - adds a field to the
screen, where the field added is constructed with the data
supplied to add(). These functions return the number of fields
in the screen after adding the field, or 0 if the field could
not be added for some reason.
int add(const field &f) - adds a copy of "f" to the screen,
returning the number of fields in the screen after adding the
field (or 0 if the add() failed for some reason).
void display() and
void display(bool clear) - displays all the fields managed by the
screen, in the same order that they were added to the screen. If
"clear" is specified and true, the screen is cleared before the
fields are displayed, otherwise the fields are displayed without
touching any other part of the screen. On systems that buffer
terminal output, this function does not flush the output buffer.
int edit() and
int edit(bool clear) and
int edit(int *pfield) and
int edit(int *pfield, bool clear) - Displays all the fields of the
screen (after clearing the screen if "clear" is specified and
true) and then allows the user to edit them, starting at field
number "*pfield". The user moves between fields with any of the
following keys:
Down arrow - moves to the next editable field
Up arrow - moves to the previous editable field
Tab - works just like Down Arrow
Enter - moves to the next editable field, except when pressed
in the last editable field of the screen, in which case it
causes edit() to end.
Here "next" and "previous" refer to the order in which the
fields were added to the screen. There is a wrap-around effect,
also, so the the next field after the last field is the first
field, and the previous field before the first field is the last
field.
All other keys which terminate a field's edit() function
terminate this function as well, setting "*pfield" to the number
of the field from which the user exited. The key code used to
exit the field's edit() is returned.
If "pfield" is NULL or not provided, then editing starts at the
first editable field the first time edit() is called, and
resumes at the field last exited upon subsequent calls.
If "pfield" points to an int, but that int is not the number of
en editable field, then editing begins at the next editable
field (where "next" is as defined above).
If there are no editable fields on the screen, this function
returns 0 after displaying all the fields.
field *getfield(int i) - returns the address of field numbered "i"
or NULL if "i" is not the number of a field.
int remove(int i) - removes field number "i" from the list of fields
being managed by the screen, and returns the number of fields
left on the screen after removal. If "i" is not the number of a
field, then nothing happens and the current field count is
returned.
Note that removing a field renumbers the remaining fields.
Also, the += operator can be used, with a screen on the left and a field
on the right, to add a field to a screen, returning a reference to the
screen.
Note that creating a screen, adding a field to a screen, or removing a
field from a screen causes no immediate visual effect. It is when the
screen is display()ed or edit()ed that the user sees anything.
Note also that since adding a field involves copying the field, and
since we plan to derive new types of field in the future, you must make
the copies of fields by using clone(), rather than by relying on the
copy constructor.
Since this means that your screen must use dynamic memory allocation
(clone() dynamically allocates a copy), you should be sure to code an
appropriate copy constructor, = operator and virtual destructor for the
screen class.
Both the screen class and the field class should be declared in a header
file screen.h, and coded in a source file screen.cpp. Including screen.h
should also make the dtio functions available for use.
|
|
|
|
|
http://www.codeproject.com/dialog/xgui-extension.asp[^]
Just curious ( neato, when I pasted the link it automatically generated a clikety, how cool )
The gradient to the left...how is that generated???
I've noticed that the top left (in photoshop) is always white and the bottom right is always black, the top right is what appears to be the color which is selected in the skinny vertical color picker region.
Is that big color gradient just a normal gradient painted at a 45 degree angle???
Hope I make sense...
Cheers
How do I print my voice mail?
|
|
|
|
|
Hockey wrote:
The gradient to the left...how is that generated???
Like this...
Assume:
x = 0 to Xmax (starting at left-hand side)
y = 0 to Ymax (starting at top side)
Rc = Red value of the top-right corner
Gc = Green value of the top-right corner
Bc = Blue value of the top-right corner
R(x,y) = (Rc + (255 - Rc) * (Xmax - x) / Xmax) * (Ymax - y) / Ymax
G(x,y) = (Gc + (255 - Gc) * (Xmax - x) / Xmax) * (Ymax - y) / Ymax
B(x,y) = (Bc + (255 - Bc) * (Xmax - x) / Xmax) * (Ymax - y) / Ymax
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I do believe that is what I wanted
Thanks a bunch
How do I print my voice mail?
|
|
|
|
|
i need to create a resource that will spell check in my local from microsoft word not a standalone.
does anybody have ideas as i am relatively new to c++. ese pupo! = thanks so much!
larry_larry
|
|
|
|
|
Lanre Ogunkola wrote:
...spell check in my local from microsoft word...
What does this mean?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|