Manager custom, throw IndexOutOfBoundsException when call deleteAll()

import java.util.Vector;

Import net.rim.device.api.system.Bitmap;
Import net.rim.device.api.system.Characters;
Import net.rim.device.api.ui.Color;
Import net.rim.device.api.ui.Field;
Import net.rim.device.api.ui.Graphics;
Import net.rim.device.api.ui.Manager;
Import net.rim.device.api.ui.Ui;
Import net.rim.device.api.ui.UiApplication;

SerializableAttribute public class LrcManager extends Manager {}
private int _width, _height;
_background private bitmap;
private int currentIndex;
    
protected LrcManager (int width, int height, Bitmap background, long style) {}
Super (style);
_width = width;
_height = height;
_background = background noise;
}

private int startIndex, endIndex;
    
protected void sublayout (int maxWidth, maxHeight int) {}
If (this.size () > 0) {}
int currentItemY = _height/2 + this.getField (currentIndex) .getPreferredHeight () / 2;
            
for (int i = currentIndex; I > - 1; i--) {}
((LrcItem) getField (i)) .setColor (Color.LIGHTGRAY);
                
currentItemY = this.getField (i) .getPreferredHeight ();
this.setPositionChild (this.getField (i), (_width - this.getField (i) .getPreferredWidth ()) / 2, currentItemY);
layoutChild (this.getField (i), _width, _height);
If (currentItemY<>
startIndex = i;
break;
}
}
    
currentItemY = _height/2 + this.getField (currentIndex) .getPreferredHeight () / 2;
            
for (int i = currentIndex + 1; I
((LrcItem) getField (i)) .setColor (Color.LIGHTGRAY);
                
this.setPositionChild (this.getField (i), (_width - this.getField (i) .getPreferredWidth ()) / 2, currentItemY);
currentItemY += this.getField (i) .getPreferredHeight ();
layoutChild (this.getField (i), _width, _height);
If (currentItemY > _height) {}
endIndex = i;
break;
}
}
            
((LrcItem) getField (currentIndex)) .setColor (Color.WHITE);
}
setExtent (_width, _height);
}
    
protected void subpaint (Graphics g) {}
If (this.size () > 0) {}
for (int i = startIndex; I
this.paintChild (g, this.getField (i));
}
}
}
    
protected void paintBackground (Graphics graphics) {}
If (_background! = null)
graphics.drawBitmap (0, 0, _width, _height, _background, 0, 0);
}

public void ForwardToPos(int second) {}
If (((LrcItem) getField (currentIndex + 1)) .second)<>
currentIndex ++;
UiApplication.getUiApplication () .invokeAndWait (new Runnable() {}
public void run() {}
layout (_width, _height);
updateLayout();
Invalidate();
}
});
}
}
    
public void setPos(int second) {}
for (int i = 0; i)
If (((LrcItem) (i) getField) .second > = second) {}
currentIndex = i;
UiApplication.getUiApplication () .invokeAndWait (new Runnable() {}
public void run() {}
layout (_width, _height);
updateLayout();
Invalidate();
}
});
return;
}
}
currentIndex = size () - 1;
}

public void add (field) {}
throw new UnsupportedOperationException();
}
{} public void addAll (fields [])
throw new UnsupportedOperationException();
}
public final void insert (field) {}
throw new UnsupportedOperationException();
}
public final void insert (field field, int index) {}
throw new UnsupportedOperationException();
}
{} public void delete (field)
try {}
Super.Delete (Field);
} catch (Exception ex) {}
System.out.println (ex. ToString());
}
}
    
public void deleteAll() {}
try {}
for (int i = (size) - 1; i > - 1; i--) {}
Delete (getField (i));
}
} catch (Exception ex) {}
System.out.println (ex. ToString());
}
}
    
public void add (int second, String text) {}
Super.Add (new LrcItem (second, text, getFont () .derive (0, 20, Ui.UNITS_px), Color.WHITE, 480, 0));
}

public final void insert (int second, String text, int index) {}
Super.Insert (new LrcItem (second, text, getFont () .derive (0, 20, Ui.UNITS_px), Color.WHITE, 480, 0), index);
}
    
public int size() {}
Return this.getFieldCount ();
}

}

I had a very quick glance, I probably missed or to some things so ignore my comments, if you don't think they are correct.

A few ' style questions:

(1) why you substituting delete and deleteAll and using size() instead of getFieldCount().

(2) for me, the performance benefits to count backwards in loops is over-priced - and the confusion it can cause in the coding is often overlooked.

(3) you sublayout loop backwards and the loop count seem to do essentially the same thing, is there a reason they are separate?

(4) I don't know that you have understood the concept of a virtual height and the height of the screen for a manager of scrolling.  Your sublayout seems to try to limit the number of fields displayed in the size of the actual scope and assume that this will continue after your currentIndex.  Take a look at this:

http://supportforums.BlackBerry.com/T5/Java-development/implementing-a-standard-style-scrollbar-on-a...

That said, it seems to be a problem with your maintenance of currentIndex when you remove fields. Whenever you remove the field, it will cause a sublayout, and once currentIndex is > that the number of fields on the left, your treatment will die with an output of exception of limits.  But in sublayout, not delete.

Perhaps you could explain what you're actually trying to do with this Manager as it is is not clear to me from the code.

Tags: BlackBerry Developers

Similar Questions

  • sequence Manager custom; What happens when?

    The page on screen mentioned using a Manager custom value USE_ALL_WIDTH and height, on a full screen, in order to get the screen of the device width and height without a signed key and without using deprecated code. I did it and it works. So I can set some static class and use these values throughout my program. All other class modules use the values very well.

    I have another custom Manager, in the same class as well as the first. He must know the width of the screen. Now, even if I am the creation and initialization of the class of ScreenInfo first, Member in the constructor of the class, the value of screen width is not available at the moment where the second Manager needs.

    Someone could enlighten me on this timing issue and let me know if there is a solution? Thank you

    Your sublayout must do much, much more than that. It is a centerpiece of any custom layout manager. It should say each field in the provision itself, choose positions for its fields and calculate and define its scope (size).

    Here are some articles to the knowledge base for beginners:

    The extension Manager

    Create a custom for a screen Manager (check the review here)

    As for where to add updateLayout: inside your sublayout, by checking if the sizes are already calculated (fields that have not been built before have their widths and heights 0). However, this is not a good approach at all. Better be used correctly the width and height in the sublayout as parameters, exposes the fields in the order you want, their demand for their size after that (if you call layoutChild first and then ask the child about its width and its height) and set their positions accordingly.

    It is not an easy task, unless you implement something totally obvious (for example, reimplement a VerticalFieldManager, well that even if this can easily go wrong if you're not careful).

    Here are a few examples of very good but quite complicated:

    Managers, the fields and advanced buttons

    Good luck!

    With respect to appellant layout in the layout - wrap your updateLayout() in invokeLater to the schedule until after that your sublayout finishes the job.

  • exception when calling add to the workspace

    Hello

    I built a workspace tailored to the requiremnts. also, custom container for approval,

    now what is happening, it is that good that submit data from the workspace, it is thrown exception;

    Exception when calling service "access remote-service": flex.messaging.MessageException: can't call method "prepareForSubmit". Method 'prepareForSubmit' not found.

    incomingMessage: Flex Message (flex.messaging.messages.RemotingMessage)
    operation = prepareForSubmit

    parameters = [EBB9CD44-7C5C-102D-8E25-00000A051045, 2902]
    clientId = BC3D5FB2-9709-5A3C-5C2A-92AB0A3A1430

    destination = task actions
    messageId = A3AA04BE-D287-DAE6-C042-2D277978BD5A

    timestamp = 1297837685127
    timeToLive = 0
    body = null
    HDR (Iddm) = BC3CAB65-5D1C-688A-272F-3D7C4343E301
    HDR (DSEndpoint) = space work-survey-AMF

    Exception: flex.messaging.MessageException: can't call method "prepareForSubmit". Method 'prepareForSubmit' not found.
    at flex.messaging.util.MethodMatcher.methodNotFound(MethodMatcher.java:378)
    at flex.messaging.util.MethodMatcher.getMethod(MethodMatcher.java:186)
    at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:420)
    at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
    at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1406)
    at flex.messaging.AsyncMessageBroker.routeMessageToService(AsyncMessageBroker.java:571)
    at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005)
    at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
    at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
    at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
    at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
    at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:165)
    at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:293)
    at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:364)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    and the form remains as usual in the workspace. This is not the case with only my custom container apprval, but also with the default container and approval too.

    It seems to me there are a few probem with my custom workspace code. as it works very well with the default workspace.

    what I did, was created custom, as well as a few comp header and componet connection just lc:ToDo to which the session is bound to the Main.mxml.

    What's not here? can someone explain?

    to add some is more than "'prepareForSubmit ' is present in code source TaskManager - api project - workspcae. " But what I do not understand why he is not able to find it?

    Resembles a version mismatch.  SP no matter what level you are at, apply the latest patch of process management for both server side AND update zip of the source of the update workspace.  Make sure you customization is the source of update in the patch.

  • Error when calling Fusion R9 on Service SOAP premise of JDeveloper 11.1.1.7

    
    

    Hi team,

    Here is the WSDL Iam I invoke:

    . http://fusionapp < clientName > .com:10607/prcPorCreateReq/CreateReqService? WSDL

    OER WSDL, example: https://fusionappsoer.oracle.com/oer/custom/r9/oer/oracle/apps/prc/por/createReq/createReqService/CreateReqService.wsdl

    Client Java code:

    public static void main(String [] args)
      {
          //setup security feature with OWSM policy
          SecurityPolicyFeature[] securityFeature =        new SecurityPolicyFeature[] { new       SecurityPolicyFeature("oracle/wss_username_token_client_policy") };
        createReqService_Service = new CreateReqService_Service();
        CreateReqService createReqService = createReqService_Service.getCreateReqServiceSoapHttpPort(securityFeature);
        // Get the request context to set the outgoing addressing properties
        WSBindingProvider wsbp = (WSBindingProvider)createReqService;
        WSEndpointReference replyTo =   new WSEndpointReference("http://fusionapp.techmahindra.com:10607/prcPorCreateReq/CreateReqService?WSDL", WS_ADDR_VER);
        String uuid = "uuid:" + UUID.randomUUID();
        wsbp.setOutboundHeaders( new StringHeader(WS_ADDR_VER.messageIDTag, uuid), replyTo.createHeader(WS_ADDR_VER.replyToTag));
        
          // Add Security Headers below if any Authentication is required.
          wsbp.getRequestContext().put(WSBindingProvider.USERNAME_PROPERTY,       "nitin");
          wsbp.getRequestContext().put(WSBindingProvider.PASSWORD_PROPERTY,       "Welcome123");
          // Add your code to call the desired methods
          long requisitionHeaderId =1234 ; 
          
          RequisitionHeader variableName; 
    
        // Add your code to call the desired methods.
            try {
                System.out.println("Invoking get req method");
                variableName = createReqService.getRequisitionHeader(requisitionHeaderId);
            } catch (ServiceException e) {
            }
        }
    

    Policy feature of security referred to in the WSDL document

    "" < policyReference xmlns:wsp= "http://schemas.xmlsoap.org/ws/2004/09/policy" " URI="#wss_saml_or_username_token_service_policy" wsdl: required="false"/ >"
    "" < policyReference xmlns:wsp= "http://schemas.xmlsoap.org/ws/2004/09/policy" " URI="#wsaddr_policy" wsdl: required="false"/ >"
    "< wsdl: Operation name="getRequisitionHeader">"

    Exception when calling

    C:\Oracle\MiddlewareJdev11117\jdk160_24\bin\javaw.exe -client -classpath D:\Sridhar\Software\p17888411_R12_GENERIC\jdevhome\jdev\mywork\FusionR9CreateReqServ\.adf;D:\Sridhar\Software\p17888411_R12_GENERIC\jdevhome\jdev\mywork\FusionR9CreateReqServ\FusionR9CreateReqServ\classes;C:\Oracle\MiddlewareJdev11117\wlserver_10.3\server\lib\weblogic.jar;C:\Oracle\MiddlewareJdev11117\oracle_common\modules\oracle.jrf_11.1.1\jrf.jar;C:\Oracle\MiddlewareJdev11117\modules\com.oracle.toplink_1.0.0.0_11-1-1-5-0.jar;C:\Oracle\MiddlewareJdev11117\modules\org.eclipse.persistence_1.1.0.0_2-1.jar;C:\Oracle\MiddlewareJdev11117\modules\com.bea.core.antlr.runtime_2.7.7.jar;C:\Oracle\MiddlewareJdev11117\modules\javax.persistence_1.0.0.0_2-0-0.jar;C:\Oracle\MiddlewareJdev11117\oracle_common\modules\oracle.webservices_11.1.1\wsclient.jar -Djavax.net.ssl.trustStore=C:\Oracle\MiddlewareJdev11117\wlserver_10.3\server\lib\DemoTrust.jks com.oracle.xmlns.apps.prc.por.createreq.createreqservice.CreateReqServiceSoapHttpPortClient
    Jun 3, 2015 5:23:59 PM weblogic.wsee.jaxws.spi.WLSServiceDelegate addWsdlDefinitionFeature
    SEVERE: Failed to create WsdlDefinitionFeature for wsdl location: http://fusionapp.techmahindra.com:10607/prcPorCreateReq/CreateReqService?WSDL, error: com.sun.xml.ws.wsdl.parser.InaccessibleWSDLException, message: 2 counts of InaccessibleWSDLException.
    SEVERE: java.io.FileNotFoundException: .\config\jps-config.xml (The system cannot find the path specified)
    SEVERE: java.io.FileNotFoundException: .\config\jps-config.xml (The system cannot find the path specified)
    INFO: WSM-09004 Component auditing cannot be initialized.
    Invoking get req method
    INFO: Recipient Alias property not configured in the policy. Defaulting to encrypting with signers certificate.
    Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: access denied (oracle.wsm.security.WSFunctionPermission http://xmlns.oracle.com/apps/prc/por/createReq/createReqService/CreateReqService#getRequisitionHeader invoke)
     at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:197)
     at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:122)
     at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:125)
     at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:95)
     at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:136)
     at $Proxy43.getRequisitionHeader(Unknown Source)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at weblogic.wsee.jaxws.spi.ClientInstanceInvocationHandler.invoke(ClientInstanceInvocationHandler.java:84)
     at $Proxy44.getRequisitionHeader(Unknown Source)
     at com.oracle.xmlns.apps.prc.por.createreq.createreqservice.CreateReqServiceSoapHttpPortClient.main(CreateReqServiceSoapHttpPortClient.java:56)
    Process exited with exit code 1.
    

    Please let me know how to configure the java client based on the WSDL file secuirity policy. I would like to know where iam missing.

    I have raised several MOS - SR Oracle, but no response until now.

    Concerning

    Sridhar

    Here's the code that worked:

    Public Shared Sub main (String [] args)

    {

    installation with GOSA policy security feature

    SecurityPolicyFeature [] securityFeature = new SecurityPolicyFeature [] {new SecurityPolicyFeature("oracle/wss_username_token_client_policy")};

    currenciesService_Service = new CurrenciesService_Service();

    CurrenciesService currenciesService = (securityFeature) currenciesService_Service.getCurrenciesServiceSoapHttpPort;

    Get the request context to set the outgoing address properties

    WSBindingProvider wsbp = (WSBindingProvider) currenciesService;

    ReplyTo = WSEndpointReference

    new WSEndpointReference ("http://fusionapp.techmahindra.com:7406/finGlCurrManageRateSetupService/CurrenciesService?") WSDL"(, WS_ADDR_VER);"

    String uuid = "uuid:" + UUID.randomUUID ();

    wsbp.setOutboundHeaders (new StringHeader (WS_ADDR_VER.messageIDTag, uuid), replyTo.createHeader (WS_ADDR_VER.replyToTag));

    Add headers of following security if authentication is required.

    wsbp.getRequestContext () .put (WSBindingProvider.USERNAME_PROPERTY, "FAADMIN");

    wsbp.getRequestContext () .put (WSBindingProvider.PASSWORD_PROPERTY, "Welcome1");

    String conversionType = "Corporation."

    VariableName of DailyConversionType;

    Add your code to call the desired methods.

    try {}

    System.out.println ("method call");

    variableName = currenciesService.getDailyConversionType (conversionType);

    System.out.println ("Value of the Variable name-->" + VariableName);

    System.out.println ("Data-->" + variableName.attribute1);

    System.out.println ("Type of Conversion-->" + variableName.conversionType);

    } catch (ServiceException e) {}

    }

    }

    Concerning

    Sridhar

  • Error occurs when calling remote ADFService11G service. Details: ADFException-3007: The ViewObject "AppModule.VO3" is used as a destination more than a ViewLink. (HY000)

    Hello

    Thanks in advance for helping me to solve after publication:

    I tried to run a report of OBIEE including data model comes from the layer of the ADF.

    In my module of the application, I have 5 display objects:

    For Ex: VO1 VO2 VO3, VO4 VO5

    And I show the links between: VO1 and VO2 (lets say: VO1_VO2_VIewLink).

    VO2 at VO3 ((permet de dire: VO2_VO3_VIewLink)), VO4 is related to the ((permet de dire: VO4_VO3_VIewLink) VO3) & VO5 is linked to VO3 (lets say: VO5_VO3_VIewLink)

    When I deploy this application on OBIEE and run a report with objects of:

    (1) VO1 and VO2-report works fine

    (2) VO2 and VO3 -report works fine

    (3) VO4 and VO3 -report works fine

    (4) VO5 and VO3 -report works fine

    (5) VO1, VO2, VO3 -report works fine

    It is when I run the report with the objects of

    VO1 and VO2 VO3 VO4, it throws an error message:

    "Error occurs when calling remote ADFService11G service. Details: ADFException-3007: The ViewObject "AppModule.VO3" is used as a destination more than a ViewLink. (HY000) »

    OBIEE Version is: 11.1.1.7.0 (with no patches) basis data: 11 GR 2, Jdev:11.1.1.7.0

    Kind regards

    RAM.

    I was able to resolve this error by changing my AppModule datamodel application, by changing the cardinality between VO3 and any other 1: n VO (VO3) to 1 (VO3): n. making VO3 as source VO object rather than view destination object.

    Kind regards

    RAM.

  • CS5 &amp; manage custom printing sizes.

    Whenever I try to 'manage custom sizes' when printing, Photoshop "unexpected." I use Photoshop CS5 and Epson 7800 and Mac Yosemite. I did all the updates and reinstalled the driver. Any ideas on troubleshooting?

    This looks like a problem that has been reported to Adobe. There are some official comment from Adobe in this link:

    Photoshop CS5: Can't choose the custom with Yosemite 10.10 paper size

    The crash in Photoshop only occurs when you create a custom paper size, by opting-out it. While there is a better answer, the workaround is that a couple of you said that you use: create your custom paper help to manage sizes custom dialog box print in another application. Then go back to Photoshop, open the dialog box print and choose the custom paper size.

  • How to manage what programs open when I turn on my Mac

    How to manage what programs open when I turn on my Mac

    System Preferences > users and groups > Login. Unlock the padlock (bottom left), select the item you want to remove, and then click the sign less.

  • When calling from my iphone, I get a busy signal, but it does not

    Iphone5S: when calling from my Iphone, they get a busy signal, but I do not use it.

    Is do not disturb on? (icon of Crescent Moon in the right line at the top)

  • I a s 6 more and when using the phone, if my face touches the screen it clicks on the logout button and the phone hangs up the call. Is it possible to prevent this without holding the phone away from my face when calling?

    I a s 6 more and when using the phone, if my face touches the screen it clicks on the logout button and the phone hangs up the call. Is it possible to prevent this without holding the phone away from my face when calling?

    iPhones have a proximity sensor which is supposed to automatically turn off the screen when you hold it in your face. If this is not the case you can take the phone and have it checked.

  • When calling another country gives the time in this country?

    When calling another country, Skype tell you the time in the country you call?

    Hello and welcome to the Skype community.

    N ° as currently configured the system does not support this facility.

    TIME ZONE - US EAST. LOCATION - PHILADELPHIA, PA, USA.

    I recommend that you always run the latest version of Skype: Windows & Mac

    If my advice helped to solve your problem, please mark it as a solution to help others.
    Please note that I usually do not respond to unsolicited private Messages. Thank you.

  • 7.10 Skype crashes when called or calling on Windows 10

    After the recent update, Skype has started planting when calling or called.

    Here is the error message record:

    Name of the failing application: Skype.exe, version: 7.10.0.101, time stamp: 0x55e99095
    Name of the failed module: KERNELBASE.dll, version: 10.0.10240.16384, time stamp: 0x559f3b2a
    Exception code: 0xe0fafac1
    Offset: 0x000b3e28
    ID of the process failed: 0x32b0
    Start time of application vulnerabilities: 0x01d0ef1d1febf028
    The failing application path: C:\Program Files (x86)\Skype\Phone\Skype.exe
    Path of the failing module: C:\WINDOWS\SYSTEM32\KERNELBASE.dll
    Report ID: b4ff52ed-8537-403a-a595-49c9c1a74ab3
    Faulting full name of the package:

    The text DxDiag file is attached.

    I see I'm not the one with this issue, but I wasn't able to find a reason for Skype crashing in my case.

    Updated to version 7.11.0.102 solved the problem.

  • My iPhone only more 6 does not ring when called.

    MY 6plus of the iPhone does not ring when called.  Any suggestions?

    You have probably already done this, but have you checked that the side button is not set to 'red' to mute calls, or that 'do not disturb' has not been activated accidentally?

    If one of the people are not the cause, have you tried a hard reset - restart by holding down the button power button and home button until you see the phone reboot with the Apple logo on the screen.

  • Sequencefileload freezes when calling DLL

    Hello

    I TestStand 4.1, and when calling a DLL on the MainSequence, everything seems to work fine, but if I call him on a SequenceFileLoad TestStand freezes on this step.

    What could be the problem?

    Kind regards

    Daniel Coelho

    Daniel,

    In fact, printf() can be the problem.  Because you are calling it in DLLMain, there are additional considerations you need to keep in mind.  Microsoft has a great page on these considerations here: http://msdn.microsoft.com/en-us/library/ms682583 (VS.85) .aspx

    Some excerpts:

    The entry point function must perform only the tasks of termination or simple to initialization. It should not call the LoadLibrary or LoadLibraryEx function (or a function that calls these functions), as this can create dependency loops in the DLL load order.

    Calling functions that require one dll other than Kernel32.dll can cause difficult to diagnose problems. For example, the calling user, Shell and COM functions may cause access violation errors, because some functions to other components of the system load. Conversely, calling functions of these courses of termination can cause an access violation because the corresponding component may already have been unloaded or errors not initialized.

    I'm sure that printf() is a shell command.  Also, while loading the file in sequence, it is likely that TestStand loading of DLLs or COM objects at the same time, which could conflict with a code that you have in DLLMain.

    Apart from that, Microsoft strongly recommends against any unnecessary code in DLLMain.  If this problem only may not be something to do with the products NOR, but more practical copies creation of DLL in general.

  • Error 1097 when calling DLLS in LabView

    I get an error 1097 when calling the LabVIEW provider library. Curiously, the error, the DLL routines still seem to do what is asked of them.  This is the test code.  It opens an Ethernet connection to a controller of axes Galil, he asks (possibly) the value of its internal clock, and then closes the connection.  Each call library function returns error 1097 but "valve function" I32 error number is always zero. Open function causes the connection to be opened, the command function causes the send command and receives a reasonable answer, narrow funtion seems to cause the connection to be closed.

    Here is what I see when I run the test:

    Also directly configure call-library functions, as I did in this VI, I also tried using the import-shared-library Wizard to create a vilib of functions of the DLL and I get the same behavior and errors when I use these functions.  I tried to tweak some of the data types in my configured manually call library functions to see if I could find a combination that worked better with the library, but had no luck there.

    I use the x 86 version of the DLL with v2014 LabVIEW 32-bit on a 64 bit windows system 7.  I see that the error on the two computer systems of different work configured in this way. I see a similar error on a home computer with just the RTE of 2014 installed. The manufacturer says they can not reproduce the error. I always saw the error over multiple versions of their library DLL.

    In the attachment ZIP it has a link to the DLL library on the manufacturer's website. There is also a copy of the VI, the DLL and a large part of how-to-use documentation that accompanies the DLL.

    I was hoping that someone who was familiar with the use of the call-library function might take a peek at what I do and see if an error could be spotted.

    Unable to find an error, I did, I would be happy to suggestions on how I could solve this. Little seems to me like there may be a problem with the library. The manufacturer, Galil, said that they have opened a log with OR to see if NEITHER could help but since Galil said they can not reproduce the problem and provide an example of the NC, it really went anywhere.

    Given the decoration of symbol names as exported by the DLL I "m convinced that you must change the stdcall calling convention.

  • error when calling NtSetTimerResolution in NTDLL 1097. DLL

    I get 1097 error when calling NtSetTimerResolution in NTDLL. DLL. why?   I scoured most of the posts on this forum describing the 1097 error and tried the solutions without success.

    This is a link to the function prototype (copied below) that I adapted in the node call the attached vi library (you will be asked to locate NTDLL. DLL on your system when opening it)

    NtSetTimerResolution and NtQueryTimerResolution are defined as follows. All hours are stated in hundreds of nanoseconds.

    NTSTATUS NtSetTimerResolution (
    IN ULONG RequestedResolution,
    IN BOOLEAN
    defined.
    ON PULONG ActualResolution
    );

    Parameters

    RequestedResolution

    The desired timer resolution. Must be the legal scope of the system timer values supported by NT. The standard x 86 systems it's 1 to 10 milliseconds. The values that are within the acceptable limits are rounded to the next higher standard x 86 HAL millisecond limit. This parameter is ignored if the Set parameter is set to FALSE.

    Set

    This is TRUE if we ask a new resolution of the clock, and FALSE if the application is indicating that he hasn't needed a resolution already implemented.

    ActualResolution

    The resolution of timer in effect once the call is returned in this parameter.

    Woohoo! I solved the problem.

    I was using a copy of NTDLL. DLL C:\Drivers\I386\SYSTEM32\NTDLL here. DLL (version 5.1.2600.1106)

    instead of C:\WINDOWS\system32\ntdll.dll here (version 5.1.2600.5755).

    An observation aside Interestingly enough, I did, when I tried to put the old version in C:\WINDOWS\system32 to see if it was just a problem of dependence, rather than a version number, I couldn't do it!  I tried renaming C:\WINDOWS\system32\ntdll.dll C:\WINDOWS\system32\ntdll.dll.old and immediately a replacement c:\windows\system32\ntdll.dll pop up would be in his place! I even tried to drag / drop of C:\Drivers\I386\SYSTEM32\NTDLL. DLL C:\WINDOWS\system32\ntdll.dll, it seemed to replace, but a system of security immediately replaced it with the latest version.   WinXP is smarter than I thought, or maybe something like Microsoft Windows Defender Antispyware installed by our company does this.

    In any case, I've confirmed lateer version is necessary because when I copied C:\WINDOWS\system32\ntdll.dll to C:\Drivers\I386\SYSTEM32\NTDLL. DLL, it also solves the problem.

    You might well ask why I did not use the correct version in the first place - well not knowing where he was, I only noticed the old version when I searched for it with my Google Desktop.

    Rgds

Maybe you are looking for