|
Hi there:
Is there anyone out there with any experience with groupware? If they have, Which one? and Do they think it might work for a software co-operative? This is an intranet type of software with PIM integrated into it.
J.
----------------------------
|
|
|
|
|
Exchange works pretty well. I (much) prefer it over Lotus Notes.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
Hi all,
I am getting problem with CRichEdit control.
I am writing what I am getting.
I have changed the para formatting by using this code
PARAFORMAT pf;<br />
pf.cbSize = sizeof(PARAFORMAT);<br />
pf.dwMask = PFM_ALIGNMENT;<br />
pf.wAlignment = PFA_LEFT;<br />
m_RE_Output.SetParaFormat(pf);
Then I have changed the para formatting by using this code
PARAFORMAT pf;<br />
pf.cbSize = sizeof(PARAFORMAT);<br />
pf.dwMask = PFM_ALIGNMENT;<br />
pf.wAlignment = PFA_RIGHT;<br />
m_RE_Output.SetParaFormat(pf);
This is what I was doing is a normal code.
Now the problem beings when I place the cursor in the RichEdit and place some more text the formatting changes, I mean the left goes right and the right remains at right as it should.
I donot know why the CRichEdit behaves like this.
Thanks.
Help greatly appreciated.
The Phantom
|
|
|
|
|
Hi,
I am thinking of making the transition from using the Windows API SDK with mostly C to MFC - well, more than just thinking, I really want to do it. I have been using the Windows API and learning C with a modicum of C++ for the past couple of years, and have created several small programs (with a lot of help from the kind people here), but now I want to take it a stage further. I have an idea for a Windows program that I'd like to make as professional as possible with a nice GUI, and I think that MFC is the way to go for two reasons:
Firstly, given that my program is designed to look a little like a cross between Explorer and a word processor, with a tree view on the left and a rich edit box on the right in a dockable window, I can easily generate the basic GUI of my program using appwizard.
Secondly, there are a lot more code examples, both here and elsewhere, that would be very useful for my program that use MFC than the SDK, and so far I have spent a lot of unnecessary time struggling to convert code from MFC to straight C/WinAPI.
That's the waffle over, then. Considering that I learn much more easily if I am motivated by a goal (in the case the goal is the software I want to write) rather than by following dry tutorials which teach me how to write small programs I'll never use, I'd really appreciate some tips or advice on where to start with making this transition:
1) I know this is a question that comes up a lot, but what books would people recommend to help me make this transition? Before you shout: I have searched this forum, the FAQ and elsewhere, and the two books that seem to come up the most are Richard Jones's 'Introduction to MFC Programming', and Jeff Prosise's 'Programming Windows with MFC'. I am thinking of buying the Jones, because I am not very familiar with OOP and this is supposed to be easier as an introduction. Is this a good way to go? Or are there other books I may have missed?
2) I am guessing that in order to learn MFC I am going to need to improve my knowledge of C++ drastically - like I say, aside from some limited use of classes, I have mostly used straight C so far. I have the SAMs book by Jesse Liberty, which I am returning to right now, as well as other books which are way out of my league (I don't think I've ever opened my Stroustrup ). Should I learn more C++ before turning to MFC? Or can I learn what I need to know about classes and OOP as I go along whilst learning MFC? And if so, are the books above helpful for this too?
3) As a quick test, I tried using the MFC appwizard to create a program with the sort of GUI I want for my app. Within a few clicks, voila, I had a GUI that I loved. But when I opened up the CPP files I was terrified - I couldn't believe how alien it all was compared to a simple SDK program. How easy or difficult have other people found the transition from the SDK to MFC, if you've made it?
And finally, two stupid(er) questions:
4) Not really an MFC question, but...: In an application that is NOT dialog-based, is it okay (ie. good practise) to mix it up with lots of dialogs created in the resource editor? Eg. Say you have a menu in a non-dialog app but use it to call dialogs. I thoroughly expect the answer to this to be, "Duh, yes, of course, it's pretty much the same thing anyway," but I just wanted to double-check as it's something I do a lot with the SDK.
5) Is there a very simple example of a text editor using MFC available? I ask this as a final thought, before searching, so if this is the sort of thing I will turn up straight away on a search, ignore it. It just occurred to me that I might be able to learn quite a bit from such an example.
Please bear in mind that programming isn't my career path (I'm on my belated way to becoming a teacher) and thus I don't have the same amount of time that a professional, or someone younger, might have to research and learn everything in detail, so I would greatly value the input and advice of the experienced programmers here.
Thank you for any input,
KB
|
|
|
|
|
- I strongly recommend Prosise's book.
- Should I learn more C++ before turning to MFC?
That's exactly what I did several years back. I started creating a few (non-GUI) classes and used them in my Win32 apps. You don't have to be a C++ expert to use MFC, but it's helpful to know the fundamentals. It can save you a lot of head scratching!
- I couldn't believe how alien it all was compared to a simple SDK program
Don't worry, we've all been there. You'll soon get over it as you start modifying the code the app wizards create for you. Remember, the unknown is usually almost always daunting.
- simple example of a text editor using MFC
You could brew your own by creating an SDI app whose view class is a CEditView . Good luck and have fun!
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thank you for your reply, it's very encouraging. At first I was scratching my head to your answer to question 4, before I realised that SDI is just "Single Document Interface" (as opposed to MDI) - just the terminology can be daunting at first.
Everyone seems to recommend the Prosise book, so I think I am going to splash out and buy both, so I can use Prosise's as a reference. Looking through the indexes (indices?) on Amazon.com I see that Prosise's book covers such things as RTF files and tree views, so I can turn to that once I've gone through the basics in Jones and am ready to take on the main aspects of my program.
Thinking about your reply to no. 2, I have decided to go through some C++ basics before looking at these books though. I have just bought a very nice and cheap book called "Teach Yourself C++ in 10 minutes" (somewhat ridiculously) by Jesse Liberty. I've started going through it and I really like it, as it recaps on the basics of C and then moves into very short (supposedly 10 mins each) lessons on C++ - OOP, classes, etc. I like it because it means I can grasp the bare basics of some of the C++ concepts without having to wade through 1,000 pages (nothing worse than slogging through a book and thinking "I'm not going to learn how to use a class until page 600, and I'm a slow reader..."), and I can refer to my other C++ books with a more need-to-know approach after I've got some of the concepts (and terminology - one of the problems of being self-taught) pegged.
It's very encouraging to hear that someone else has taken a similar route when learning MFC.
Thanks again,
KB
|
|
|
|
|
I have a Dialog app where I have a PropertySheet
Within this PropertySheet I have multiple pages(CpropertyPage)
it so happens that tabs 3 and 4 correspond to the same class ( say CPage3 derived from CPropertyPage).
I want to name the title on the tab to "page3" and "page4"
As of now in the resource the Dialog is named as "zombie" so both tabs show the name Zombie
I tried modifying the name using
this->SetwindowText(pageName)
but this doesnt seem to update anything !
Please help
Engineering is the effort !
|
|
|
|
|
Use the CPropertySheet::GetTabControl() to get a pointer to the tab control, then use CTabCtrl::SetItem() to set the text.
TCITEM item;
item.mask = TCIF_TEXT;
item.pszText = _T("My Page Title");
m_Sheet.GetTabControl()->SetItem(nPage, &item);
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks it works
had another question .
I need to either Disable a tab so as to prohibit the user from entering that page
or keep the tab enabled but disable the page.
. I dont know how to do the former but i tried doing
this->showWindow(SW_HIDE) in the PropertyPage class for the latter , but didnt work
Would like to know both methods of doing it . Thanks
|
|
|
|
|
Is there a MS Word Control that I can embed inside a dialog window?
Thanks
|
|
|
|
|
You probably could by having an activeX container on your dialog.
hope this helps
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
|
Hi!
Can everybody tell me a web address or send me an actual documentation of these
active X control which can be "imported" by using windows 2000 included system file imgedit.ocx.
German Name is "Steuerelement für Bildbearbeitung".
I only got the documentation 2.6 which is very bad.
|
|
|
|
|
Hi,
I'm trying to make a soft which needs to get the precise (ms) length of ac3 files. I'm a beginner with programming and I've no idea how to do this. I tried using a DOS application (ac3dec..) but couldn't find one doing what i wanted. The deduction of audio length from file size didn't work (at all) so I don't have an idea.
The only way I found to get the audio length was to convert AC3 to WAV using azid, then to get the wav's file size to find its length (which is also the AC3's) but this takes quite a lot of time and doesn't fit my needs.
If anyone had any idea, I'd be very glad!
Pwalo.
|
|
|
|
|
I created a rectangle region with the following code
pDC->SetMapMode(MM_LOENGLISH);
pDC->Rectangle(440, -90, 640, -150);
pDC->Rectangle(440, -200, 640, -260);
pDC->Rectangle(440, -300, 640, -360);
pDC->SetTextColor(RGB(196,48,157));
pDC->TextOut(465, -105, "Player 1 Start");
pDC->TextOut(465, -215, "Player 2 Start");
pDC->TextOut(497, -315, "Be Gone");
Now i want to do an action when i hit the LButtonDown on the first rectangle. I was thinking i could use PtInRegion. but i am not able to do it. Please tell me how i can click on each rectangle and do an action.
|
|
|
|
|
The Rectangle function uses screen coordinates to define the rectangle's boundries.
So using negative numbers would cause the rectangle to be drawn outside of the display area of the DC.
If you assigned the screen coordinates to CRect objects instead of hardcoding them in your Rectangle() calls, you could then call each CRect's PtInRect() member.
|
|
|
|
|
Ok, i tried doing a CRect and created the rectangle. in the LButtonDown function i did a CRect rect(&r). then if (rect.PtInRect(point)) message. this is not working. what do i have to do?
|
|
|
|
|
Are your rectangles displaying correctly? Did you change the coordinates so they are not negative?
If you are using &r when you construct your CRect, and the rect was built using those negative numbers you had, it won't work:
<br />
RECT <br />
The RECT structure defines the coordinates of the upper-left and lower-right corners of a rectangle. <br />
<br />
typedef struct _RECT { <br />
LONG left; <br />
LONG top; <br />
LONG right; <br />
LONG bottom; <br />
} RECT; <br />
<br />
Members<br />
left <br />
Specifies the x-coordinate of the upper-left corner of the rectangle. <br />
top <br />
Specifies the y-coordinate of the upper-left corner of the rectangle. <br />
right <br />
Specifies the x-coordinate of the lower-right corner of the rectangle. <br />
bottom <br />
Specifies the y-coordinate of the lower-right corner of the rectangle. <br />
Using a negative number for any of those members will produce a rectangle that won't be correct.
|
|
|
|
|
Hi all,
I am experiencing a strange problem w/ my app.
I am using CV6.0SP5 and MFC.
I want to be notified when arrow key is pressed when a window has focus, so
I overrode OnKeydown. The window belongs to a 2nd window thread created by
the first one. The window is a Dialog based one derived by CDialog and
contains a big OCX control (about 90% the client size).
The keyboard message is sent (WM_KEYDOWN) (according to the TRACER), it is
processed by PreTranslateMessage when is lost in the MCF stack.
Do you have any idea?
Thanx a lot.
Regards,
Andrea
|
|
|
|
|
The arrow key will be eaten as part of IsDialogMessage, I think. You might need to override PreTranslateMessage for the dialog or say that your window wants arrow keys via WM_GETDLGCODE
Steve S
|
|
|
|
|
assume
float r=10.3<br />
int i=0; i have the following cases
case 1
i=10;<br />
int y = ceil(r*i) --> Gives 104 , instead of 103 which is my desired value
case 2
i=11 <br />
<code >int y=ceil(r*i) gives 114 which is what I need
say we do this
float x;
x=r*i;
// Codeproject suggestion
<br />
((int)x< ceil (x) )?(int)x:(int)x+1;
case 1 is equated as 103 < 104 ?103:104 which yields 103 , good for me
case 2 is equated as 113<114 ? 113 : 114 which is 113 what I dont need, i need 114
I tried this
float diff = x -(int)x;<br />
int y;<br />
if(diff>0.000000)<br />
y=(int)product;<br />
else <br />
y=(int)product+1;
Code never seems to enter the if case even though diff =0.000000 !
How do i solve this ?
Engineering is the effort !
|
|
|
|
|
act_x wrote:
int y = ceil(r*i) --> Gives 104 , instead of 103 which is my desired value
Perhaps the product of 'r' and 'i' is 103.000001 in memory. Floating-point numbers are not always what they seem.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Floating point is tricky indeed sometimes. What I'd say, is define your "epsilon", which will be the tolerable amount of error in your equations. So let's say the epsilon is .001, then we'll calculate the result like this:
const float fEpsilon = .999;
float y = (int)(x * r + a_fEpsilon); // int cast rounds down
So, for 10 * 10.3 we get about (103.000 + .999) which yeilds 103, and for 11 * 10.3 we get about (103.300 + .999) which yeilds 114.
The trick is to define the epsilon correctly such that (10 * 10.3 + .999) is not represented as greater than or equal to 10.4. You don't want too much precision on it and you don't want too little precision.
Also, .001 here is just a guess that made the results correct in this case, I'm not sure it will work for all other cases.
Chris Richardson
|
|
|
|
|
I'm trying the following with an MFC application (compiled in UNICODE mode, if necessary):
1. Open a local HTML document and read into memory.
2. Do some modifications to the in-memory-document (e.g. replace some strings by other strings).
3. Write the document back to disk.
Now the cavats are: The code should be able to handle documents with different character encodings, e.g. UTF-8, Windows, Cyrillic, Chinese, etc.
Question:
Is anyone aware of methods to detect the encoding and to read in the file from the encoding and convert it to in-memory unicode?
I already looked at http://oss.software.ibm.com/icu/ [^], which can do the loading, but not with auto-detected encoding.
Thanks for your help!
--
- Free Windows-based CMS: www.zeta-software.de/enu/producer/freeware/download.html
- See me: www.magerquark.de
|
|
|
|
|