|
I would still have the problem of setting separate address bits, however your example would make a good compact bitfield definition.
I am trying to take bits from separate registers and create my own 'masked register' so when I write to my register it sends each bit to its specified bits in other registers.
test.b0 = SBIT(0xE2, 0);
test.b1 = SBIT(0xE2, 4);
test.b2 = SBIT(0xE2, 7);
test.b3 = SBIT(0xEF, 2);
test.b4 = SBIT(0xEF, 3);
test.b5 = SBIT(0x07, 1);
test.b6 = SBIT(0x07, 5);
test.b7 = SBIT(0x07, 6);
Hopefully this will show more clearly what I am after:
test = 0x7A;
|
|
|
|
|
Hi All
If I can delete a memory using delete keyword for memory allocated on heap using new keyword.
class A
{
} ;
A &a1 = * (new A ) ;
How to release memory which is holded by a reference.
|
|
|
|
|
This looks very ugly. Why do you need to have something like that ? I guess you need to revise your design a bit.
Anyway, did you try to delete the address of the reference: delete &a1; ? I never done this myself so I don't know if this works but it looks like the obvious solution.
|
|
|
|
|
delete &a1 is exactly what he has to do. It works perfectly.
It may sound unorthodox, but depends how a1 is used: if a1 participate into arithmetic expression of overloaded operators inside generic code, it cannot be a pointer, and *a1 may be not suitable for template function expecting references.
Generic programming changes a lot the "traditional rules".
(Note: you can also have a nullable reference as *(A*)0 that can be checked as !&a ).
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
|
Hi all,
i have an long string which displayed in Static text control but its not fully displayed,i want to display it in muliline if string is too long and not contain any new line or space.
please help me for this.
thanks in advance.
|
|
|
|
|
The default property of a 'static control' is to support text wrapping. Set the 'No Wrap' property to 'False' if it is set as True by mistake.
|
|
|
|
|
|
Ok, what about resizing the static control at run time, according to the text length ?
|
|
|
|
|
Without spaces text will not wrap in a static control.
You will have to do it yourself by inserting a newline or space at the appropriate place.
The NoWrap property is to tell the static control not to wrap the text even if there is a space or newline character in the text.
I would recommend you use an edit control instead.
Set its Auto HScroll property to False , Read Only to True and Border to False to get a similar visual effect as that of a static control.
Setting Auto HScroll to False will wrap the text even if there is no space or newline characters.
The only difference is that, in a static control you cannot select text and in an edit control you will be able to select text using the mouse.
Also for a static control you can set the text from the property window, while you cannot for an edit control. You will need to use the SetWindowText API to set the text for an edit control.
|
|
|
|
|
To insert newline at apropriate place in string, he can use GetTextMetrics(), and insert '\n' at every (staticCtrlWidth/textMatrics.tmAveCharWidth) position of string. Or any other way?
|
|
|
|
|
That can be done, but the output of a string like "iiiiiiiiiiiiiiWWWWWWWWWWWWWWW" would not be as expected.
|
|
|
|
|
Yes.. average character width makes the problem. Need to track the extend of each character, and apropriately insert the '\n'.
|
|
|
|
|
Hi,
How can I set bitmap or image on CDateTimeCtrl on updown button?
|
|
|
|
|
I am reading id3v2 frame headers from an MP3 file. I am able to read some headers correctly. I read that the frame header TLEN has the total length of the file in milliseconds. The problem is that I have encountered some MP3 files which do not have this frame header "TLEN". I have used Groove Hex editor to check and they are all true. How do I calculate the total length of the file if it does not have the TLEN frame header?
|
|
|
|
|
Me think that the TLEN tag is only informative (option) and not essential. so you will have to find your track lenght somewhere else (probably decode and check the header frame
see this : MPEG Audio Frame Header[^]
M.
Watched code never compiles.
|
|
|
|
|
As Maximilien suggested, to decode and get the duration, render the file using DirectShow, IGraphBuilder::RenderFile(). Obtain IMediaSeeking interface and call GetDuration(). That wil give you the correct duration.
|
|
|
|
|
I am not programming in directshow but I am doing it in C. I want to understand it well so I don't want to use a library.
|
|
|
|
|
well.. if you are programming in C for windows, still you can use directshow, its a part of windows sdk now. Only need to know the usage of COM.
|
|
|
|
|
Hi all,
apologize if this is not right fourm to post this question.
i am really curious to know how we(our program) can mointor the network connections ?
say Zonealram will mointor all the network connection that are getting(incoming/outgoing) how this can be done ? any one if they can share there ideas will be great.
i googled it but i didnt find relavent info so thought of asking experts .
Thanks in advance.
|
|
|
|
|
One thought would be to use the ISensNetwork interface.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
if you are a firewall, you see all network packets that have your IP address as a source or destination, so by watching traffic you can build a list of all other IP addresses of interest.
|
|
|
|
|
Hi Luc, Thanks for your reply.
|
|
|
|
|
Hi All,
I am getting a CString variable which has a value like this
str = "ABCD\tEFGH\tIJKL\tMNOP\nQRST"
I have to process all these tab and newline before sending this CString variable to to 3rd party function.
Example:
This is what I receive:
str = "ABCD\tEFGH\tIJKL\tMNOP\nQRST"
I have send this str like this to the 3rd party function:
str = "ABCD EFGH IJKL MNOP
QRST"
Please give your suggestions.
Thanks,
Joseph
|
|
|
|