|
Hi I have small problem with edit box.
my code snippet is given below
exdefvalues.Format(" Hytec at %d\n, Telefunken at %d\n, Left Scaler at %d\n, Right Scaler at %d\n, Base : %d ms\n, Divider : %d, Microcycles : %d\n",hytec,telefunken,leftscaler,rightscaler,Base, Divider,microcycles);
pEdit->SetWindowText(exdefvalues);
I include the "\n" to get the next part in the next line but I dont get it ,it continues on the same line in the edit box..
Any Remedies?
Thanks
Deepak Samuel
|
|
|
|
|
|
Also make sure that the control has the ES_MULTILINE style.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I write small SWF-player. When I parse a SWF format,I need to do the bitwise shift the buffer of
variable lenght of bytes - 8,9... etc, so I can't use common bitwise
shift operators (<< and >>). How I can do this?
Thanks a lot!
Slava Archibasoff
3admin@rambler.ru
|
|
|
|
|
I don't understand the dilemma. You want to shift a certain number of bytes but cannot use << and >> to do so. Why?
buffer << 8;
buffer << 24;
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Well, this is may be problem with my English.
The task is like this:
I have buffer:
byte*buffer=new byte[n];
If I'll write
*buffer << 1,
I'll get only first byte of the buffer ( buffer[0] ) shifted.
The question is - how to shift buffer of variable lenght of bytes on
some bits?
Thanks.
|
|
|
|
|
Slava Archibasov wrote:
*buffer << 1,
I'll get only first byte of the buffer ( buffer[0] ) shifted.
Right, that's what it is supposed to do. I get the impression that what you really want to use is strcpy() or memcpy() to do the "shifting." For example:
byte *buffer = new byte[16];
strcpy(buffer, "Apple");
cout << buffer << endl;
memcpy(&buffer[1], &buffer[0], 5);
cout << buffer << endl;
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Ok, You show how to shift the buffer on one byte ( 8 bits) to the right.
I need to get shifted the whole buffer ( byte *buffer = new byte[16] ) on
one BIT to the right. That's the question.
Thanks
Slava Archibasov
3admin@rambler.ru
|
|
|
|
|
I need to get shifted the whole buffer...
Look closer. All five bytes (the third parameter to memcpy() ) of the buffer were shifted to the right.
...one BIT to the right.
Which bit of which byte are you interested in? The buffer is comprised of several bytes (16 in my example), each of which has 8 bits.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I have a DBTIMESTAMP variable representing a modification0date of a file.
The value isn't hte same as what explorer shows, most likely because it's measured in GMT or something like that.
How can I ask Windows to apply my Time-Zone/DST settings on this date variable ?
thanks
|
|
|
|
|
Hi,
Which method I have to use for move from an edit box and another with enter botton?
Thanks.
|
|
|
|
|
Hi,
for this edit box you have to catch the WM_GETDLGCODE message, telling it that you want DLGC_WANTALLKEYS.
In your WM_KEYUP handler you must look if the user pressed the enter key and than act accordingly. In any other case you should do the default action.
Regards
G. Steudtel
|
|
|
|
|
Hello,
This is my problem:
I have a list box which is used to select a certain item via double-click. This item can then be placed on a map. The problem is, while placing the item, the mousewheel has functionality within the program other than scrolling the list box. I need this mousewheel functionality to work, but once the item in the list box is selected, the focus stays on the list box and the mousewheel will only scroll the list and not do what I want it to do within the main program window.
If I could just move the focus from the list box to some other button, or remove it entirely, (without actually clicking on another list or button) the problem should be solved.
I have tried:
SendMessage(list_box,LBN_KILLFOCUS,0,0);
SendMessage(list_box,WM_KILLFOCUS,0,0);
where list_box is the handle of my list box, but, both of those KILLFOCUS messages are returns rather than messages that can be sent to the handle and processed.
I just need some way to get the focus off of the darned list box...
Thanks for your help,
Kelly
|
|
|
|
|
i was in your case before.
i did lots test, result is: no way to do that.
my solution is: create a Static control (Static has no focus on), then draw strings on the control - it is quite hard because you need to draw scroll-bar also.
when user click the static control, you know which string is selected, then do something according to the string.
but, maybe someone knows easy solution, i hope see it via your post.
includeh10
|
|
|
|
|
Hi,
I once had a similiar problem within a tree control. My solution was to make a boolean variable (bDoubleClicked) which was initially set to false. When the user double clicked an item I just set this variable to true and remembered what he/she choosed.
My actual action was taken on the mouse button up message. By looking if the user had double clicked I performed the task. In any case bDoubleClicked was set to false again.
The problem was that the mouse action was bound to the tree control and not released until the button up message arrived to that control.
I think you should use this method for your problem too.
Hope this helps.
Regards
G. Steudtel
|
|
|
|
|
Thank you for the suggestion, but I think it probably won't work - the problem is, once the mouse clicks onto the list box, that's it, the focus is now on the list box. I need some way to remove the focus from the list box. Regardless of what variables I use to save position and such, once the mouse clicks even once on the list box, that's it, problem activated.
I'd really rather not manually write a list box, I've done that in other portions of the code that involve larger bitmaps and such and it's a pain to always keep track of where they are in relation to the larger window etc, if I'm going to do that I'll just throw in an extra button instead that you're forced to click in order to place the selected items, but that's such a hassle for the user..
I can't imagine that there isn't some way to simply send a message to a window to change or remove focus.. it seems like such a basic function?
Thanks for the suggestions though guys, hopefully there is some way to do this..
Kelly
|
|
|
|
|
After the item in the listbox has been double-clicked, why can't you just call SetFocus() to set the focus on the "map" control?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I didn't realize there was a SetFocus function -
Thank you, that's exactly what I was asking, I just tried it and it works the way I want
|
|
|
|
|
if you have scroll-bar in listbox, i don't think things are so simple, especially need to manage keyboad-input.
visual c++ prompt window (appears if type dot after an object) is an example which doesn't use normal listbox.
includeh10
|
|
|
|
|
A scrollbar does not affect a listbox's ability to set/kill focus.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
if type "command.com" in run-window, a dos-window is lauched.
1. i guess "command.com" should be an execute file, but it doesn't have extension "exe". what is story of file extension of "com", why can it be executed?
2. from process-walker, i can not find "command.com", what is application name of the dos-window?
thx
includeh10
|
|
|
|
|
1. I kept typing different explanations but this'll be easier:
<http: www.faqs.org="" faqs="" msdos-programmer-faq="" part2="" section-9.html="">
2. I have no clue, sorry.
|
|
|
|
|
|
It is the command interpreter. It's been around since the days of DOS. It contains the internal commands such as CD, DIR, CLS, TIME.
Executable files having a .COM extension are usually much smaller and faster than their .EXE counterparts, because of the single code and data segment. With the 16-bit compiler, you could create a .COM file by specifying the tiny memory model. Exe2bin and Debug could also produce them.
http://physics.concordia.ca/~eddy/391/AppC.html
http://www.du.edu/~etuttle/electron/elect59.htm
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Q1 has already been answered more than adequately.
2. NTVDM is used to run any pure 16 bit app, which command.com evidently is.
(And before you ask, that's NT Virtual DOS Machine, hence the name).
Steve S
|
|
|
|