|
question now would be what are the errors you are getting?
vipin - Microsoft MVP
http://www.explorewindows.com
|
|
|
|
|
hello there,
I would like to scroll my CListBox (in other words, not a CListCtrl or CListView!) so that a certain item is the topmost visible item in the list (having it visible is not enough). Any ideas? I tried SetScrollPos, and although the range is meaningful, only the scrollbar gets "scrolled" (the bar moves), but the listbox itself doesn't move.
I'm getting quite desperate and all i can find if horizontal scrolling everywhere.
thanks
|
|
|
|
|
I think SetTopIndex or LB_SETTOPINDEX will do what you want.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
After you call SetScrollPos() to set the postion of the scroll bar you have to also send a WM_VSCROLL message to the list box to actually get the list box content to scroll.
pListBox->SetScrollPos(SB_VERT, Position);
pListBox->SendMessage(WM_VSCROLL, MAKEWPARAM(SB_THUMBPOSITION, Position), NULL);
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
wonderful, both approaches work. Thanks
|
|
|
|
|
Hello,
I have develloped a software in Visual studio 2005. It's works well but some time I get this message :
encountered a problem and needs to close. We are sorry for the inconvenience.
Error signature
App Name: spscurviewer.exe
App Ver. 1.0.0.1
Mod Name spscurviewer.exe
Mod. Vers. 1.0.0.1
Offset 0003218f
How can I check the problem !
AutreChien
|
|
|
|
|
Run it in a debugger and it should get you to the source of the problem.
Vipin - Microsoft MVP
http://www.explorewindows.com
|
|
|
|
|
|
Does anyone know where I can get the main alpha blended selection color? I know about LVS_EX_DOUBLEBUFFER for listviews, but this time I have to roll my own, and I'd rather it be consistent. I know that the border of the selection rect can be gotten from GetSysColor(COLOR_HIGHLIGHTTEXT) though. I tried using stylebuilder to see whether the color of the main selection rect came from a theme color, but couldn't find it
-- modified at 15:13 Sunday 30th July, 2006
|
|
|
|
|
Use GetSysColor(COLOR_HIGHLIGHT) to get the background color, and GetSysColor(COLOR_HIGHLIGHTTEXT) to get the foreground or text color.
Not sure what you mean by alpha blended selection color.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Ah, I was actually referring to the selection marquee when you drag select items in the listview. You can try drag selecting items in explorer in Windows XP to see what I mean. Unless you disabled it, it should draw a rather nice alpha blended selection rectangle.
Under performance options, Microsoft has it listed as "Show translucent selection rectangle".
|
|
|
|
|
Yeah, that's not what I was thinking at all (but, it's the weekend, so thinking is at a minumum )
I know nothing about the selection marquee, but this might hook you up. http://www.viksoe.dk/code/bluemarquee.htm[^]
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Thanks . I actually already know viksoe's site though. He's using COLOR_HIGHLIGHT and then blending to acheive the effect, which is what I'm already doing, but when I change the Selected Items color, I notice that only the border of the selection rectangle changes for the one in explorer. Maybe it's caching the color and not changing in response to WM_SETTINGCHANGE. I guess I'll have to live with it for the time being but I did go through all the colors in stylebuilder so I'm rather annoyed I couldn't find it.
It would have been nice if Microsoft's theming documentation came with pictures of the theme parts and colors though.
|
|
|
|
|
Hello everyone!
First of all, thank you all for helping me with my programs and stuff...
Now, does it? Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Kixdemp wrote: does it? Thanks!
Absolutly impossible for us to tell that without looking at the function.
Anyways if memory was allocated using new/malloc then you have to delete/free it explicitly.
I don't think, therefore I am not.
|
|
|
|
|
You don't have to bother about any memory consumed on the stack. But if you dynamically allocate any memory on the heap using malloc/new then you need to explicitly delete using free/delete.
Vipin Aravind
http://www.explorewindows.com
|
|
|
|
|
Kixdemp wrote: First of all, thank you all for helping me with my programs and stuff...
Now, does it? Thanks!
depends.. if you create variable in stack it will delete automatically when function exist!
e.g.
int i ;
float j;
if you create variable in heap(i.e. using localheap,new,malloc)..it doesn't get delete it self, you have to delete that yourself...
or rather you can use auto_ptr
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
This is mostly a question for ASM programmers, but there wasn't a catagory for that. Since I use alot of inline ASM in my VC6 projects, and since part of my question relates to C++, I decided to ask it here. I do hope that no one is offended, and if so I do apologize whole-heartedly. Anyway to my question :
I am using Borland Turbo Assembler v5.0 in [DOS mode] to comile a bootsector. I need to print several lines of text to the screen [in different colors], so I figured int 10h, function 0Ah is my best bet. However, all I print is garble if anything. Even if I change the message to be printed, the output doesn't change. I think the references to my registers got messed up somehow. Please help. Here are some of my 'rules' for the code, followed by my source-code.
1] The code must compile to 512 BYTES [or less].
2] I must ORG to 00h or 7C00h, since it is a bootsector.
3] I must be able to print several lines of text,
4] The text must be able to hawe colour attributes
5] I must use only BIOS functions [such as int 10h]
since DOS will not be loaded, making int 21h useless.
With all that out of the way, here is a source-code :
; BootSector Test v A15.d
; (c)copyright 1996-2006 John T. Hardeman
; All Rights Reserved ...
assume cs:code
org 100h
code segment
program:
jmp start
; data area here !
string db 'Hello, World !',0
start:
; set up data
mov ax,cs
mov ds,ax
mov es,ax
; clear screen
mov ah,00h ; function no.
mov al,03h ; video mode
int 10h ; BIOS int.
; write string at row 5, col 5 in light-green.
mov ah,13h ; function no.
mov al,00h ; write mode
mov bh,00h ; page no.
mov bl,0Ah ; attribute ===> text colour == light green
mov dh,05h ; row
mov dl,05h ; col
mov cx,0Eh ; size of string
lea bp,string ; address of string
int 10h ; call the video BIOS interrupt
; goto text location
mov ah,02h ; function number
mov bh,00h ; current page number
mov dh,09h ; row (from top)
mov dl,09h ; column (from left)
int 10h ; call the video BIOS interrupt
; put char @ current text location
mov ah,0eh ; function no.
mov al,01h ; character
mov bh,00h ; page no.
int 10h ; call the video BIOS interrupt
; wait for key press
mov ax,00h ; function no.
int 16h ; call the keyboard BIOS interrupt
; terminate ; ignore this section , as it will
; not be included in the final code
mov ax,4c00h ; function number
int 21h ; call the MS-DOS interrupt
code ends
end program
-digitalmythology
digitalmythology@yahoo.com
|
|
|
|
|
Wow, that's a blast from the past! Forgot you could write code like that.
Problem might be in the line (although, I might be grasping at straws):
lea bp, string;<br />
You might try:
push cs<br />
pop es<br />
mov bp, string<br />
My memory fails me.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Thanks for trying; now it tells me that the operand types do not match, in the following line :
mov bp, string
I made the mistake of donating my old assembly books, or this would be done already. If you have any info on int 10h, AH=0Ah that you can dig up for me, I'd appreciate it very much. TASM / old MASM info is hard to come by these days. Searches for TASM, MASM, and bootcode bring up either info on Tacticle Air and Missles, MASM32, Hutch, and bits about Izcelion.
Also another question? I do hope you know something of Operating System boot sequence. At what point will I be able to use C/C++ code to make controls, such as radio buttons, check boxes, progress bars, and Edit Boxes, etc.?
When will I be able to use TRUE 3D controls, instead of those that resemble the 16-bit ones of the old Win 3.1?
I am guessing that as soon as I enter Protected Mode, after
loading the kernel and activating gate A20, I should be ok. What do you think? I'll explain my ideas later, if you would like to know about them ... Please contact me if you do, and thanks again ...
My e-mail is webmaster@digitalmythologywebdesigns.com
-digitalmythology -dm
webmaster@digitalmythologywebdesigns.com
http://www.digitalmythologywebdesigns.com
|
|
|
|
|
I guess asm compilers have gotten smart - used to be they did what you told them to, with no backtalk, even if it wasn't right.
I had to dust off about 2 inches of muck from my "Peter Norton's Guide to the IBM PC", to even find int 10h, function ah=0ah! That's where the code came from, but obviously didn't work for you.
Sorry, I know nothing about operating system boot sequences, or at what point you can start using the built in controls.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
I am no expert, but as he wants ES:BP to be the address of the string, why not do
mov bp, seg string
mov es, bp
mov bp, offset string
This is how the sample code in my old (circa 1986) DOS book does it.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Yeah, I think LEA loads the effective address of DS:BP, not ES:BP, so your code is probably the money ball. (Still dusting off the cobwebs...)
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
That's one way to do it TASM.
--
Touch eyeballs to screen for cheap laser surgery
|
|
|
|
|
Jörgen Sigvardsson wrote: TASM
The book I got the code from was targeted at the Microsoft Macro Assembler (MASM) not the Borland Turbo Assembler (TASM).
(Not that it makes any difference in this case)
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|