Could AS3 call C++ functions in .dll?

Hi there,
Could I do:
write some C++ functions and compile them into a .dll file;
then call these functions from Actionscript3.0??
If yes, how can I do that?
Thanks a lot.

I guess, you are better off to ask this question in a C forum. This is a Java forum, you know.

Similar Messages

  • How to call a function in DLL file, while writing test scripts in ATML standards

    Hello all,
                I am trying to develop test scripts in ATML standards. I need to call a function in DMM.dll file. How can i do that in ATML standards, please explain with some example ATML standard XML file. Someone please help me in doing so. Thanks a lot in advance.
    With Regards,
    kalyan

    Hi srivinayaka,
                         I am attaching the XML file i have written in ATML standards and the Labwindows/CVI code that was generated when the XML file is opened in TESTSAND. actually the defenition of the function "IALdcpwr_reset()" is in IALdcpwr.lib and IALdcpwr.h files.
    "How can we add this library and header files?" so that i can show the path of definition. whether it should be done manually or can we do some changes in the XML file and make the work done?. Thanks in advance. If you have any example for this type of sequences. please forward me which would be helpful for me.
    With best regards,
    kalyan
    Attachments:
    XMLfile.doc ‏135 KB
    XMLfile.doc ‏135 KB

  • How to access Call Back Functions using *.dll in the Labview?

    Hai,
    I am Pavan Ram Kumar Somu.
    I am new to Labview, currently I am working on MVB Interface.
    I need to access the API functions from *.dll file in Labview, as of now , I am doing this with Call function Library node in Labview but it does not support the following data types like
        1. Pointer Arguments(To which memory it points in Labview)
        2. function pointers Arguments
        3 .pointers in structures and pointer structures in structures and many other data types.
    Please Answer the below queries also:
    1. How to pass pointer arguments to API functions in DLL and how to collect pointer  
        return types from API functions in DLL
    2. How to pass structure arguments to API functions in DLL and how to collect structure
        return types from API functions in DLL
    3. How to use callback functions(nothing but function pointers) in Labview and how to
        collect callback fuctions return types from API functions in DLL
    I need your help while passing these datatypes to API functions in DLL from labview.
    Suggest me if there is any other alternative for implementing this task.
    I am referencing some examples here:
    Examples:
    I)
    Unsigned short int gf_open_device(void *p_device_config, unsigned long int client_life_sign_timeout, unsigned short int *device_error)
    void *p_device_config: How to access/pass these arguments in LabView and to which memory location it points in LabView.
    II) #include <windows.h>
         #include <process.h>
         HANDLE rcvEvent0, rcvEvent1;
    /* Function call*/
    CanGetReceiveEvent(handle[0], &rcvEvent0);
    Above is a piece of C code, Now I want to use HANDLE datatype which is windows based, how to use these type in the LABVIEW.
    With regards
    Pavan Ramu Samu

    "Somu" <[email protected]> wrote in message news:[email protected]...
    Hai,
    I am Pavan Ram Kumar Somu.
    &nbsp;
    I am new to Labview, currently I am working on MVB Interface.
    &nbsp;
    I need to access the API functions from *.dll file in Labview, as of now , I am doing this with Call function Library node in Labview but it does not support the following data types like
    &nbsp;&nbsp;&nbsp; 1. Pointer Arguments(To which memory it points in Labview)
    &nbsp;&nbsp;&nbsp; 2. function pointers Arguments
    &nbsp;&nbsp;&nbsp; 3 .pointers in structures and pointer structures in structures and many other data types.
    &nbsp;
    Please Answer the below queries also:
    &nbsp;
    1. How to pass pointer arguments to API functions in DLL and how to collect pointer&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; return types from API functions in DLL
    &nbsp;
    2. How to pass structure arguments to API functions in DLL and how to collect structure
    &nbsp;&nbsp;&nbsp; return types from API functions in DLL
    &nbsp;
    3. How to use callback functions(nothing but function pointers) in Labview and how to
    &nbsp;&nbsp;&nbsp; collect callback fuctions return types from API functions in DLL
    &nbsp;
    I need your help while passing these datatypes to API functions in DLL from labview.
    &nbsp;
    Suggest me if there is any other alternative for implementing this task.
    &nbsp;
    &nbsp;
    I am referencing some examples here:
    Examples:
    I)
    Unsigned short int gf_open_device(void *p_device_config, unsigned long int client_life_sign_timeout, unsigned short int *device_error)
    &nbsp;
    void *p_device_config: How to access/pass these arguments in LabView and to which memory location it points in LabView.
    &nbsp;
    II) #include &lt;windows.h&gt;
    &nbsp;&nbsp;&nbsp;&nbsp; #include &lt;process.h&gt;
    &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp; HANDLE rcvEvent0, rcvEvent1;
    &nbsp;
    /* Function call*/
    CanGetReceiveEvent(handle[0], &amp;rcvEvent0);
    &nbsp;
    Above is a piece of C code, Now I want to use HANDLE datatype which is windows based, how to use these type in the LABVIEW.
    &nbsp;
    With regardsPavan Ramu Samu
    Search the forum (forums.ni.com) for callback, pointer or handle, and you'll find that it is all possible, but not very easy.
    e.g.: http://forums.ni.com/ni/board/message?board.id=170&message.id=88974&requireLogin=False
    Regards,
    Wiebe.

  • As3 call a function inside  swf

    I am loading an external swf like that. In the extrnal swf I
    have a function called "foo". how can I call "foo" function from
    the main swf?
    Thanks

    why not put the function in the main swf and eliminate the
    other swf if thats all there is? i have no clue about how to deal
    with multiple swf's. i'd say define it in the first frame of the
    flash and call on it later

  • CALL Library Function Nodeで呼び出したDLLの解放

    CALL Library Function NodeでDLLを叩いた後、
    LabVIEWを終了するまで呼び出したDLLが解放されません。
    解放する方法は有りますでしょうか?
    OS:Windows XP
    LV:プロフェッショナル開発システム 8.5.1
    行いたい事
    ある特定のパスにあるDLLを叩いて計測器を制御しており、
    同じルーチンで類似型を制御したいのですが、
    ・どちらも同じパスの同名DLLでなければならない
    ・同名DLLは中身が違う
    となっております。
    つまり
    1.計測器Aを制御する為にC:¥TEMP¥A.DLLを叩く
    2.計測器Bを制御する為にC:¥TEMPをC:¥_TEMP等にリネームし、
      B.DLLが入ったフォルダをC:¥TEMPとしたいが、A.DLLがLVで
      ロックされていて出来ない
    といった状態です。
    どなたかご享受頂けないでしょうか。

    MEPHISTO 様
    平素より弊社ディスカッションフォーラムをご利用頂きまして誠に有難うございます。
    日本ナショナルインスツルメンツ技術部 黒須と申します。
    LabVIEW 8.2以降のバージョンよりDLLを動的に呼び出すことが可能です。
    [LabVIEWでDLLを動的にロード・アンロード] 大変申し訳ございませんが英語での文献となっております。
    http://digital.ni.com/public.nsf/allkb/77594203D78D12278625729100758BE5?OpenDocument
    こちらの設定はライブラリ関数呼び出しノードの構成画面でダイアグラムでパスを指定という項目にチェックを入れていただくことで、
    DLLのファイルパスを指定してあげることができます。
    DLLをアンロードする際には空のファイルパスもしくは無効パス指定関数を配線することでDLLを開放することができます。
    記事にございます例では選択関数を用いてロード・アンロードを使い分けております。
    ライブラリ関数呼び出しノードのヘルプ≫ライブラリ関数呼び出しをクリックしていただきますと、ライブラリ関数呼び出しダイアログボックスの説明がありまして、
    そこでライブラリ名またはパスという項目でこちらに関しての説明もございますので併せてご確認ください。
    よろしくお願いいたします。
    技術部 黒須

  • Calling functions in dll

    Dear all,
    I'm facing an issue when a java program (ProgA) calls some functions in a dll, it works fine. But when I use another java program (ProgB) to call the method in ProgA that is calling the functions in dll, it prompts errors (please find the error message at the bottom of this mail). The following scripts are my programs. Please advise.
    Can anyone experience the same situation? Please advise how to cope with external library? Should I miss any configuration?
    Thanks in advance.
    Clive
    (ProgA)
    package abc.web;
    public class Sec_2 {
         // static constructor
         static {
              System.loadLibrary("des");
         public static native int DES_a(String lpszKey, int nMode);
         private static native int DES_b(String s1, String s2, int nAction, int lpnReturnSize);
         private static native void DES_c();
         public int enc2 (String lpszKey, int nMode,String encrypted_msg, int nAction, int lpnReturnSize) {
              int rtn_code = 0;
              rtn_code = DES_a(lpszKey, nMode);
              rtn_code = DES_b(e_msg, OutputMessage, nAction, lpnReturnSize);
              System.out.println("Encrypted string (inside) is "+ OutputMessage +" with return code "+rtn_code);
              DES_c();
              return lpnReturnSize;
         private static String OutputMessage;
         public void setOutputMessage(String s) {
              OutputMessage = s;
         public static String getOutputMessage() {
              return OutputMessage;
         public static void main(String [] argv) {
              int return_code = 0;
              int crypt_return_size = 0;
              enc2(s1, i1, s2, i2, i3);
    (ProgB)
    package xyz.pen;
    import abc.web.Sec_2;
    public class LoginOn extends JDialog{
         public CreateLoginDialog() {
              Sec_2 ddd = new Sec_2();
              Sec_2.enc2(a, b, c, d, e);
              System.out.println("Message "+ Sec_2.getOutputMessage());
    library des.dll contains function DES_1, DES_2, and DES_3 with following definitions.
    JNIEXPORT jint JNICALL Java_abc_web_Sec2_DES_1a(JNIEnv *, jclass, jstring, jint);
    JNIEXPORT jint JNICALL Java_abc_web_Sec2_DES_1b(JNIEnv *, jclass, jstring, jstring, jint, jint);
    JNIEXPORT void JNICALL Java_abc_web_Sec2_DES_1c(JNIEnv *, jclass);
    If Sec_2.class is run solely, the program shows the result normally.
    However, if we run LoginOn.class, the following error messages display.
    ERROR MESSAGE
    E:\>java xyz/pen/LoginOn
    Exception in thread "main" java.lang.UnsatisfiedLinkError: DES_a
    at xyz.pen.LoginOn.DES_a(Native Method)
    at xyz.pen.LoginOn.<init>(LoginOn.java:247)

    Hi
    Make sure that the dll is visible to LoginOn
    You can do so by adding the DLL directory to the Java runtime library path, i.e. pass -Djava.library.path=<dll dir>(alternatively, copy the DLL to Java program's working directory). If the Java code can't find the library, you will get a java.lang.UnsatisfiedLinkError
    Hope this helps.

  • Use call library function node

    I try to use call library function node to call a function in DLL and retrieve info stored in the C structure data type, can I do it? If yes, how ? Thanks.

    Have a look at the article Configuring the Call Library Function Node

  • Could i call airprint from Javascript

    How can i call the AirPrint function from my code? Could i call this function from my JavaScritp code?
    Message was edited by: JoshuaZheng

    What code are you talking about? If it's an app you are developing, you should try asking in Apple's Developer Connection.

  • How to call external functions without a .DLL (just using a .H and .LIB file)?

    Hello everyone,
    actually I'm facing little difficulties on how to get an external function getting called from within CVI (Version 2009).
    I was supplied with a .H file and a .LIB file to call an external function from within my CVI project. The .H file looks like this:
    void exportedFunction(double *parameter);
    As far as I know, the external function was written with MS Visual C++ 6.
    So I tried to statically link to the extern al function like this:
    - Add the .H file and the .LIB file to the CVI project
    - #include the .H file where I needed to call the external function
    - do the external function call
    When building I get an unresolved external function call error from CVI so this seems not to be working.
    I made some searches around and got up with two possible issues. Maybe one of you can help me get a bit further and get things working.
    1) The "real" function code is located in the DLL file which was not delivered to me. Or is there a way to get things done (call external functions) just with a .H and a .LIB file (without any .DLL file included)?
    2) The external function does not export according to "C-Style" rules. The function signature in the .H file shows no things like
    extern "C" __declspec(dllexport) void __stdcall ...
     Or maybe it's a combination of both issues (missing .DLL + wrong export style of function)?
    I guess I could get around the wrong export style of the function when I manage to write a wrapper around the original function that actually uses C-Style exporting. But I guess I need the .DLL file for this try as well.
    Thank you for your answers.
    Best regards,
    Bernd
    Solved!
    Go to Solution.

    There is no need  for the dllexport stuff. There is also the option for a static library without any DLL.  But the 'extern "C"' is essential, because it forces the C++  compiler, which was probably used to compile the library , to use C calling convention.
    If you can't ask the provider of the library to provide a version which was compiled using C calling convention the way to go is to write a wrapper with VC++6 around that library which reexports the functions using C calling convertion. Something like
    extern "C" type0 myfunc1(type1 arg1, ...) {
           return func1( arg1,...);
    for every function , you need to use.
    BTW. "unresolved symbol" is the linker error message, you can expect if you try to link C code against a library build with C++ calling convention.

  • With java how to call a function offered by user32.dll?

    Hi,everyone.
    Please think about my question.Now i want to retrieve all the user's
    information in NT OS.will it be possible? could it be done by calling a method
    of dll? i have tried to define a native method,but i got java.lang.UnsatisfiedLinkerror when i execute the class, what will be the problem?
    can you please offer me a piece of code like it. but the dll should be available with the OS,such as user32.dll,kernal32.dll ...ect, not the one using jni to generate.
    Thank you for suggestions.

    can you please offer me a piece of code like it. but
    the dll should be available with the OS,such as
    user32.dll,kernal32.dll ...ect, not the one using jni
    to generate.You cannot directly call C functions in this way. You have to use JNI. Have your native method written to normal JNI standards call the functions in the OS. Your native method will also have to take care of creating the data structures needed to make the OS call and also creating the Java data structure you want to return.

  • Calling external C-functions in DLLs with struct as parameters

    Hi all PL/SQL Gurus !
    Is it possible to call external functions in a DLL written in C
    wich has pointers to C-structs as parameter. Can you point me to
    an example or extended documentation about this. I had a look at
    the Oracle doc's but found no examples about structs.
    Thank you very much,
    Stefan.
    P.S.: Konfiguration: Oracle 8.1.7.0.0 Client and Server on W2K-
    SP2 machines.

    Hi,
    I have the same problem with you.Now,have you resolve the problem?
    I want to know how to do.if you resolve it ,could you give me a example.
    thanks .
    best regards!
    Liyf

  • Can LabVIEW call a function from a .sys file or is LabVIEW limited to dll access?

    My vendor has sent me a .sys file with functions accessing their hardware.  Can i call these function from labview directly or do I have to wrapper the .sys with a dll?

    Well a sys file is a kernel device driver. LabVIEW does not have any direct way of accessing such a driver. The way kernel drivers are accessed is usually through a DLL which makes calls to WinAPI functions such as CreateFile(), ReadFile(), WriteFile(), CloseHandle() and DeviceIORequest(). Since these WinAPI calls are basically just DLL calls too, you could theoretically use the Call Library Node to call them and access the kernel device driver in such a way.
    However for any kernel device driver with more than one or two device driver calls, it will certainly be easier in terms of development, debugging and maintenance of the code, to write actually a dedicated DLL in C/C++ for this device driver and access that DLL from LabVIEW, especially if you consider the LabVIEW datatype limitations when designing the DLL interface (Basically this same DLL can then be called from any other Windows development environment, be it Visual Basic (similar datatype limitation as LabVIEW), Delphi, (Visual) C, LabVIEW or also various scripting environments like Python and Lua.
    Some of the necessary WindAPI calls are rather involved and pose quite a bit of trouble to get the parameter data right in LabVIEw.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Have anyone used Labview to call MSP430_Memory function in the MSP430.dll?

    Hi,
    I am trying to read data from Infromation Memory of a MSP430 MCU. I am using MPS-FET430UIF to communicate with the MCU and having trouble to get data using the function MSP430_Memory. Have anyone done this before? I greatly appreciate any help from this forum.

    Good Afternoon,
    I just have a couple of quick questions for you:
    How are you going about calling the dll in LabVIEW?
    Are you using the call library function node?
    Could you post your code so we can take a look at it and get a better idea how you are going about it?
    I hope you have a great rest of the day!
    -Cody C

  • Help to make opencv's dll and LabVIEW's Call Library function node understanding each others

    Hi, i have a little problem trying to use a C++ opencv's dll in labview. I wrote a really simple and stupid dll just to try to understand how it works the call library function node. Here the header code:
    #ifdef GENERICDLL_EXPORTS
    #define GENERICDLL_API __declspec(dllexport)
    #else
    #define GENERICDLL_API __declspec(dllimport)
    #endif
    #include "stdafx.h"
    #include <opencv2/core/core.hpp>
    #include <opencv2/highgui/highgui.hpp>
    #include <iostream>
    #include <string.h>
    #include <stdio.h>
    #include <opencv/cv.h>
    #include <opencv/highgui.h>
    // Questa classe è esportata da Generic DLL.dll
    class GENERICDLL_API CGenericDLL {
    public:
    int Summ(int a, int b);
    int Sott(int a, int b);
    int opencv(int a);
    // TODO: aggiungere qui i metodi.
     and here the .cpp:
    // Generic DLL.cpp: definisce le funzioni esportate per l'applicazione DLL.
    #include "stdafx.h"
    #include "Generic DLL.h"
    #include <opencv2/core/core.hpp>
    #include <opencv2/highgui/highgui.hpp>
    #include <iostream>
    #include <string.h>
    #include <stdio.h>
    #include <opencv/cv.h>
    #include <opencv/highgui.h>
    using namespace cv;
    using namespace std;
    // Esempio di variabile esportata
    GENERICDLL_API int nGenericDLL=0;
    // Funzioni esportate.
    GENERICDLL_API int Summ(int a, int b)
    return a+b;
    GENERICDLL_API int Sott(int a, int b)
    return a - b;
    GENERICDLL_API int opencv(int a)
    const string ind = "C:\\Users\\sviluppo\\Desktop\\Tuli.bmp";
    const string ind_2 = "C:\\Users\\sviluppo\\Desktop\\Tuli_Gray.bmp";
    //Mat image;
    return 5;
    i can call all the three simple functions in labview with this easy code. No problem at all. If i uncomment the line "Mat image;" the call library function node doesn't work and i receive the error:
    "The library specified for this node cannot be found or cannot be loaded. Right-click the Call Library Function node and select Configure, then choose the correct library name or path."
    I think that is a problem of dependencies between opencv libraries but i dont know how to manage this. Any ideas?
    Thank you for yours time,
    Francesco.

    Hello Francesco,
    I'm having exactly the same problem as you. I created a DLL that I can easily access from LabView. If I add one line and include "imgproc.hpp" (the only one I need), then LV gives me the same error you had. I read the thread Loura linked to, but I don't see how people actually take care of the dependecies (Klemen's examples did not work for me for the same reason, even though I recompiled the .cpp). Could you explain in detail what you did to make it work?
    Thanks

  • When I use Call Library Function Node in real time, is the DLL loaded once for all or load every time it is called?

    When I use Call Library Function Node in real time, is the DLL loaded once for all or load every time when it is called?
    I have a time critical real time application, in which I use a piece of DLL function developed by C++.  It is OK?  Could any senior developer assure me?
    Thank you in advance.
    Solved!
    Go to Solution.

    qing_shan61 wrote:
    When I use Call Library Function Node in real time, is the DLL loaded once for all or load every time when it is called?
    Once
    qing_shan61 wrote:
    I have a time critical real time application, in which I use a piece of DLL function developed by C++.  It is OK?
    OK
    Be sure that all DLL calls are thread safe (do not perform calls in UI thread).
    Also for real-time application you need real-time OS.
    Andrey.

Maybe you are looking for

  • IBooks Author Export

    Do the iBooks Author files exported to PDF retain their interactivity?

  • Need installation cd for a HPF335 all-in-one deskjet printer.

    NEED INSTALLATION CD FOR AN HP F335 ALL-IN-ONE DESKJET PRINTER. WHERE CAN I GET A COPY?

  • Track BW activity?

    Hello BW Experts, Is there any transactions / logs where the BW activity can tracked ? Thanks, BWer

  • Running perl programs through java.

    How do i run a perl program through java? arg.pl : while(<STDIN>) print; java program that I tried: import java.io.*; class runtime     static Process p;     static BufferedReader stdOutput;     static BufferedWriter stdInput;     public static void

  • How do i compare Nodes on a home made List?

    This is for one of my classes, I have this .java's: ******** Nodo.java ( node ) ******** public class Nodo{ public T t; public Nodo s; public Nodo(){ t=null; s=null; }******** Lista.java ( List ) ******** public class Lista{ private Nodo inicio; publ