|
"One idea could be to try to find all CHARFORMAT PARAFORMAT or CHARFORMAT2 PARAFORMAT2 structures and modify their dwMask member. That would give you some control over what is changed."
???, it would only give it control if that CHARFORMAT was being selected into the A CRichEditCtrl.
dwMask should always be filled with all bit flags even if you're not using them,
CHARFORMAT cf;
cf.dwMask = CFM_COLOR | CFM_FACE | CFM_SIZE | CFM_BOLD | CFM_ITALIC | CFM_STRIKEOUT | CFM_UNDERLINE;
or the RTF box will inherit properties from the last CHARFORMAT that was selected into it, or default if none.
having all bitwise flags on dwMask then setting dwEffects to 0 like hmmm...( cf.dwEffects = 0; ) will kill all previous styles of the RTF selected font
This ensures that no other previous styles are lingering.
Alternatively, if you never change the font and are just using the RTF box because it has an autoscroll and CEdit doesn't, you can use SetFont(&CFont, TRUE), then you don't have to worry about all that crap.
hey
|
|
|
|
|
Yes, you are talking about CRichEditCtrl and I am not. Maybe I should start using CRichEditCtrl...
jhaga
CodeProject House, Paul Watson wrote:
...and the roar of John Simmons own personal Nascar in the garage. Meg flitting about taking photos.Chris having an heated arguement with Colin Davies and .S.Rod. over egian values. Nish manically typing *censur*. Duncan racing around after his pet *c.* Michael Martin and Bryce loudly yelling *c.* C.G. having a fit as Roger Wright loads up *c.* . Anna waving her *c.* and Deb scoffing chocolates in the corner.
...Good heavens!
|
|
|
|
|
I'd like to create an installation file for my
application that could install all DLLs required
by my app.
I'he seen that "Depends" tool (Visual Studio Tool)
shows all DLLS used by the application...
but... how can I discriminate DLLs that are alway
installed by the OS and other DLLs (not always installed)??
Thanks a lot !!!
|
|
|
|
|
Anonymous wrote:
but... how can I discriminate DLLs that are alway
installed by the OS and other DLLs (not always installed)??
Check MSDN and/or look at the property page for the DLL in question. If it's a MS DLL, look at the "Product Name" section and if it's an OS DLL you should see something like "Microsoft(R) Windows (R) 2000 Operating System" for its value.
Of course, you'll still have to worry about versioning info - that's where MSDN is extremely useful.
This was tested with Win2K using gdi32.dll btw.
Jeremy Falcon
|
|
|
|
|
I'm trying to create a vertical rebar.
I write something like this:
my_rebar.Create(this,RBS_BANDBORDERS|CCS_VERT,WS_CHILD|WS_VISIBLE|<br />
WS_CLIPSIBLINGS|WS_CLIPCHILDREN|CBRS_LEFT);<br />
my_rebar.AddBar(&my_toolbar);
But my rebar looks very strange.
Could you help me?
Please!!!
|
|
|
|
|
Hi,
I have a dialog in which I overloaded the OnSize method. I want to make my dialog to have some minimum dimensions so that the user couldn't resize the dialog past these dimensions. I've tried something like this but the dialog can be resized:
MyDialog::OnSize (UINT nType, int cx, int cy) {
if (cx < MyCx || cy < MyCy) // if the new cx is smaller than the minimum
// MyCx there should be no resizing
return;
// normal resizing procedures...
}
Any ideas?
Thanks.
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
Check out WM_GETMINMAXINFO - handling this message lets you set the minimum and maximum sizes of the dialog. Note that to get the message to appear in ClassWizard, you need to go to the Class Info tab, and set the Message Filter to "Window"
|
|
|
|
|
hello
i create a vector where i store the random number but when i compile it use only the last couple of number that had generated by random.
where is the problem ,is that the vector don't work or it don't store the firsts numbers or it's me who don't well use the vector?????
void foufou::CreateCharacter(int amount) <br />
{ <br />
int randomX =0,randomY =0,randomZ =0; <br />
<br />
foufou *PtrCreat; <br />
<br />
for(int i=0;i<amount;i++) <br />
{ <br />
PtrCreat = new foufou();
VectorOfCharacter.push_back(PtrCreat); <br />
<br />
initPosX = ( ( 1 + rand( ) % 120) - 70 ); <br />
initPosY = ( ( 1 + rand( ) % 120 ) - 70 ); <br />
<br />
<br />
<br />
<br />
NumCharacter++; <br />
} <br />
<br />
} <br />
<br />
<br />
<br />
<br />
<br />
void foufou:rawCharacterOnInitSimulation() <br />
{ <br />
<br />
for(int i=0 ;i<VectorOfCharacter.size() ;i++) <br />
{ <br />
<br />
DrawCreatedCharacter(VectorOfCharacter[i]->initPosX, VectorOfCharacter[i]->initPosY); <br />
<br />
} <br />
<br />
<br />
<br />
} <br />
<br />
|
|
|
|
|
The code in you posted is incomplete. The program wants to access initPosX and initPosY; however, nowhere in the code does the program initializes those public member variables with the random numbers.
Kuphryn
|
|
|
|
|
i have initialise them with the random funtion
<br />
initPosX = ( ( 1 + rand( ) % 120) - 70 );<br />
initPosY = ( ( 1 + rand( ) % 120 ) - 70 );<br />
i don't know if i realy store the initPosX,initPosY in the vector or no?
and why it's use only the last number stored,because i generate 5 time initPosX,initPosY ,and it's use the numbers genertaed for fifth time.
|
|
|
|
|
PtrCreat = new foufou;
PtrCreat->initPosX = 0;
PtrCreat->initPosY = 0;
VectorOfCharacter.push_back(PtrCreat);
Kuphryn
|
|
|
|
|
I have a C++ framework [^]I have been working on.
I have gotten a fair amount of interest from developers in other countries (quite a few from Brazil, for whatever reason), and have
frequently been asked about i18n and l10n support.
At this point there is no support for it in the framework proper (other than a largely empty, and non-functional, Locales class).
However I would appreciate peoples advice/thoughts/comments on how
approach adding support for in my library.
My thinking at the momement is this:
it seems to me I can add this support in 1 of 3 ways
1) use the IOStream and the std::facet and std::locale classes
pros: part of the standard C++ Lib, and thus fits with everything else (sort of)
cons: kind of wanky to understand, not widely used (or understood either, from what I can tell), and it appears that the implementation of it varies widely on the STL implementations. For example in the VC6 version of STL you have to use weird macros to deal with the facet classes (instead of having implemented has_facet() they have you use a macro _HAS). In STLPort I read in one of the forums that there were bugs in the implementation of some of the classes (don't remember which at the time) that make using it kind of iffy.
2) use IBM's oss ICU[^] Library which seem VERY feature complete
pros: has alot of features, and seems generally to have been quite well thought out. Supports everything it would seem you'd want or need in this sort of library.
cons: It's huge, and hard to "break" apart, plus it has anumber of duplicate features in it. For example, it has it's own thread support package. Also not entirely sure how to integrate it
3) Use a peer approach. Define an interface ( or series of interfaces) that encapsulate the functionality that is needed, then implement each for the platform being ported to, as most of the major platforms seem to have support for this built in. For example, Windows (Win32), MacOSX, and Linux all have support for message catalogs, as well as varying degrees of Unicode conversion (Win32 and MacOSX are complete in this aspect, with Linux so-so, AFAIK), and also have support for stuff like collating, etc.
pros : takes advantage of the native platform, where it makes sense. A default implementation could even make use of the ICU library mentioned above, simply forwarding the various calls along to it. This also makes it "easier" in terms of integration into my framework.
cons: ??? not sure there's any?
At the momement I am leaning towards option 3. If I do this it seems to me that the major things I need to provide support for are:
translating strings from ascii to Unicode (and vice-versa), and allowing this to work with different code pages
have a standard string class that is Unicode based (in terms of it's internal data) and have a super set of functionality of the std::basic_string<> class
allow for conversion to and from a number of different formats, such as numerical data, currency, time, dates, etc, to a string value (that is internally Unicode)
allow for collation of strings (i.e. comparing string A is less than, great than, or equal to string B)
meesage catalogs, the ability to request an identifier for a string be matched to a localized string value consistent with the current locale for the program
identify and setting the current locale of the program, on at least a process level, and perhaps by thread.
Am I missing anything here?
Doea anyone have any experience with this? Any comments or suggestions, particularly if you have used ICU or some other i18n lib.
Thanks
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
|
|
|
|
|
I18n is not a big package. It is a standard to retrieve language dependent resources. It works always the same way to retrieve e.g. a string resource from your program. If You have set a language on program startup the corresponding resource dll which the translated resources is loaded. The dlls are located according to I18n in the en,de,us,... directories below your .dll,.exe which is translated. I18n only helps You to find the proper dll for the currently selected language. Normally there is a global resource handle defined e.g.
HANDLE g_inst = 0;
If your application now does sth like CString str; str.LoadString(IDS_NAME);
Your LoadString implementation has to use the g_inst handle and all is fine.
If no translated resource exists you always have the fallback of your internal resources which you did include in the dll,.exe at compile time. You only have to use the current module handle thats all I think.
|
|
|
|
|
Sorry, perhaps my issues weren't made clear.
I am looking to implement i18n and l10n in a cross platform C++ framework. Not MFC and not just for windows (if that were the case it would be a non-issue).
My questions are more along the lines of what do I need specifiy in terms of an interface (or interfaces) to provide this kind of support
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
|
|
|
|
|
i want to know how many bytes have been sent while i'm send something,so that i can control a progressbar to show the progress.how can i do it?(i'm using SDK)
modified 1-May-21 21:01pm.
|
|
|
|
|
WSASend() and send() winsock API returns the actual number of bytes sent.
Kuphryn
|
|
|
|
|
Hi.......I want to save desktop's image in 256 colour settings programatically. Actually I have done it but some colour loss is there. So please let me know some idea or some piece of code through which I can save image as it actual looks like.
Thanks a lot.
C.R.Naik
|
|
|
|
|
Does this article help any?
http://flounder.com/screencapture.htm
|
|
|
|
|
Thanks for you support.....
This is not a perfect solution for me because I want to save image as bitmap file and particularly for 256 colour image. Currently I can do it but some colour loss is there.
Thanks again
C.R.Naik
|
|
|
|
|
Please help!! When I stop my application (appl1.exe), the process appl1.exe is not killed. Bellow is the loop that causes this problem.
for(;;){
Sleep(100);//pour alléger le CPU
DoEvents();
if (Playing==FALSE)
{
Playing=TRUE;
break;
} //end if
}// end for
where:
void DoEvents(void)
{
MSG msg;
while(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
Thank you very much in advance.
Zakaria
azakaria_2000@voila.fr
|
|
|
|
|
Have you initialised and set Playing correctly? If it isn't set to FALSE, then the for loop will never break.
|
|
|
|
|
Thanks a lot!! You are right!!
|
|
|
|
|
hi
i'm creating a new dialog box when a user clicks a button om my existing dialog, using code:
CDialog *cd = new CDialog(IDD_SHOW);
cd->DoModal(); //displayed modally
delete cd;
how do i set text in an edit box in the dialog box IDD_SHOW
(the id of editbox id IDC_E_DATA.)
|
|
|
|
|
GetDlgItem( IDC_E_DATA)->SetWindowText("text");
NHM
|
|
|
|
|
You have to make your own class derived from CDialog: when you have your resource editor open, open classWizzard and it will says that IDD_SHOW is a new resource and if you want to create a new class for it. Say yes and specify your class name (CMyDialog for example).
Click on the member variable tab and add a member variable for your edit box (IDC_E_DATA) of type CString (says m_MyString).
Then you have to add a public member function within your class to set the string:
CMyDialog::SetStringData(CString NewString)
{
m_MyString = NewString;
}
Then, in your OnInitDialog function, call UpdateData(FALSE);
Thats it, hope this helps
Cédric Moonen
|
|
|
|