spin control problem #2

How do I get the integer value of a spin control's associated edit control 
while in the edit control's OnEnChange function.  Everytime I try to extract 
the data I get an exception error. 


0
nospam2791 (369)
7/26/2007 2:43:21 PM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
380 Views

Similar Articles

[PageSpeed] 46

If you have a problem in spin control, hire a good publicist... (sorry, I couldn't resist)

First, show the code.  Then say PRECISELY what you mean by "exception error", showing the
exact line of code that experiences the problem.  Otherwise, there is no way to tell what
you've done!
				joe

On Thu, 26 Jul 2007 07:43:21 -0700, "Z.K." <nospam@nospam.net> wrote:

>How do I get the integer value of a spin control's associated edit control 
>while in the edit control's OnEnChange function.  Everytime I try to extract 
>the data I get an exception error. 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
7/26/2007 3:10:02 PM
How are you accessing the spin control from the edit control?  The edit 
control doesn't know a thing about spin controls.

AliR.


"Z.K." <nospam@nospam.net> wrote in message 
news:eDY9QN5zHHA.3916@TK2MSFTNGP02.phx.gbl...
> How do I get the integer value of a spin control's associated edit control 
> while in the edit control's OnEnChange function.  Everytime I try to 
> extract the data I get an exception error.
> 


0
AliR3470 (3236)
7/26/2007 3:22:36 PM
You shouldn't have to access teh spin control to get the volue for it.  The 
spin control modifies the value in the edit control and you can get it from 
there.  Make sure that the spin control comes right after the edit control 
in the tab order as well.

Tom

"Z.K." <nospam@nospam.net> wrote in message 
news:eDY9QN5zHHA.3916@TK2MSFTNGP02.phx.gbl...
> How do I get the integer value of a spin control's associated edit control 
> while in the edit control's OnEnChange function.  Everytime I try to 
> extract the data I get an exception error.
> 

0
tom.nospam (3240)
7/26/2007 4:54:06 PM
Note that if you GetPos from a spin control that has a buddy, the value in the edit
control which is the buddy is the value "retrieved" from the spin control.

One of the most common failures is to have an EN_CHANGE handler trying to access a control
which has not yet been subclassed, and buddied spin controls will write to the edit
control, triggering an EN_CHANGE before all the controls have been properly subclassed by
the DoDataExchange call.  I usually handle this by either testing explicitly for validity
of hte window handles or having an "initialized" boolean that is not set until the end of
OnInitDialog.  That;'s why I wanted to see the code; the original question is far, far too
vague to be able to answer.
					joe

On Thu, 26 Jul 2007 09:54:06 -0700, "Tom Serface" <tom.nospam@camaswood.com> wrote:

>You shouldn't have to access teh spin control to get the volue for it.  The 
>spin control modifies the value in the edit control and you can get it from 
>there.  Make sure that the spin control comes right after the edit control 
>in the tab order as well.
>
>Tom
>
>"Z.K." <nospam@nospam.net> wrote in message 
>news:eDY9QN5zHHA.3916@TK2MSFTNGP02.phx.gbl...
>> How do I get the integer value of a spin control's associated edit control 
>> while in the edit control's OnEnChange function.  Everytime I try to 
>> extract the data I get an exception error.
>> 
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
7/27/2007 1:08:23 AM
Yeah, you're right of course.  These controls are interesting to use, but 
very valuable.  I've run into the same problem you mention here, but I 
mostly don't access them in the OnInitDialog() or OnInitialUpdate() routines 
any more except to set the pesky range so it doesn't run upside down as is 
the default.

Tom

"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
news:27hia3h4t4b3qs7jmnun858rsfaqgovtui@4ax.com...
> Note that if you GetPos from a spin control that has a buddy, the value in 
> the edit
> control which is the buddy is the value "retrieved" from the spin control.

0
tom.nospam (3240)
7/27/2007 1:16:39 AM
Actually, the problem seems to be pre-OnInitDialog, int hat I can access them there, but
the EN_CHANGE notification happens *during* the subclassing (partway through the
DoDataExchnge), so I get a spurious notification before I'm fully prepared to deal with
it.
				joe

On Thu, 26 Jul 2007 18:16:39 -0700, "Tom Serface" <tom.nospam@camaswood.com> wrote:

>Yeah, you're right of course.  These controls are interesting to use, but 
>very valuable.  I've run into the same problem you mention here, but I 
>mostly don't access them in the OnInitDialog() or OnInitialUpdate() routines 
>any more except to set the pesky range so it doesn't run upside down as is 
>the default.
>
>Tom
>
>"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
>news:27hia3h4t4b3qs7jmnun858rsfaqgovtui@4ax.com...
>> Note that if you GetPos from a spin control that has a buddy, the value in 
>> the edit
>> control which is the buddy is the value "retrieved" from the spin control.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
7/27/2007 4:12:57 PM
Reply:

Similar Artilces:

Problem with sheet tabs
My MS Office is Office 2003. While open a new workbook in Excel, the sheet tabs are not shown, I need to set by tools -> option and check the sheet tab every time. How to set the workbook opened with the sheet tabs ? Also, there is a extra menu tab "addin" shown at the top menu of workbook, i.e. File, Edit, View, Insert, ...., addin, Help. While addin is clicked, a message of "solution.xls not found" shown. How to fix it ? The first problem: Open a blank workbook, go to Tools - Option and change the settings. Now, close the workbook. Your changes sh...

help fixing a calculation problem
i have an big file that takes a while to calculate. I keep my calculation set on manual. a few times a day I create a csv. file out of a database and open it in excel and the file starts to calc and I end up having to wait it out. Anyone have an idea on how to prevent that from happening? -- barrfly Excel User - Energy markets ------------------------------------------------------------------------ barrfly's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=4141 View this thread: http://www.excelforum.com/showthread.php?threadid=482195 Try this .. Before yo...

ImageFrame Problem with Empty Reports
I am getting this "type mismatch" error when I try to open a report that has no records. The report normally displays a picture of the client if they have one or more records in the report. If they don't, it should be able to still open the report but just show no records. I have traced the source of the error to the following code in the pageheader of my report. ImageCyclist.picture=[picpath] The [picpath] is a field inserted in the pageheader that contains the pathname or link where the picture of the person is retrieved from. How can I prevent this error from appearing?? ...

Adding Across Worksheets #2
Hello all. I saw a thread talking about this, but I can't figure out how to make it work for me. My worksheets contain the contribution for each person for one day out of the week. One issue I have is that all my worksheets have the date for the worksheet name (it is easier to see what a person contributed on a certain day if the date is immediately visible on the tabs). I want to sum all the contributions for each person over the course of about 6 months. There are about 70+ people, and I want to show what each person contributed totally. Is there a way to do this using the SUM for...

Getting 'Purchase Order Failure' error #2
I am getting the following error when trying to transfer a final-approved purchase request into a PO in Microsoft Business Portal Requisition Management System: Purchase Order Failure One or more business logic errors have occured. Please correct the errors to continue. Message The enum Microsoft.Dynamics.Payables.FreeOnBoard does not contain the value 0. Parameter name: FreeOnBoard Actual value was 0. ************************************** The message "The enum Microsoft..." appears 3 times in the dialogue. I am trying to transfer 4 line items. Has anyone ever gotten these...

Business Alerts #2
Hi there I have set up SQL2k mail to work with a Groupwise PO - and mailing and address book functions work 100% in SQL itself. I get the issue when writing a business alert to work in GP for this - but it doesnt work - ive tried sending a test mail from the business alert and i get the error 0x80004005 in GP. Using GP 8.0 (no sp yet)on SQL2k. Has anyone else resolved a similar issue or is it an issue with V8.0?? Also does GP need to be running (application) on the server for the business alert to work?? Thanks heaps Theo :) Is it supposed to send an email? Business Alert are just SQL ...

Amount in words #2
Hi, I need to convert Purchase Order Document total amount to be converted in Words. Document total amount is already a calculated field, so what function need to be adopt??? Please explain step by step. Regards, Sheikh Asif Try using the Report Writer User Defined function below. It can be accessed from a Calculated field by adding a User Defined function from the System series. RW_ConvertToWordsAndNumbers() The parameters are as follows: in currency IN_Value; { Value of Currency } in string IN_Currency; { Currency ID of Currency - Leave Blank for Functional } in integer IN_Mode;...

blue screen reboot problems
my home prem. vista pc keeps rebooting. Blue screen message is 2 seconds long so i can't read it and several attempts to resolve this by using system restore etc is only making it worse. I've run virus scans in safe mode nothing. My deskstop comes up at startup with "windows installer" 3x then a box says that windows has to close down and then it reboots after 30 seconds or so, no time to try and update to sp1 or find the problem list because it dumps to fast. The blue screen does say TCPIP error or something. Do i have to connect Mircosoft with $$ or is this not f...

Strange Excel problem when opening an Excelbook
When I open an Excelworkbook I get the following message from Excel (see attached picture) First I get a security warning that the Excelbook contains macros which is OK. I press Enable macros (totaly normal) Then the strange message appears when excel looks for MIM.EXE???. If I press OK I get following message from Excel: "Cannot run MIM.EXE. The program or one of its components is damaged or missing" I press OK and I get back to the strange message. But if I press Ok again I get the Cannot MIM.EXE message, but then after pressing OK I can can continue work with the Excelwo...

Vista and Money 2005 ofx import problem
I recognise some names here from another forum but I thought it may be helpful to canvass some more opinions/expertise. I have Vista Ultimate running and have succesfully loaded Money 2005 UK and updated via the internet. Everything works fine except the bit I need ! I use Barclays Bank and have downloaded .ofx files for several years (Barclays does not support QIF). When trying to do this in Vista I get an error message saying the file is corrupt or not recognised. I have tried all manner of things including testing the ofx file etc and it appears fine and will load into Money run...

series of cells in a column #2
thanhyou so vey much -- ROLG ------------------------------------------------------------------------ ROLG's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=16066 View this thread: http://www.excelforum.com/showthread.php?threadid=275347 ...

counter problem(you really want to read this)
i have a workbook that contains two sheets. Sheet one contains a list of names. Each name references an information sheet for that name. I wish to collect data for each name for a specified number of days "x". When that number of days is met, then I wish to click on a button on the toolbar to delete some number "x" of days of data from 1 - "x" including "x". I wish to do this to make the data more current hence meaningful ...

I am having problem while installing MS Dynamics in Win XP
I am trying to install Microsoft Dynamics in Win XP, it gives an error saying MS Exchange server 2003 SP1 has to be istalled first I dont have MS exchange server installed in Win XP,what I have is outlook only Can I go ahead and install SP1 for win XP ( THIS IS AN OFFLINE INSTALLTION RIGHT NOW I am not using outlook to get my Email) Let me know how to install the same and the precaution I have to take Most of the errors expected are given for WIN 200 SERVER & 2003 SERVER IN TECHNET HENCE THIS QUESTION TO TYE COMMUNITY Regards Harish We cannot help unless you are m...

Problem sharing a workbook
Hi, I've created an Excel workbook (Excel 2003 (11.8120.8122) SP2), placed it on a shared network server, and then selected Tools>Protection>Protect and Share Workbook... with the "Share and track changes" option selected, and password protection set. However, if I attempt to open it when someone else has it open, I get the message stating that the workbook is opened by user so and so and am given the option to open it as Read-Only, Notify, etc. Any idea why this is happening? Thanks, Linda ...

System Control Snapin with SP2
This is a multi-part message in MIME format. ------=_NextPart_000_0006_01C683D1.72861070 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I was trying to setup some of the features that came with SP2, = specifically IMF and am not seeing all of the options available. I know = I installed sp2 on the exchange server, but I was wondering if there was = a new management console I had to install as well, or did I just install = incorrectly.=20 --=20 NATHAN WELDON ------=_NextPart_000_0006_01C683D1.72861070 Content-Type: text/html; charset=&qu...

HL-DT-ST DVD+-RW GSA-T2N1 problems
Running Microsoft Media Center Edition SP3 on Dell Inspiron 6400. Poblem - select files from explorer - right click, select Sent To - drive does not appear in window Problem - select files from explorer - drag them to drive D:\ - get error D:\ is not accessible. Incorrect function. What is wrong. Pierre C wrote: > Running Microsoft Media Center Edition SP3 on Dell Inspiron 6400. > > Poblem - select files from explorer - right click, select Sent To > - drive does not appear in window > > Problem - select files from explorer - drag them to drive D...

How to use MFC 4.2 with Visual Studio .Net
Hi! I have recently started using Visual Studio .Net in place of Visual Studio 6.0. My application is an Active X control written in C++ with MFC 4.2. Is there a way I can force Visual Studio to use MFC 4.2 and not MFC 7.0, since the application will be deployed mostly on systems with MFC 4.2. I know I can use "static linking" but that will make the application large and I am still adamant on using 4.2 libraries rather than 7.0 to be safe. Any suggestions. Thanks in advance for your help. Sanjay This question has started coming up a lot. The answer is simple: revert to VS6. ...

tax codes #2
Here in the great state of Kansas, we have multiple tax codes by city and county depending on if an item is bought in the store or delivered to the customer -- 700+ in all. Most likely, the easiest way to handle this is going to be by simply selecting the tax code when the customer checks out (hopefully via shift-f12) because I've been unable to find a way to match on both city and county with the 'walk-out feature'. The problem is that when I select a tax code, the program simply defaults to one particular tax code. Any ideas on what I'm doing wrong? can't you matc...

Relationship problems
I have a DB with 6 tables tbl 1 (Person's Info) ClientNum (PK) FName LName + all person info tbl 2 (Employment info) EmpID (PK) ClientNum EmpCodeNum EmpStatus TrainingRelated StartDate EndDate tbl 3 (Employer Codes) EmpCodeNum (PK) EmployerName tbl 4 (Trades) TradeNum (PK) TradeName tbl 5 (Pri-Training) PriTraID (PK) ClientNum TradeNum tbl 6 (Sec-Training) SecTraID (PK) ClientNum TradeNum The problem i'm have is that when i go to create a form to enter all the clients data the de...

Having problems opening pst file
When I try to open a pst file - I get the following message "Properties for this informaton service must be defined prior to use" then I get another pop-up "Errors |\ve been detected in the file C:\WINDOWS\APPLICATION DATA\MICROSOFT\OUTLOOK\outlook.pst. Quit all mail-enabled applications, then use the Inbox Repair Tool" Please help!!! I have important contact information I can't get to. GHR 770-451-8565 x11 "GHR" <anonymous@discussions.microsoft.com> wrote in message news:012d01c3ddf8$5ef50650$a301280a@phx.gbl... > When I try to open a...

Send Mail Problem
Hi all One of our user got the below two message from postmaster, i try to disable the rule(list.dsbl.org) from the connection filtering, but the problems still exists. I search my mailserver ip on list.dsbl.org, it listed. To removal need one week. Have any faster way to fix this problems? abc@abc.com on Thu, 7 Dec 2006 08:28:05 +0800 There was a SMTP communication problem with the recipient's email server. Please contact your system administrator. <"Mailserver Host" #5.5.0 smtp;553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)> 1...

X Axis Linear Representation Problem
I have a project involving a hiking trail where I am trying to capture altitude on Y axis versus mile marker location on X axis. I can enter the data in adjoining columns and use the chart wizard but each mile marker value gets positioned along the X axis in uniform increments rather than an actual linear scale representation. In other words, mile markers 3.3 and the next mile marker (3.8) are the same distance apart on the X axis in the graphic representation as is marker 3.8 and the next one (12.5). This distorts the graphic representation of the actual linear distance between the...

Problems with a Folder in Outlook 2000 SR-1
I just started having a problem with MS-Outlook. One of my mail-folders called 'to review' cannot open, every time I open it to see what items are in it, it just makes a weird noise on my hard drive. I did a right click on the Outlook File name and checked the folder size, and it returned with an error message. All other folders (like 30 or so) return a valid folder size. After that I went and ran the Inbox Tool Repair Kit and that returned an error message on that folder as well and told me to run scandisk.....well boys and girls, I don't think Scandisk is on Win2K Pro. Also,...

Microsoft Office has encountered a problem and needs to close. --H
I'm having issues with Outlook 2007. I get the following error message; Microsoft Office has encountered a problem and needs to close. We are sorry for the inconvenience. Click on the link to see screen shot error; http://i115.photobucket.com/albums/n311/jokicmla/Outlook%20Error/outlookerror1con.jpg Then I get the following error dialog box, when I click "Send it to Microsoft". Click on the link to see screen shot error; http://i115.photobucket.com/albums/n311/jokicmla/Outlook%20Error/outlookerror1.jpg This is the report that I received from Microsoft after sending “error re...

Messaging #2
hi, In Exchange 2003 Istant Messaging go out.. I need a program of chat only inside my Exchange 2003. What I can use? It's possible syncronize Msn and Exchange 2003? I can't use Microsoft Office Live Communications Server 2005.. It's too much expensive! Any other solutions? Thank's a lot Andrea On Tue, 14 Mar 2006 01:08:17 +0100, "Andrea Racca" <raccaNOSPAMlibero.it> wrote: >hi, >In Exchange 2003 Istant Messaging go out.. I need a program of chat only >inside my Exchange 2003. What I can use? It's possible syncronize Msn and >Exchange...