Passing display component hWnd to dll

I am working with a 3rd party DLL (Halcon) which opens a display window. Using the User32 library I can manipulate this window, make it a child etc, however it should also be possible to pass the DLL the hWnd reference of a component window for it to display in. I have read that Labview doesn't work with the normal Windows windows, but that there may be specific components that will work. Does anybody know front pannel components that have hWnd references that can be used to display a child window, and how to get that reference out of that compoenent? 

Hi!
There is a function called IMAQ Get Window Handle, that is contained in NI Vision Development Module. It returns the operating system handle to an NI Vision external display window. You should create external display with Vision VI's and then you're able to display any image in it. Or you may use CreateWindowEx of user32.dll to build your own window in LabVIEW. Also there are ActiveX and .NET ways to communicate Halcon and LabVIEW. If you import these controls to LV palettes (Tools -> Import -> .NET/ActiveX Controls to Palette...) you'll get simple window in which you are able to display any Halcon images using .NET or ActiveX approach.
See also this and this topics (last 4th answer in second may be useful)...

Similar Messages

  • Pass a value to a dll under labview

    I have to build a dll under cvi and use it under labview. my problem is to pass a value to this dll from labview.
    But when I use it, labview return an error code and close the software...
    I can return value from the dll to labwiew but not the contrary. can you help me please.
    I am a beginner and I am sorry for my english..."
    don't think it's a calling convention beceause When I use the box "call a dll" in labview and I select my dll, I can see all functions I have create in the dll (just the extern functions). for the datatype, I use int or unsigned int and sometimes char. and I can receive this value in labwiew...
    but for the pointer that's certainly my problem
    this is the sourcecode of my function. I drive a digital
    to analogue converter and I want to select the exit (There is 4 exit 0x00,01,10,11 )and a voltage (0 to 255 in décimal):
    void __stdcall dac_sortie_tension (int sortie, int tension)
    outp(LPT1+0x000,4); /* not important*/
    outp(LPT1+0x400,sortie);
    outp(LPT1+0x000,2); /* ecriture de l'adresse2*/
    outp(LPT1+0x400,0x00); /* not important*/
    outp(LPT1+0x000,3); /* not important*/
    outp(LPT1+0x400,tension);/*write voltage*/
    if I use a constant to "sortie" & "tension" it's OK...
    I try to use this:
    void __stdcall dac_sortie_tension (int *sortie, int *tension)
    but it's the same..."
    when I select the fonction in labview, I can see them
    but there isn't argument' ("sortie" & "tension") and I have a void like this:
    void fonction (void)
    what is the problem..
    I can give argument to the function but there aren't used..."

    /*draven*/;
    You need to configure the function manually. Once you select the dll and select the function, select the button Add a Parameter After. You can change the name of the parameter to sortie, keep the Data Type as long and then change the Pass field to Pointer to Value. Click again the Add a Parameter After button and do the same for the your variable "tension".
    For more information about calling external code in LabVIEW, refer to the following document (which should be also included with LabVIEW):
    Using External Code in LabVIEW
    Instructions on-line are here:
    An Overview of Accessing DLLs or Shared Libraries from LabVIEW
    Check also examples here:
    Communicating with External Applications
    Regards;
    Enrique Vargas
    www.visecurity.com
    www.vartortech.com

  • How to pass a single character to dll (as a parameter)

    How do pass a single character to dll (as a parameter). This is a third party dll that i am unable to change.
    e.g.: int functionName(char* process, char myChar);

    My apoligies, I am trying to pass a char from Teststand. Passing as a char is not one of the Category
     I tried sending (for example) : Locals.myChar[0].  Which is acceptable in C++, but gives me an error via Teststand.

  • Reg : Pass One Component's value to other component's value

    Hi all,
    I have the following code . Here I want to Pass :Pass One Component's value to other component's value
    <af:image binding="#{backingBeanScope.backing_OText.i1}"
    id="i1"
    source="#{(SkinBean.skinFamily == 'MSIE_D2I3')?'/images/d2i3Logo.gif':'/images/UDR_logo.jpg'}"
    shortDesc="Hello World"/>
    <af:spacer width="100" height="10"
    binding="#{backingBeanScope.backing_OText.s1}"
    id="s1"/>
    <af:outputText
    binding="#{backingBeanScope.backing_OText.ot1}"
    id="ot1"
    inlineStyle=" font-weight:normal; font-size:32pt; font-family:Georgia, 'Times New Roman', times, Serif;"
    value = *"Here I want to pass the value as 'Hello World' from The Image Component's ShortDesc"*
    Please give me the solution .
    Thanks inAdvance .

    since you already have the backing bean, you can try to set the value property to
    #{backingBeanScope.backing_OText.i1.shortDesc}regards,
    ~Krithika

  • Pass a "pointer type" into DLL

    Hi! I am planning to do this thing:
      A. Create an array
      B. Pass its pointer into a sub-VI
      C. In this sub-VI, use this pointer in a function of a DLL library
      D. The function of the DLL library will write something into place defined by the pointer
    My aim is to read back the result by viewing that array at step A.
    My question is..
    1. how to pass a pointer via VIs? Use Call be reference node in the mother VI, what about the daughter VI then?
    2. if I am passing a pointer into the DLL, should I choose "value" or "pointer to value" in the call library node?
    Raymond

    duplicate post, continue here!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • NullPointerException when trying to display component palette 903

    I just downloaded the production release, and took the jClient partition tutorial after completing
    JClient Form wizard I got nullpointerexception.
    This exception is from the IDE and not while running the program.
    And also when I try to display the Component palette I get the same exception.
    After creating the jClient Frame jdeveloper opens the UIEditor for editing, and also displays component palette
    if not visible, So whenever I create a new frame I am getting the exception.
    I restarted the IDE but nothing is working, I just tried View Component palette, again NullPointerException.

    this is the stack trace,
    What a cool IDE it is displaying the exception in a big alert box.
    java.lang.NullPointerException
         void oracle.ideimpl.palette.PaletteImpl.populate()
              PaletteImpl.java:240
         void oracle.ideimpl.palette.PaletteWindowImpl.checkIfPopulated()
              PaletteWindowImpl.java:323
         void oracle.ideimpl.palette.PaletteWindowImpl.show()
              PaletteWindowImpl.java:364
         boolean oracle.ideimpl.palette.PaletteManagerImpl.handleEvent(oracle.ide.IdeAction, oracle.ide.addin.Context)
              PaletteManagerImpl.java:174
         void oracle.ide.IdeAction$1.run()
              IdeAction.java:579
         void java.awt.event.InvocationEvent.dispatch()
              InvocationEvent.java:154
         void java.awt.EventQueue.dispatchEvent(java.awt.AWTEvent)
              EventQueue.java:337
         boolean java.awt.EventDispatchThread.pumpOneEventForHierarchy(java.awt.Component)
              EventDispatchThread.java:131
         void java.awt.EventDispatchThread.pumpEventsForHierarchy(java.awt.Conditional, java.awt.Component)
              EventDispatchThread.java:98
         void java.awt.EventDispatchThread.pumpEvents(java.awt.Conditional)
              EventDispatchThread.java:93
         void java.awt.EventDispatchThread.run()
              EventDispatchThread.java:85

  • How to pass a struct to a DLL function and accessing it in another VI

    Hi friends,
                       I am new to labview. I need to create a demo program in labview ,for displaying image from our own image capturing system. We have a  DLL ( build in VC++) containing functions for capturing image from our system. Now I need to create a VI library for some of functions in DLL and Create a Demo program using those created subvi library . I used "Call Function node" and created some of subvi's.
     Some of our DLL functions need to pass struct pointers.  Our function prototype will be similar to the following function.
    __declspec(dllexport) int __stdcall Initialize( unsigned char *imagebuffer,struct config *Configuration);
    The passed struct is similar to
    struct config
      double                val1[3];
      unsigned short   val2;
      bool                    val3;
      bool                    val4[3];    
      unsigned char    val5;    
      unsigned char   val6[3];
      bool                    val7[26];
    For passing "unsigned char *imagebuffer"  I initialized array with "Numeric constant " and set the size of the array and send to the function.
    The problem here is, I used this array in one of the subvi. 
    How can I use the returned imagebuffer array  in my main demo program. How to connect the image array to subvi "Connecter Pane"
    And  which control  can I use to display the image. The image data I get is form of 1-D Array .
    The second problem is,
                                 For passing the structure,  I used "Bundle " and filled the bundle with all the datatypes as in my struct and passed to the function. Is it correct ?  How to access this bundle after returned from function  in another Vi. ie.) How to connect this bundle to the connter pane ?
    Thanks for your valuable suggestions.
    aajjf.
    Message Edited by aajjf on 04-19-2007 05:34 AM

    aajjf wrote:
    Hi friends,
                       I am new to labview. I need to create a demo program in labview ,for displaying image from our own image capturing system. We have a  DLL ( build in VC++) containing functions for capturing image from our system. Now I need to create a VI library for some of functions in DLL and Create a Demo program using those created subvi library . I used "Call Function node" and created some of subvi's.
     Some of our DLL functions need to pass struct pointers.  Our function prototype will be similar to the following function.
    __declspec(dllexport) int __stdcall Initialize( unsigned char *imagebuffer,struct config *Configuration);
    The passed struct is similar to
    struct config
      double                val1[3];
      unsigned short   val2;
      bool                    val3;
      bool                    val4[3];    
      unsigned char    val5;    
      unsigned char   val6[3];
      bool                    val7[26];
    For passing "unsigned char *imagebuffer"  I initialized array with "Numeric constant " and set the size of the array and send to the function.
    The problem here is, I used this array in one of the subvi. 
    How can I use the returned imagebuffer array  in my main demo program. How to connect the image array to subvi "Connecter Pane"
    And  which control  can I use to display the image. The image data I get is form of 1-D Array .
    The second problem is,
                                 For passing the structure,  I used "Bundle " and filled the bundle with all the datatypes as in my struct and passed to the function. Is it correct ?  How to access this bundle after returned from function  in another Vi. ie.) How to connect this bundle to the connter pane ?
    Thanks for your valuable suggestions.
    aajjf.
    Message Edited by aajjf on 04-19-2007 05:34 AM
    You say nothing about how your cluster looks but I'm afraid you did the standard error here and placed arrays in it. That is not what the C structure is representing for several reasons.
    First fixed size arrays in C are inlined inside a structure, so are not a pointer but for the case of your val1 element three doubles.
    Second although not relevant here because of above point: LabVIEW arrays are not the same as C arrays. LabVIEW uses a pointer to a pointer and has the size of the array in elements prepended to the array data. C simply uses a pointer and all the rest is the programmers sorrow. The Call Library Node does convert the top level element of variables you pass according to the type configuration of that parameter but does no conversion of internal elements at all. So passing clusters with anything like arrays or strings is always wrong unless the DLL is aware of the specific datatypes LabVIEW uses.
    Last but not least you can end up with alignment issues. Elements in structures are aligned by every C compiler to a certain value. This value can be defined by the programmer in the project settings or for Visual C through #pragma pack() statements in the C code. The alignment rule says that an variable is aligned to the smaller of the two values that are either a multiple of the variable element size or the alignment setting. Most 32bit code nowadays uses 8 bit default alignment but LabVIEW always uses 1 byte. In your case there is nothing to observe since the large variables are at the beginning. Otherwise you might have had to insert filler elements in the LabVIEW cluster.
    One last thing bool is a C++ type only. Its size is 1 byte and incidentially this is the same LabVIEW uses for Booleans.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Pass in parameter to vb dll.

    Dear Java Guru,
    I need to pass in a String value from Java to VB dll. Say the vb dll has to function to accept the argument from Java. How do I pass in to the following say:
    //inside VB dll
    Public Function getValueFromJava(strValue As String)
    MsgBox "You pass in " & strValue
    End Function
    Please advise how do I pass in a value to the above VB dll method from Java ?
    Many thanks.

    Jacob has the library to call vb dll and pass in parameters from Java. This is the site:
    http://www.danadler.com/jacob/
    Hope this helps others facing the same problem.
    Extracted code:
    import com.jacob.activeX.*;
    import com.jacob.com.*;
    public class callDll{
         public void start(){
              ActiveXComponent xl = new ActiveXComponent("Display.clsDisplay");
              Object jacobObj = xl.getObject();
              System.out.println("Calling method...");
              Dispatch.call(jacobObj, "getValueFromJava", "Hello World");
         public static void main(String[] args){
              callDll test = new callDll();
              test.start();
    }

  • Intel Wireless Display Unable to load DLL error

    Hi there!
    I have the same problem. Today I've update my software by Lenovo updater and installed wireless display software, after I've rebooted my laptop and try to open the app I have this:
    If it important my switched on radio divice as those:
    What should I do to make WiDi to work?
    P.S.: I have  an original, not tablet version of x220
    Thanks.
    X220, IPS, Intel Core i7-2620m, 8 gb, Samsung 840 pro 256 gb, eGPU + Zotac AMP GeForce GTX 670.
    Solved!
    Go to Solution.

    Hi EvgenyP!
    The Intel My WiFi dll file is missing. To install it, download the Intel Wireless LAN drivers for the X220, and make sure that the My WiFi component is installed:
    Lenovo Support - Intel Wireless LAN (bg, abg, abgn) for Windows 7 (32-bit, 64-bit), Windows Vista (3...
    Hope this helps, and come back and tell us how it goes!
    I don't work for Lenovo. I'm a crazy volunteer!

  • Time stamp & array passed in a cluster through DLL are not accepted by Teststand

    I am trying to pass  Timestamp & array data [string array]   in a cluster  from DLL  is not  getting recognized by testsand.
    The action module (DLL)  Output (cluster)  generates   error "System Level Exception.[Error Code: -17502] "
    the png file shows the cluster
    I spoke to NI support & they  suppose that its time stamp that generates error
    but some fields (numeric, string) i am able to read
    Attachments:
    clustererror.PNG ‏41 KB

    Hello aparab,
    here is a link to another forum, which solves your issue:
    time stamp, data type for dll:
    http://forums.ni.com/t5/LabVIEW/time-stamp-data-type-for-dll/td-p/1085375
    to summarize:
    there are two possibilities to pass a cluster with a timestamp from LV to TS:
    1. use a string for the timestamp, although a numeric double might be easier to work with in TestStand
    2. use packed library

  • Pass Cluster into LabVIEW Generated DLL using __cdecl

    I'm using a DLL generated with LabVIEW 7.1 to calculate IIR filter coefficients in a application I'm writing in C++. The DLL contains several different functions. The function prototype in question looks like this:
    long __cdecl ButterworthCoefficients(unsigned long filterType,
    double samplingFreqFs, long order, double lowCutoffFreqFl,
    double highCutoffFreqFh, TD1 *IIRFilterCluster);
    where "TD1" is an output that contains the IIR filter coefficients generated by the function. TD1 looks like this:
    typedef struct {
    unsigned long filterStructure;
    TD2Hdl ReverseCoefficients;
    TD2Hdl ForwardCoefficients;
    } TD1;
    TD2Hdl is a handle to a 1-D array containing doubles.
    My question relates to how to pass the TD1* parameter into the function. If I simply declare TD1 and leave it uninitialized and pass it's address to the function I get a windows access violation read error. So I assume I have to create and populate the entire TD1 structure in my C++ source file, allocating memory for the arrays, before passing the TD1 address to the function. When I try to do that I get a LabVIEW error "Fatal Internal Error memory.cpp, line 638".
    Any ideas on how to make this work?

    Ok, I fixed my problem. I had to set the TD2Hdl elements in the TD1 structure to NULL before passing the TD1 address to the function. I think this makes sense because if you look at the Butterworth Coefficient.vi that I used to generate the DLL, the inputs to the CIN in that VI's block diagram are empty arrays. So I guess by setting the TD2Hdl elements to NULL, it tells LabVIEW that you are giving it an empty array, which is what the CIN was expecting.
    Hopefully this helps anyone else who has this same sort of problem.

  • Problem changing displayed component smoothly

    I have the following problem that I cannot resolve.
    Background : I have two display components which my app must alternate between showing. One is a JScrollPane holding a JTextPane, the other a canvas. The canvas in turn holds an animation. In my first attempt I construct a JPanel which (when it is time to change display) just remove the scrollpane and add the canvas, starting the animation thread and then call revalidate(). It works, but this solution is not smooth enough, it took more than one second before the the animation is displayed properly. To solve this I was thinking of putting the two components into a JTabbedPane component, and then just let the app change the tab index. However, I dont want the tabs available in the JTabbedPane, since changing the display is controlled by the app, not by user interaction. In fact, I dont want the tabs visible at all.
    So, how do I solve this? Is using a JTabbedPane, but somehow disabling the tabs possible, or does anyone know a better solution?
    Thanks !

    Hi,
    You're problem might be due to your use of the Canvas (which in Swing is called a heavyweight (=bad) component).
    JPanel is lightweight and you're trying to add a heavyweight component to a lightweight one - which is Bad, bad, bad. Simply make your component extend not Canvas but either java.awt.Component or java.awt.Container.

  • Passing text component to methods

    I have a method that reads a file and output puts it to a JTextArea. Everything is working fine but I am wondering if I can pass an object from a class above JTextArea (like TextComponent). Looking for a generic feel with whatever text based component I passed...will this make a difference with lightweight and heavyweigth components (swing vs. awt)? Or even streams for that matter? Will byte and character streams act differently?
    What is the super class of all text based gui components?
    What is the super class of all streams?
    Yes I have read the java api doc on streams and using swing! Thanks

    You have me until
    Everything is working fine but I am wondering if I can pass an object from a class above JTextArea (like TextComponent).What are you asking for here?
    You want to know if you can pass an object to a method? Yes.
    You want to know if you can modify a class further up in JTextArea's hierarchy, so it has a method that passes an object to another method? Yes, by extending it and implementing the functionality you want.
    Looking for a generic feel with whatever text based component I passed...will this make a difference with lightweight and heavyweigth components (swing vs. awt)?Not sure what you were asking for in the first place, so I'm unable to help you with this one.
    Or even streams for that matter? Will byte and character streams act differently?If you're asking, "When I pass a stream through a method, will it act differently when I use it inside that method?", then I can answer no, it will not. You are passing your stream by reference.
    class MyClass {
       private Object anObject;
       public MyClass() {
          anObject = new Object();
          MySecondClass secondClass = new MySecondClass(anObject);
    class MySecondClass {
       private Object theSameObject;
       public MyClass(Object argument) {
          theSameObject = argument;
    }In the above example, anObject was created in MyClass, and passed to the constructor of MySecondClass. The field theSameObject in MySecondClass is set to point to the Object passed into its constructor, which just happens to be the Object anObject created in MyClass. anObject was created in MyClass. theSameObject is essentially the exact same Object in that it references (points to) anObject.
    If I'm wrong feel free to call me on it, java gurus.
    What is the super class of all text based gui components?AWT or Swing?
    If it's AWT, look up the API for an AWT text component, try TextField, and look at the class hierarchy.
    If it's Swing, do the same for JTextField. You can easily do some detective work and figure out the super classes of 'text based gui components'.
    What is the super class of all streams?You can do the same as above for streams as well.
    Yes I have read the java api doc on streams and using swing! ThanksIf you've read the API docs on streams and Swing, then why did you ask the last two questions? Not trying to offend, it just seems kind of wierd.

  • Passing Display Name to Portlet(report) as a parameter???

    Does anyone know if we can pass the Display Name for a report dynamically to the portlets?
    For now, I have had to create one page for each report(portlet) by Overwriting the report display
    option and using specific Query Option for each portlet. Preferably I would just call the report
    with two parameters, one used in the sql to narrow down the query and the second for the Display
    Name.
    Thanks in advance,
    Yahya
    null

    Yahya -
    For Portal specific questions such as this, you might also want to post them to the Portal specific forums we have on OTN.
    Members of the Portal development team monitor and answer questions on those forums.
    cheers!
    -steve-

  • Displaying component in ADF conditionally

    Hi,
    I need to hide/display some fields in an ADF application based on some conditions.
    Please let me know how to achieve this. Is it possible to get the value from a java code or DB to take the decision.
    Please help.

    Hi,
    yes. All components have a "visible" property, as well as a "PartialTrigger" property. The "visible" property can be bound to a setter/getter in a managed bean using EL. The PartialTrigger property is set to the ID of the component for which change you want to hide/show the other component. To read data from the database to determine the visible state you use a Business Service (EJB, WS, ADF BC) that you expose through ADF bindigs (if you use ADF). This way the managed bean can access the information.
    If you are new to this technology I recommend you try one of the tutorials first
    Jdeveloper 11g R2: http://docs.oracle.com/cd/E18941_01/tutorials/toc.htm
    JDeveloper 11g R1: http://www.oracle.com/technetwork/developer-tools/jdev/overview/index-100269.html
    Frank

Maybe you are looking for

  • Oracle Uninstall Issue

    Dear All, I have installed 11g R1 (win 32) successfully on windows vista (home premium). However I was not able to connect on configuration assistant since yesterday. I tried to delete using DBCA GUI but unable to do so then I tried to uninstall usin

  • Warning on first startup of FCE 4.0

    I have a question about FCE 4 that I just got 2 days ago. When I first started it up, I got a warning that FCE may not operate as advertised because my video card was not up to snuff and may not run Quartz Extreme(I'm paraphrasing). I have a PM G4 1.

  • Document set items Version history

    Hi, I'm trying to to retrieve document set version history. here i need to retrieve all modified versions of a document in document set ? Can any body help? I have tried but didnt find anyway .. how to get version history of a document in document se

  • RANK() function problem in Form 10g

    I am using form 10g R2. I wrote codes inside a trigger of a button to select from one table, named test. The code is as follows: select mm,pp,rr from test. The form can compile this code. But when I write teh code select mm,pp, rank() over(order by p

  • HTTP to HTTP Through BPM?

    Dear All, please go through the below requirement and let me know your inputs and how do we develop this scenario in XI. Can this scenario be achieved by BPM. I have a Source System (AS400) and Target system (Windows) in between XI is lying. XI has t