Call a dll with an activeX component gives error

Hello all,
My program consist of:
- Main program
- DLL's
How it works:
The main program is the interface for the user, this main program call's several dll's
The problem:
The main program runs withought problems, but when it call's a dll, which also call's an activeX component, I get an error.
I then made a executable from the dll which then works ok, no problem.
When I click the retry it runs ok, but when I call it again I get the message again.
The message does allways accur, but still very often
Conclusion:
The error message only comes when I call it as a dll, when the dll is standalone executable no problems occur.
Below you can see how I call the dll:
Can someone please help me with this problem?
greetz,
Bart

Hello Bas,
I have included the vi which calls de dll(executedll.vi) en the dll in VI form(plugin.vi & plugin.lvproj).
As you can see the dll calls the canconfigurator activex component.
And closes the activex component when done.
This plugin will be called several times in the test enviroment.
gr,
Message Edited by darkxceed on 02-12-2010 04:33 AM
Message Edited by darkxceed on 02-12-2010 04:33 AM
Attachments:
ExecuteDLL.vi ‏12 KB
plugin.lvproj ‏8 KB
plugin.vi ‏31 KB

Similar Messages

  • Calling a DLL(with vi.lib) from a lvclass within a Packed library

    Basically, I am having problem calling a DLL (which uses the vi.lib) from a packed library.
    The error code I got is error code 1003. “Error 1003 occurred at Call Library Function Node in XXXXX.lvlibp”, “Labview: The VI is not excutable. Most likely the VI is broken or one of its subVIs cannot be located. Select File>>Open to open the VI and then verify that you are able to run it.   Create Summary Log.vi”
    The VI that was mentioned above (Create Summary Log.vi) is one of the functions in the DLL that I am trying to call from the packed library. This VI modifies an Excel spreadsheet so it needs the vi.lib. In my DLL project, vi.lib is in my dependencies. When I compile my DLL, Labview will create four folders (NI_Excel, NI_HTML, NI_report, NI_Standard Report) at the build destination.  
    To problem happens when I run a Top level VI, which calls-> the lvlibp -> lvclass (within the packed library) -> DLL (uses the vi.lib Excel functions).
    This problem doesn’t happen when I am not running the packed library (Only with the lvclass). So I think the problem is that DLL can’t access or find the vi.lib when it’s being called by the packed library. It seems like the packed library changes the way the DLL access the vi.lib.
    Any suggestions?

    Hi,
    Thank you for your reply. Unfortunately, I think I might have provided wrong information. I thought the problem didn’t exist when I wasn’t running the packed library, but the truth is, the problem always exist regardless.
    I would get an “error 7” when I created a simple VI that would utilize “Call Library Function Node” to call the DLL.  
    Error 7 occurred at Get LV Class Default Value.vi
    Possible reason(s):
    LabVIEW:  File not found. The file might have been moved or deleted, or the file path might be incorrectly formatted for the operating system. For example, use \ as path separators on Windows, : on Mac OS X, and / on Linux. Verify that the path is correct using the command prompt or file explorer.
    =========================
    NI-488:  Nonexistent GPIB interface.
    Complete call chain:
         Get LV Class Default Value.vi
         NI_report.lvclass:New Report.vi
         Create Summary Log.vi
         Create Summary Log.vi.ProxyCaller
    LabVIEW attempted to load the class at this path:
    C:\XXX\XXX.dll\Excel\NI_Excel.lvclass
    So the problem is, I don’t know how to include the NI_Excel.lvclass in my DLL. I didn’t have this problem back in 8.2, as I would just include a VI (with the excel VIs in the block diagram) in the project when I build it. This doesn’t work anymore as I am using 2011. 

  • Can I call a dll with a C++ Class Cstring variable?

    So,
    we bought an optiphase interferometer, and it comes with a dll and with LabVIEW example code.
    However, there is a big problem!
    The dll is a C++ dll and requires the C++ Cstring class!
    for example I can't get the function Boolean LoadDemodulatorDSPCore(Cstring arg1, U8Bit arg2) to work.
    They did provide a GetDllVersionchar(Cstr arg1, long arg2) which does work, (offcourse, it uses a standard C string pointer)
    but GetDllVersion(Cstring arg1) does not work. (offcourse not, it using the Cstring class)
    Is there a way to get CString classes to work in LabVIEW? (with a struct, or an binary array or whatever?)
    Or do I have to write a wrapper dll to convert CString classes to standard C string pointers?
    Thanks.

    Nils Gokemeijer wrote:
    So,
    we bought an optiphase interferometer, and it comes with a dll and with LabVIEW example code.
    However, there is a big problem!
    The dll is a C++ dll and requires the C++ Cstring class!
    for example I can't get the function Boolean LoadDemodulatorDSPCore(Cstring arg1, U8Bit arg2) to work.
    They did provide a GetDllVersionchar(Cstr arg1, long arg2) which does work, (offcourse, it uses a standard C string pointer)
    but GetDllVersion(Cstring arg1) does not work. (offcourse not, it using the Cstring class)
    Is there a way to get CString classes to work in LabVIEW? (with a struct, or an binary array or whatever?)
    Or do I have to write a wrapper dll to convert CString classes to standard C string pointers?
    Thanks.
    I'm afraid this won't really be
    possible without a wrapper DLL. A CString is more like an object with
    internal pointers and last time I checked into a DLL with a
    disassembler it seemed that the actual layout of the internal structure
    depends on the size of the string that is contained, with small strings
    being entirely embedded and larger strings being a pointer to the
    string. Trying to figure out these difficulties is something you should
    leave to compiler developers and not try to do yourself.
    One way that might be possible is to actually only create three or four
    C functions that are exported by a helper DLL. These functions would
    allocate a CString, copy a CStr into it and out of it and one to
    deallocate it. As far as LabVIEW is concerned you would treat the
    CString simply as a uInt32.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • When  I am uploading  file with special character it gives error

    Hi All,
      I am uplloading one file with special character then it gives error. Please let me know solutions on this is soon as possible.
    Thanks,
    Madhav

    hi are you looking for the file to be transferred with the special character then declare it wil the char field...and send it..
    or the special charactera are coming unnecessary use the command ............replace all occurances  to avoid this..

  • Calling a DLL with a & (ampersand) in the declaration

    Hi,
    I'm trying to call an external DLL and having issues calling an important function.  The 'FindDevices' call has the following declaration:
    long FindDevices(long &DeviceCount);
    I've never come across calling an external function with an ampersand (indicating that a reference, rather than a pointer, shall be passed) before.  Is this possible with LabView?
    I've tried many permutations of the DLL configuration, but it usually crashes the entire development environment.  Here is a link to the DLL and *.h file if you'd like to give it a shot.  It's a 64-bit DLL, and I've been developing this on 64-bit Labview and Windows 7 x64.  It also requires the configuration file 'ZStepperSettings.xml' to be in the same directory as the DLL.
    Thanks for your time.
    Attachments:
    ZStepper_SDK.h ‏6 KB

    For scalars the C++ reference syntax should be equal to a standard C pointer. For other datatypes that is certainly not guaranteed. Since long is a scalar I would guess the problem to be elsewhere. Are you sure the calling convention is correct?
    Also the effect that it only causes the 1097 error sometimes, as well as crashing only sometimes is not so strange. There is no supervisor that can 100% surely detect if there is some memory violation during a call to an external function. Eventhough the parameter configuration is wrong or the DLL does something bad, this doesn't always result in a behaviour that LabVIEW could detect or would always cause a crash. It depends on the actual memory layout of your process at the moment this function is called if the error will be causing one of these problems. But be assured that if there is an error in how the function is configured or a bug in the function about how it access the memory especially for writing operation, something bad is done to the memory that will sooner or later cause very serious problems to your application.
    EDIT: It seems that while C++references for scalar types are usually implemented as pointers by the compiler, there is nothing in the C++ standard that mandates this nor defines in any way how they should be implemented. So basically C++ references are not a safe datatype to use if you want to allow a function to be callable by anything else than code compiled with the same C++ compiler. Basically anything C++ specific is not safe at all in that sense. And anything standard C conformant mostly only by convention and not by specific requirements set forth in the C standard.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to call a DLL with a char or a uint8_t

    Good afternoon,
    I need to pass an array (image) to my dll.
    I was able to successfully do this using 
    imageProcess(int **a, ... ){;}
    function declaration and using a signed or unsigned 32 bit integer as data type in labview DLL call
    However, when I changed my function to either
    imageProcess(char **a, ... ){;}     or       
    imageProcess(uint8_t **a, ... ){;}
    And when  I set the Labview Dll Call data type to    unsigned 8 bit integer
    I get a Broken Arrow
    With error: The function name specified for this node cannot be found in the library. Right-click the Call Library Function node and select Configure, then choose the correct function name.
    I am also using IMAQ ImageToArray to obtain my array and using the ImagePixels(U8) output
    Thank you,

    Another possibility to make functions be unmangled is declaring them as extern "C" like this:
    for a single function.
    #define LibFunction __declspec(dllexport)
    extern "C" MgErr LibFunction MyFunction(uInt8 *);
    or:
    #define LibFunction __declspec(dllexport)
    #if defined(__cplusplus) || defined(__cplusplus__)
      extern "C" {
    #endif
    LibFunction MgErr MyFunction1(void);
    LibFunction MgErr MyFunction2(uInt32);
    #if defined(__cplusplus) || defined(__cplusplus__)
    #endif
    for multiple function prototypes.
    This will tell the compiler to not mangle the names if it is invoked on a cpp file. And the LibFunction declaration is to declare the function as exported to the compiler, saving you to have to provide a DEF file for that purpuse. Remember that other compilers and platforms might and often do use a different syntax for the export declaration.
    And alternative could be:
    #define LibFunction(retval) extern "C" retval __declspec(dllexport)
    LibFunction(MgErr) MyFunction(uInt8 *);
    Also before claiming that there is a huge bug in LabVIEW that needs fixing you should make sure that you understand all in and outs of your C compiler toolchain. Something I wouldn't dare to claim to do!
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to call a dll with special parameters in Labview?

    Hi,
    I have a dll file (compiled in C++) and I would like to call the individual functions from this dll file.
    I do not know however, how I must correctly define the initial parameters in LabView.
    That is the function, which I would like to call:
    DWORD OpenDiagDriver ( char* port,
    LPCSTR path,
    CANObjects CANObj[],
    WORD BitTiming = 0x4167);
    CANObjects CANObj[] is a pointer to array with CAN configuration data
    typedef struct
    DWORD Ident;
    BYTE Config;
    }CANObjects;
    CANObj[0].Ident= 0x18DA0000;
    CANObj[0].Config= 0x8C;
    CANObj[1].Ident= 0x18DA0000;
    CANObj[1].Config= 0x84;
    WORD BitTiming= 0x4167;
    I made a vi, but it doesn’t work.
    Attachments:
    example.vi ‏29 KB

    Hard to say without the full C source. Are you building the DLL according to the CIN rules (see Using External Code in LabVIEW)? Mapping clusters to C code in DLLs is not a simply process and we generally recommend to create wrappers. However, since your structures are fairly straightforward, you could use the "Adapt to Type" as you are trying to do.
    I recommend checking out the mentioned manual and also the examples in \examples\dll\data passing\Call Native Code.llb and the associated C files.
    Brian Tyler
    http://detritus.blogs.com/lycangeek

  • Call a DLL with Java

    Hi,
    I have a C ANSI DLL which communicates with a JAVA applet. I use JNI.
    But this isn't the best solution :
    the host which is running the applet (Internet Explorer) must have the DLL in local and a .java.policy file in order to run the applet.
    Is there another technology which can avoid that problem ? Using no .java.policy and dll file on the host, ie put the DLL only on the server ?
    Thanks for your suggestions.

    You could certainly have your applet make calls back to the server and have the server execute the non-secure code in the DLL. This, of course, assumes that you don't actually need to run the DLL on the client itself.
    For the case where you just need to make a couple of calls into the DLL, you could implement your own socket communication. For anything more complicated, I'd recommend that you look into RMI.
    Note that it'll be a lot slower doing your DLL calls across the wire, so in this situation, you want to do as much processing on either end of the communication channel as possible, and only transfer results back and forth.
    - K

  • Calling a .DLL with Adobe AIR

    Hi!
    Is there a painless way to call a method of a windows dll from Adobe AIR?
    Thank you!

    Can anyone help me how to call DLL file in air2.0? Could you please give some good example...

  • Call a storedprocedure with CLOB input parameter gives ORA-24811 error

    Hi all,
         I am calling a storedprocedure from VB using ADO and OraOLEDB. Calling stored procedure as mention in OraOLED documentation.
         The procedure accepts a varchar and a CLOB parameter.
         While executing the store procedure its throw an error as “Error while trying to retrieve text for error ORA-24811”
         Then I executed a storeprocedure with only one CLOB out parameter. It is working fine.
         Oracle version is
    Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
    PL/SQL Release 9.2.0.4.0 - Production
    CORE 9.2.0.3.0 Production
    TNS for Linux IA64: Version 9.2.0.4.0 - Production
    NLSRTL Version 9.2.0.4.0 - Production
         O/S: Linux.
         OLEDB version 9.0.1.0.1
         But exact code working with
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    PL/SQL Release 9.2.0.1.0 - Production
    CORE 9.2.0.1.0 Production
    TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
    NLSRTL Version 9.2.0.1.0 – Production
    O/S window 2003
    OLEDB version 9.0.1.0.1
    Can somebody help me on this?
    Regards,
    Mani
    Sample code of stored of stored procedure and VB function pasted below.
    StoreProcedure
    ============
    create or replace procedure xmltext (EmpName varchar2,EmpDetails CLOB)
    as
    begin
    insert into emptmp values (EmpName);
    end;
    VB function
    =========
    Dim Oracon As New ADODB.Connection
    Dim cmd As New ADODB.Command
    Dim param1 As New ADODB.Parameter
    Dim param2 As New ADODB.Parameter
    Dim empname As String
    Dim empdetails As String
    Set Oracon = CreateObject("ADODB.Connection")
    Oracon.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=testdb;User ID=newtest;Password= newtest;PLSQLRSet=1;SPPrmsLOB=1"
    Oracon.Open
    empname = "Mani"
    empdetails = "<EmpDet/>"
    Set cmd.ActiveConnection = Oracon
    cmd.CommandType = adCmdText
    Set param1 = cmd.CreateParameter("param1", adVarChar, adParamOutput, 10, empname)
    cmd.Parameters.Append param1
    Set param2 = cmd.CreateParameter("param2", adLongVarChar, adParamInput, 10000, empdetails)
    cmd.Parameters.Append param2
    cmd.CommandText = "{ call xmlText(?,?)}"
    cmd.Execute

    code for my procedure testblob is :
    create or replace procedure testblob(bpic blob) as
         val               blob;
         v_rdata          blob;
         v_start          BINARY_INTEGER := 1;
         v_buffer     BINARY_INTEGER := 32767;
    BEGIN
    select pic into val from my_pic where no=1 for update;
    DBMS_LOB.OPEN (val, DBMS_LOB.LOB_READWRITE);
    FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(bpic) / v_buffer)
         LOOP
         v_rdata :=DBMS_LOB.SUBSTR(bpic, v_buffer, v_start) ;
         DBMS_LOB.WRITEAPPEND(val, DBMS_LOB.GETLENGTH(v_rdata), v_rdata);
         v_start := v_start + v_buffer;
         END LOOP;
    dbms_lob.close(val);
    exception
         when others then
              raise_application_error(-20000,sqlerrm);     
    end;

  • Calling a Web Dynpo appl from POWL gives error

    Hi,
    I have created a custom webdynpro application integrating  with POWL using the document provided by Saurav Mago .Refer the link below
    But I get the following error 'Parameter APPLID contains an invalid value.
    '[Integrating POWL with WebDynpro ABAP|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60f1d5ee-84ab-2c10-ce97-97dfd89bc238?quicklink=index&overridelayout=true]
    I have searched  SDN , debugged my application and checked the configuration and compared with the standard powl components, as well. But I am not able find out what the issue is.
    I have tested the standard webdynpro apps and my app as well , services are active , the break point also stops in the window/view. But not sure what I am missing.
    Can you please let me know if you got any idea regarding this. Appreciate your response.
    Thanks
    Saujanya

    Hi Thomas,
    Thanks for your response. Please find
    How are you building the URL to test?
    I am using the custom webdynpro application to test it . When I test it using the standard POWL, it works. But if I test from my custom webdynpro application , it gives the dump with this error message.
    Are you sure you Application ID is correct?
    If it works with the standard, I think the config is right
    I have created POWL appli, type , , powl query , mapped the query to the powl applid, activated it, mapped query to the powl type.
    Declared the powl_ui_component in the component usage , view container in the view and  an out bound plug to the view with parameters and code as mentioned below :
    code :
    wd_this->fire_out_plg(
        applid =  'ZTEST_APPLID'                         " string
        forallq =   ''                                   " powl_xflag_ty
        qname =  'ZPOWL_QUERY'                      " powl_query_ty
        qselpara =  ''                        " string
        refresha =  'X'                       " powl_xflag_ty
        refreshq =  ''                        " powl_xflag_ty
        srvgroup =  ''                       " powl_xflag_ty
        powldeltarendering = 'X'
    Can you share the full URL you are testing with here?
    http://cis0440.g2t1.XXXgen.com:8040/sap/bc/webdynpro/sap/ztest_applid
    Please let me know if I am missing something.
    Thanks
    Saujanya

  • Using boost::thread with Sun Studio C++ gives error

    Hi,
    I'm trying to compile a code which uses the boost thread library, but I get the following error:
    CC -library=stlport4 -features=tmplife -features=tmplrefstatic -mt -c -o t t.cpp
    "/opt/boost/include/boost/thread/pthread/mutex.hpp", line 142: Error: The function "pthread_mutex_timedlock" must have a prototype.
    "/opt/boost/include/boost/thread/pthread/mutex.hpp", line 142: Error: The function "pthread_mutex_timedlock" must have a prototype.
    "/opt/boost/include/boost/thread/detail/thread.hpp", line 344: Error: boost::thread::thread(boost::thread&) is not accessible from boost::move(boost::detail::thread_move_t<boost::thread>).
    "/opt/boost/include/boost/thread/pthread/recursive_mutex.hpp", line 179: Error: The function "pthread_mutex_timedlock" must have a prototype.
    "/opt/boost/include/boost/thread/pthread/recursive_mutex.hpp", line 179: Error: The function "pthread_mutex_timedlock" must have a prototype.
    5 Error(s) detected.
    make: *** [t] Error 5the sample source code in question here just a single include:
    #include <boost/thread.hpp>This is with boost 1.40.0. I wonder what I'm doing wrong..
    Akos

    OK, I tried latest version of CC from Sun Studio 12 update 1 and can say that
    - the error about constructor not being accessible is Sun C++ compiler "feature" (only called feature because it existed for so long) that allows binding of rvalues to non-const references; this "feature" will probably be turned off in the next release. It can't be changed in a patch because client's code might rely on it.
    - the other errors are also not Boost-specific: the result of incompatibility of Linux headers and Sun C++ compiler; more thorough investigation is due, but in the past we had several problems like this. This particular can be solved by adding
    -D_GNU_SOURCE to compile line.

  • Rendering a flex component gives error??

    Hi.  I want to render or re initialize a flex component on the action of another event. I tried using init on the event to re initialize the component but it gives me an error ( error in list List.as). Can there be some other way to render the Flex component? When i select "dismiss all" in the error the code seems to be working fine, so is there a way so that the actionscript error is not displayed and the dismiss all button is selected by default?
    Any help would be really appreciated. 

    Try import containingFolder.DebuggingTool;
    new DebuggingTool;
    HTH,
    Carlos

  • Installing component gives error

    Hi,
    I am facing a pretty wierd problem.
    I am using "HideStandardCheckinAndSearch" component.
    If I use the zip file downloaded from the Oracle Site(HideStandardCheckinAndSearch.zip) and install this component, it installs easily.
    When the same component I download through Advanced Component manager Screen from UCM from one environment so that same can be used in another,
    it downloads as a "manifest.zip".
    I unzip it, the folder structure created is as --->
    manifest(folder) --->mainfest(folder) ---> Component(folder) and manifest(hda file) ---> Clicking on component folder ---> HideStandardCheckinAndSearch(folder) ---> resources(folder) , HideStandardCheckinAndSearch(hda file) , hidestandardcheckinandsearch_environment(cfg file and readme file).
    I rename the second manifest folder as "Hidestandardcheckinandsearch" and zip it so that is same as the one I downloaded from Oracle Site but once tryng toinstall i get teh following error :
    "Event generated by user 'weblogic' at host 'localhost:16200'. Unable to execute service GET_COMPONENT_INSTALL_FORM and function saveComponentZip.
    Unable to find 'manifest.hda' in 'D:/Oracle/Middleware/user_projects/domains/base_domain/ucm/cs/vault/~temp/1125732838.zip' zip file "
    I am not able to understand what wrong I am doing ....
    Any help in clarifying this would be great.
    -shashwat

    Your top level should be your component folder & manifest.hda file.
    You've probably gotten confused with the folder names when you unzipped and it created a new top level folder for you. Also, you can embed components inside each other, so that can also complicate the structure of a component.. but, usually the embedded components are just zip files, so it's not too unique.
    Take your zipped component and compare it against an ootb zipped component. Or, let the component wizard zip up your component for you.
    -ryan

  • Opening xapp1082 with Vivado 2015.2 gives errors (pl_eth)

    After sourcing pl_eth.tcl I get the first problem, I had to update manually (in pl_eth_bd.tcl) the AXI ethernet version from 6.2 to 7.0.
    Fixed this problem I get the following:
    INFO: [Device 21-403] Loading part xc7z045ffg900-2 Wrote : </home/parallels/vivado/xapp1082_2014_4/hardware/vivado/runs_pl_eth/pl_eth_sfp.srcs/sources_1/bd/design_pl_eth/ip/design_pl_eth_axi_ethernet_0/bd_0/bd_0.bd>
    Wrote : </home/parallels/vivado/xapp1082_2014_4/hardware/vivado/runs_pl_eth/pl_eth_sfp.srcs/sources_1/bd/design_pl_eth/ip/design_pl_eth_axi_ethernet_0/bd_0/bd_0.bd>
    WARNING: [PS7-6] The applied preset does not match with board preset. You may not get expected settings for board. The ZC706 preset is designed for ZC706 board.
    ERROR: [BD 41-80] Exec TCL: Specified object '' does not exist. Please use an existing object name
    ERROR: [BD 5-14] Error: running create_bd_segment.
    ERROR: [Common 17-39] 'create_bd_addr_seg' failed due to earlier errors. while executing "create_bd_addr_seg -range 0x40000 -offset 0x43C00000 [get_bd_addr_spaces processing_system7/Data] [get_bd_addr_segs axi_ethernet/s_axi/Reg] SEG_axi_et..." (procedure "create_root_design" line 103) invoked from within "create_root_design """ (file "pl_eth_bd.tcl" line 300) while executing "source pl_eth_bd.tcl" (file "pl_eth.tcl" line 21) set_property source_mgmt_mode DisplayOnly [current_project]

    I went through the annoying process of opening the xapp1082 design using Vivado 2014.4 (I sourced pl_eth.tcl), then I opened the resulting project using  Vivado 2015.2 with no luck. The "upgrade" process got stuck while upgrading one of the IP.
    Result is that the bitstream cannot be generated.
    Anyone can point in the right direction?
    Furthermore, why Vivado is not provided as a web application? Like Google Docs, I mean. This would avoid pushing gigabytes of software to customers. I would pay for such a service. 
    Regards,
    Antonio.

Maybe you are looking for