|
On my way in to work I realized I have a variable scope problem and need to make the CPictureHolder object a member variable.
I am still interested in any input.
Paul <) (Dunce Cap)
|
|
|
|
|
I use Visual C++ 6.0.
I need to put a CRichEditCtrl and a centimeter ruler bar in a CWnd. The goal is that CWnd can appear anywhere in a dialog box to let user introduce formatted text using the ruler. It should work like a control.
My problem is that when my CWnd receives EN_HSCROLL notifications from CRichEditCtrl and get the values obtained from GetScrollInfo(), the values seem to me meaningless and I can't scroll my ruler accordingly.
Suppose for instance I have the following CWnd metrics:
a) client area width = 728 pixels (from 0 to 728)
b) rich edit client area width = 726 (728 minus the two borders?)
c) rich edit rect (SetRect) left = 21
d) rich edit rect (SetRect) right = 728
When the user type one more character after the most right position, CRichEditCtrl send the first EN_HSCROLL notification. When I get the values from GetScrollInfo() they are the following:
nMin=0 // ok
nMax=708 // why? (perhaps 728 - 21 = 707 plus one?)
nPage=706 // why?
nPos=3 // why? this for me is the most strange value
nTrackPos=3 // why? idem
I get also the caret position through GetCaretPos(). The value of x coordinate is 501. So the jump was from 728 (perhaps the last valid caret pos) to 501. This is a big jump! Why nPos only hace 3?
Suppose that after the jump, the user type more characters and a second jump occurs. Now the values are:
nMin=0 // ok
nMax=714 // why the maximum is not fixed?
nPage=706 // the same value...
nPos=9 // why? continue to be a strange value...
nTrackPos=9 // idem
I don't remember the caret position in this turn but the problem remains. How can I get the real jump of the scroll bar to scroll my ruler accordingly with the text in CRichEditCtrl? With the information of nPos it seems to be impossible.
I tried to understand the source code for WordPad but this is very, very confused because is not object-oriented and the ruler class, for instance, depends on many variables spread in other classes. Although this, the code of scrolling is simple. The WordPad application in OnUpdateCmdUI() uses GetScrollPos() and pass it to the ruler.
In my code I tried the same thing but the things don't work, also because I don't have the OnUpdateCmdUI() function. So, my ruler scrolls less than the real jump. This is the problem I have to solve.
Miguel Fonseca
miguel.fonseca@xerus.pt
|
|
|
|
|
Hi All,
I am currently working on a XML interface to my application. I have implemented this as a COM interface, usable from within any language such as VBS, C/C++, etc. The problem is that some customers ask me to throw exceptions from within that COM interface, to be catched at the upper level from where the COM was instantiated.
Does anyone know if this is possible at all, and if so, give me some pointers / hints in how to implement such a thing?
Thanks a lot in advance!
Perry Bruins (Netherlands)
|
|
|
|
|
All exceptions MUST be handled within the component, the only thing you can do is to pass back a HRESULT to indicate what happened. Of course, if you're passing back XML, you can pass back any other info you like, but you'll need to check the HRESULT for success, you simply cannot be throwing excpetions across processes or machines.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Thanks a lot for your answer. I already thought it was not possible, but now I know for sure.
Perry
|
|
|
|
|
Hi all,
Can any one suggest a method to scroll a jpg or bmp image through the bottom of a dialog just like the moving adds on a TV Screen?
With regards
Shibu K.V.
Senior Research Associate.
VLSI ASIC Hardware Design Group
Electronics R&D Centre,Trivandrum
India
|
|
|
|
|
you can put the image in to a dialog box and move the entire dialog from bottom to top by MoveWindow()
or move the position of the Image Control..
Renjith The CPian
|
|
|
|
|
If you're looking for a facility for credits displaying, you might want to have a look at Pål K. Tønder's Scrolling credits using CStatic.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
I'm working with a dialog based application.Is there any method for showing the directories, folders,sub folders and all the files contained them in a single combo box just like a tree view control.
Can anyone help me?.
With regards
Shibu K.V.
Senior Research Associate.
VLSI ASIC Hardware Design Group
Electronics R&D Centre,Trivandrum
India
|
|
|
|
|
|
NISHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
theapp COMPANYYYYYY
TECHNOPARK TRIVANDRUM ???????
MAIL CHEYYEDEY ENTHAADEEEY JAAAAADAAAA??? NJAN PALA TIME MAIL CHEYTHU ENNITTUM ENTHEY ORU JAADAA?????
R_Renjith The CPian
|
|
|
|
|
Sorry, but I don't entertain personal mails! I usually delete all such mails as I seem to get too many of them. You work in Technopark too?
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
|
|
|
|
|
Hi,
can any one tell me about the implementation of RS-485
and also about the difference btw full duplex and half duplex
if example is provided it would be of great help
thanks
Uday
|
|
|
|
|
I can tell you about the basics. RS-485 works by voltage differential. Their are two lines which are either +ve or -ve depending on whether a 1 or a 0 is being transmitted. These lines are labelled A and B.
So a 0 = A+, B-
a 1 = A-, B+
(or visa-versa)
Also, many devices can be on an RS-485 bus at a time. They need to use some kind of communication protocol to decide when they want to transmit on the bus. Any number of devices can listen, but only 1 can transmit at a time or you get garbled communication. Typiclly, you have 1 master device which initiates all transmissions, and then the other devices reply to the message, but they have to do so in a set time frame. DOnt forget to use checksums etc if needed to avoid bad messages.
Full-duplex/Half duplex.
In one of these modes you also receive in your input buffer what you send, in the other you do not. I forget which way round it is.
Hope this info helps.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Roger Allen wrote:
Full-duplex/Half duplex.
In one of these modes you also receive in your input buffer what you send, in the other you do not. I forget which way round it is.
Are you not getting confused with "loop back"?
Full-duplex means that both transmission and reception of data can occur simultaneously.
Half-duplex means that only transmission or reception can take place at any one time.
There is also a form of communication called Simplex which means that only transmission or reception ever occur.
Free
|
|
|
|
|
FreeLancer wrote:
Are you not getting confused with "loop back"?
Hmmm, maybe. I am going by the driver stuff installed for the RS-485 card in my PC. It can have a half/full duplex mode. Your probably right. Its been a long time since I looked at it*.
* Need to get my memory chips upgraded - finally I may have 2K!
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Hi.
I am making a program in Visual studio 6.0
and I am currently having trouble telling when a thread has ended.
Does anyone know how one can tell when a thread has ended?
|
|
|
|
|
One way is to use a CEvent and signal it when the thread function ends. You can then test this event wherever you need to know if the thread has finished.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
|
Thank you both of you for your replies. It was very useful for me
|
|
|
|
|
Hi,
does anybody know, how to create CHtmlView which would be using system independant proxy settings ? I need to use another HTTP proxy in my application, but not change IE proxy settings for whole system.
Thanks
rrrado
|
|
|
|
|
Does anyone know why the NM_RETURN message never works in list controls as it's supposed to?
I create a simple test app using the app wizard with a single form view, plopped on a list control. Then I use the class wizard to hook in the NM_RETURN message to a message handler and set a breakpoint there. Now running the app, clicking on the list control to make sure it has focus, and then hitting the enter key does not hit the breakpoint!
Any ideas?
(I also tried NM_CLICK, but that work no problem)
Much thankx!
swinefeaster
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
|
Thanks, but that's no good as I want to trap the event when the user hits the ENTER key. lbuttondown is easy...
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
Is there a way to get the physical disk number from a logical drive letter?
For example, there are 3 hard disk drives:
IDE 0 Master - the first HDD, containing C:, D: and E: logical drives
IDE 1 Master - the second disk, containing F: and G:
IDE 0 Slave - the third disk, containing H:.
For example I want to determine the physical disk, on which drive F: is located. This should be the Master HDD on IDE 1.
Thanks!
|
|
|
|