Controlling CNiButton thru its Value

I have some buttons that I have added to a dialog box using the controls pallette. The tool tip text show these a CWButtons. Is this normal? Next using the class wizard I created member variables for the controls, these are of type CNiButton. I am using these buttons to control some hardware. I would like to use the ValueChanged message map to send commands to the hardware. Then check the status of the hardware and set the data members value depending on the outcome. I am having some difficulty setting the value data member in the OnValueChanged callback function for the control. It seems to be jumping out of the handler as soon as the CNiButton.Value is changed and immediately reentering it with the new value.

The reason that you see a tooltip that says CWButton is because CNiButton is a C++ interface on top of an ActiveX control called CWButton, and the dialog editor is hosting the control as an ActiveX control.
The reason for the behavior that you're seeing with the ValueChanged event is that the ValueChanged event fires both when you change the value interactively and when you change the value programmatically. The first time through your event handler is a result of an interactive change, but then you change the value in your event handler, which results in the event firing again, hence the appearance that it's jumping out of the handler and reentering the handler.
You could work around this by having a boolean member variable in your class that tracks w
hether you've entered the event handler and then check this flag in the event handler to prevent executing the code again when you set the Value property. For example, assuming you have a boolean member variable called m_inHandler whose value is set to false in the constructor:
void CCppButtonTestDlg:nValueChanged(BOOL Value)
if (!m_inHandler)
m_inHandler = true;
// Make changes to Value property here ...
m_inHandler = false;
- Elton

Similar Messages

  • How to check if a user has clicked on a digital control and changed its value?

    Greetings !!!
    I am looking for a simple way (without using Windows messages)of knowing if an user has clicked on a digital control and changed its value.
    I have tried the key focus property; but I have to click twice to make it work.
    If somebody knows a better solution; please let me know.
    Thank you in advance for your help

    If you just want to know if the value has changed you can put it in a while loop and use shift registers to see if the value has changed.
    Brian
    Attachments:
    Changed.vi ‏22 KB

  • Selecting one cursor at a time and then reading its value

    I am a novice LabView user. I am trying to develop a program in which I have to select portions of a waveform and delete the outliers.  The problems I run into is selecting cursors at a time and then reading its value. I was using Active Cursor. Ideally what I need is to read read values of the first two cursors, cursor0 and cursor1 and remove outliers in the region and then move to region between cursor1 and cursor2 and so on. Is there a way to control which cursors are active, read its value and then move to the next set.

    Hi binc,
    I have attached a VI that should remove outliers. This may not be the best way to do it, but it is one possibility.
    Thanks,
    Paul B.
    Motion Control R&D
    Attachments:
    Remove_outliers.vi ‏20 KB

  • Does Scheduling agreement controls limits with its line&delivery items?

    We would like Scheduling agreement to control total target value with its line items and delivery items like contracts.
    Is it possible to do that?
    thanks for your co-operations..

    Hello Cemal Parlak,
    Pl correct me if my understanding is incorrect, you want to control the total target value and Total target quantity of the Schedule Agreement and Contracts,
    In above case, you can make message controls to achive this,
    SPRO-> Materials Management -> Purchasing -> Environment Data -> Define attributes of system
    Make the following messages as Error message instead of warning based on the business requirement.
    00 - 06 - 042 (Target value of contract & exceeded by &&)
    00 - 06 - 067 (Scheduled quantity & & greater than target quantity & &)
    00 - 06 - 078 (Target quantity exceeded by  & &)
    00 - 06 - 155 (Contract target value & reached)
    These settings are at client level so please check with other business entity for the requirement and alternatively you can also define the message for particualr user group .
    Hope this helps.
    Regards
    Arif Mansuri

  • Breadcrumbs lost its values.

    Hello,
    I have a problem of my pages in Breadcrumbs.
    Every time I open a popup with jQuery on the page, Breadcrumbs lost its values.
    What could it be? Maybe it's because the popup interferes with Breadcrumbs causing him to lose the reference?
    Thanks in advance.
    Rafael

    Hi Dimitris ,
    Since in the behaviour section of the taskflows , the share data control checkbox is unchecked. and it has the No Controller Transactions.
    Since i don't set anything.I have autoSubmit on the Number text so i don't have to set , i just need to get and i do this by :-
    Here for the first time i get "NULL", that is uasual but after navigated back it should print 50 but it prints "NULL".
    public void phaseEveee(PhaseEvent phaseEvent) {
    // Add event code here...
    // logger.info("Start of method getValueFromIter");
    BindingContext bindingctx = BindingContext.getCurrent();
    BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
    DCBindingContainer bindingsImpl = (DCBindingContainer)bindings;
    DCIteratorBinding dciter =
    bindingsImpl.findIteratorBinding("EmployeesView1Iterator");
    if (dciter.getEstimatedRowCount() > 0) {      
    Row row = dciter.getRowAtRangeIndex(0);
    if(row.getAttribute("JobId")!=null){
    System.out.println("Value of JobId is"+row.getAttribute("JobId"));
    Thanks and Regards,
    Shah

  • SSO to SAP R3 thru ITS 6.20 with Logon tickets

    Hi All,
    I am trying to configure SSO to R3 thru ITS with the Logon Tickets.
    I have configured R3 to accept the tickets using STRUSTSSO2.
    Downloaded the verify.der file from Portal and imported to R3
    And tried to test the System connection.
    If I use <b>SAP GUI for Windows</b>,the logon ticket is passed and SSO happens
    with out any problem.
    But If I use <b>SAP GUI for html</b>,then ITS Logon screen appears and once I
    enter the user id and password it logs in.
    In ITS global.srvc file I have added the following parameter
    <b>~mysapcomusesso2cookie 1</b>
    I also have the following parameters in the global.srvc file
    <b>~login <space>
    ~password  <space></b>
    Do I need to configure any thing more in ITS.
    Where am I going wrong.
    I have read regarding <b>Pluggable Authentication Service(PAS)</b>.Is this mandatory for SSO thru ITS
    Please let me know
    I am working on EP6 SP14
    Any help is really appreciated
    Thanks in advance
    Regards,
    Santhosh

    Hi,
    IWithin System definition of R/3 System, you've to give the FQDN of ITS just same as Portal system. For example if your Portal system's FQDN is below:
    http://portal.hedehode.com:50000/irj
    then the ITS Server definition (parameter ITS Hostname) must be:
    itsserver.hedehode.com:port
    for portal to resolve itsserver.hedehode.com host, you may need to enter its IP address into hosts (c:\windows\system32\drivers\etc\hosts) file of portal system.
    <ip>   itsserver.hedehode.com

  • Display data to edit based on fields and its value defined in internal tabl

    I need to display data in a internal table for editing in a screen.
    you have a internal table with field name , data types and its value. I need to display data in a screen ( sceen painter not in a report) row by row in vrtical format.
    The internal table's structure not fix. you can have any number of fields in the internal table.
    Can you please send me code if it is available with you or send me any senario in SAP if any ...so that i can debug to extract the code..
    have to display data vertically as below in editable format,
    for example,
    Airline
    Flight Number
    Flight date
    Flight price
    Airline Currency
    Plane Type
    Maximum capacity
    Occupied econ.
    Total
    No of fields will change.
    also F4 help needs to be attached with each field.
    I think it can be done through step loop. can anybody give sample code or tell me where to find in SAP or somewhere else?
    it will be great help to me..
    Sanjeev

    Hi
    just check out this program DEMO_DYNPRO_STEP_LOOP.

  • Function to extract characteristics and its value from PI sheet

    Hi experts,
      I am working on a report to generate Avg. deckle for the month form the PI sheet. In the PI sheet the data that is displayed is basically the message characteristcs and its value.
    Please tell me ne function that will give me the related data to be displayed.
    Thanks in advance..

    reading the characteristics: CAVC_DB_READ_CFG_IN_CBASE.
    reading the values according to the characteristics: CARD_CHARACTERISTIC_READ.
    Note: the second FM is obsolete according to SAP. but it still works in opposition to the new ones.

  • How do I click on a cell in a table control, and display the value in a string?

    What I would like to do is to click on a cell in a table control, and have the value of the cell be displayed in a string indicator. What ever cell I click on, I would like the value to be displayed in the indicator.
    Thank you!
    Solved!
    Go to Solution.

    ... or
    Event >>> ouse down for table.
    Use Coords" to feed invoke node "point To Row Column" and returned "Cell Postion" can be unbundled to produce the row and column tht can be used to index out the value.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to prevent a text in script from displaying if its value is zero

    Dear all,
    How to prevent a text in script from displaying if its value is zero
    for eg   Price  = 0.00
    if price is 0 it should'nt appear in output.
    I tried with    if price ne 0.
                       price = &price&
                        endif.
    but it's not working.
    Regards
    Raj
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Jan 20, 2009 8:59 AM

    Hello Nagaraju,
                           What you were doing is partially right.
    The correct format to write in the script is as follows :
    /:  if &PRICE& ne 0.
      &PRICE&
    /:  endif.
    This should work. Let me know how it goes.
    Nayan

  • How do I retain a PDF form widget's design when setting its value using Javacript in Acrobat?

    I've been experimenting with interactive PDF forms in InDesign and JS in Acrobat. I think I've encountered something that might be a bug: widget design is overriden when using Javascript to set the field's value in Acrobat. Here's what a checkbox, for example, should look like when checked:
    However performing:
    var f = this.getField("Checkbox");
    f.value = "Yes";
    in the JS Console results in the widget's appearance defaulting to acrobat's:
    I've tried every single widget property documented in Acrobat's Javascript API Reference to no avail. Initially, checking/unchecking using the mouse works fine. Once the value has been set using JS, Acrobat's default black check character is used for all subsequent toggling, including when using the mouse...
    How does InDesign export interactive PDFs with custom icons for widgets? Is there any way to enforce the use of those icons using JS in Acrobat Pro? What's the difference between selecting a checkbox or a radio button using the mouse and setting its value using JS?

    I thought it might be the case, too, but all widgets have the same properties both before and after setting the value with JS. I did this check using all documented properties in Acrobat JS Reference in an attempt to figure out what might be going on.
    By the way, I don't think Indesign necessarily uses glyphs for the checked state of widgets, although in this case a glyph is used (albeit with different stroke and fill colours for the glyph, acrobat doesn't allow setting these properties AFAIK). With Indesign CS6 it seems you can practically use any Indesign tool to design the widget's On and Off states. So I'm thinking that maybe Indesign exports these with button-like properties where there are no restrictions on appearance (I think there is an "icon" property/object for buttons or something like that). However Acrobat treats them as checkboxes, so if that is the case it is more of a hack. Is there a way to probe an object's various properties other than using JS or the properties pop-up dialog?

  • After hiding an item, its value cannot be used in a query. How to use the value of a hidden item.

    Hi,
    I have a shuttle. I am using its value in a query by using sql collection array. My requirement is that I need to hide that shuttle. But when I hide the shuttle, its value is not retrived by the query.
    Please give some idea how to get this functionality.
    Thanks,
    chandru

    ChandraBhanu wrote:
    Its a shuttle. so how to create an application item of shuttle type?
    pls give some idea.
    You don't create an application item of shuttle type.  Application items only hold one value, and I thought since you were using a value in a query that you were only using one.  In the case of multiple values my idea to use a page/application item will not work

  • How to generate controls dynamically based on value stored in database using mvc4?

    In my database, i have a field called control_ids corresponding to  text box, dropdownlist, radiobuttonlist etc. My goal is to
    create controls dynamically based on value of control_id-field in table. Anybody please help me how to create the controls dynamically in MVC 4 for this scenario.

    In your view you could do something like that:
    foreach (var field in Model.FormStruture.fields)
    <div class="editor-label">
    <label for="@field.Name">@field.Descricao</label>
    </div>
    <div class="editor-field">
    <input class="text-box single-line" id="@field.Name" name="@field.Name" type="text" value="@field.Valor" data-rules-required="@field.Mandatory.ToString().ToLower()" data-rule-number="@field.Tipo.Equals(SiB.OCR.Documentos.Modelo.TipofieldDocumento.Numerico).ToString().ToLower()" title="@field.Descricao" />
    </div>
    if (!String.IsNullOrEmpty(field.Format))
    @:<script type="text/javascript">$("[email protected]").mask("@field.Format");</script>

  • Is is possible to delete an Asset physiscally when its value is zero?

    Hi All,
    Is it possible to delete an Asset physically after is been used and its value is made zero or some other way?
    Regards,
    Sudheer K

    Hi,
    If it is in a test environment you can try OABL.
    However, in production system, you can't/supposed to do that.  You can delete with AS06 provided no transaction has beep posted to an asset.
    Best Regards,
    Madhu

  • Is there any function module to get vc characteristics and its value using material number?

    Hi Experts,
    I am using BAPI_CLASS_GET_CHARACTERISTICS, BAPI_OBJCL_GETCLASSES to get characteristics description and its values.
    Is there any other Function module to pull this values using material number?
    Thanks in Advance.
    Ramkumar

    Have you tried this BAPI_OBJCL_GETDETAIL
    Import parameters
    MATNR value in the OBJECTKEY
    MARA in OBJECTTABLE
    Class name in CLASSNUM
    '001' in CLASSTYPE
    You will get the Class Characteristics data into these tables:
    ALLOCVALUESNUM
    ALLOCVALUESCHAR
    Jogeswara Rao K

Maybe you are looking for