|
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
|
|
|
|
|
Why dont you just use IE's DOM ? It can read/write all supported formats. Granted, text manipulation might be a bit trickier, but possible.
Finally moved to Brazil
|
|
|
|
|
|
Good luck. I think you'll have to parse a little of the HTML and figure out the encoding from it by looking at, say the meta charset tag. I doubt you'll find anything aside from a full-blown HTML parser.
That being said, wxWindows[^] does have an HTML view, and they render the HTML themselves. Which means the code you are after is probably in there somewhere.
If your nose runs and your feet smell, then you're built upside down.
|
|
|
|
|
|
|
Hi,
I get the error " Cannot add new member" whenever i try to add a button on control.
what should I do to get rid of it?
Deepak Samuel
|
|
|
|
|
Recheck source code. Maybe you've already added a member variable that corresponds to that particular control and its ID.
Kuphryn
|
|
|
|
|
I had created a "CHAT APPLICATION". Can i change the title name
Client Chat (If no user is logged on and after logged off) to username 's Chat. If username is say X X's Chat
|
|
|
|
|
You need to call SetWindowText from without your app's main window, giving your demanded string as parameter ... in your case the username. This changes the title directly after being called.
We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve
|
|
|
|