[Q] Using a VC++ DLL from LabWindows

I need to create a DLL that uses shared memory. I can do
this with Visual C++ but haven't succeeded doing it with
LabWindows.
So now I want my LabWindows executable to use the VC++ DLL.
I'm having trouble because some identifiers are "redefined"
(defined both in the needed VC++ include files as well as in
CVI include files).
Can someone tell me either how to create a DLL that uses
shared memory in LabWindows (this is my preferred solution)
or else how to use a VC++ DLL from LabWindows?
My ultimate aim is to use the shared memory to share
instrument session handles, since we need to be able to talk
to the same instrument from more than one process. Has
anyone already done this?
TIA for any help ...
B
* S
ent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!

Hello andre,
today I have read your message of the 20th Sept. 1999 in the NI-Newsgroup.
And I am also trying to use SHARED MEMORY.
But I have no experience with it. Could you help me?
Do you have succeded ?
With best regards,
CHRISTIAN ZIPPER
ande schrieb in im Newsbeitrag:
[email protected]..
> I need to create a DLL that uses shared memory. I can do
> this with Visual C++ but haven't succeeded doing it with
> LabWindows.
>
> So now I want my LabWindows executable to use the VC++ DLL.
> I'm having trouble because some identifiers are "redefined"
> (defined both in the needed VC++ include files as well as in
> CVI include files).
>
> Can someone tell me either how to create a DLL
that uses
> shared memory in LabWindows (this is my preferred solution)
> or else how to use a VC++ DLL from LabWindows?
>
> My ultimate aim is to use the shared memory to share
> instrument session handles, since we need to be able to talk
> to the same instrument from more than one process. Has
> anyone already done this?
>
> TIA for any help ...
>
>
> B
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network
> The fastest and easiest way to search and participate in Usenet - Free!
>

Similar Messages

  • How to get a handle which is used in c dll from  javax.smartcardio.card

    good afternoon
    i am using javax.smartcardio.card to operate a sim-card reader .
    but i have a dll which is call sim-card reader by handle.
    how can i get a handle from a javax.smartcardio.card object to pass to the dll
    next is the code .
    c dll prototype declaration
    char DoFormat([in] unsigned long P1�C[in] char * P2�C[in] bool P3,[in][out] char *P4)P1 is a handle
    java code:
    private boolean checkCardReader(boolean isopen)
    boolean r=false;
    try {
    javax.smartcardio.card card;
    TerminalFactory factory = TerminalFactory.getDefault();
    List terminalList = factory.terminals().list();
    terminal = (CardTerminal) terminalList.get(0);
    // establish a connection with the card
    card = terminal.connect("T=0");
    channel = card.getBasicChannel();
    //how can i get a handle which can be used by windows dll .
    }catch (Exception ex)
    System.out.println("Exception : " + ex);
    return r;
    *****************************************************************

    Presumably you are calling a C library method that returns a handle.
    Normally a handle will be a integer type value.
    With such a value you can cast it into a java integer type and then cast it back in different JNI code by passing it to those routines.
    A java long is as big as you can get and will hold most every normal type handle item. You should however verify sizes.

  • Control LabVIEW DLL from LabWindows GUI only

    Hello,
    I have been developing an application in LabWindows/CVI and have recently built some auxiliary applications in LabVIEW.  My goal is to make the LabVIEW applications into a DLL and call them from the LabWindows app; however, one of my LabVIEW VIs has a front panel control and a local variable to stop a pair of asynchronous while loops.  What I would like to do is remove/hide the front panel of this LabVIEW VI and control the VI from the LabWindows GUI exclusively.  Is this possible?
    Thanks!
    Slowpoke
    Slowpoke
    CLAD (believe it or not!), using LabVIEW 8.5
    They don't call me "Slowpoke" for nothin'!

    Hi, David,
    Once I figured out how to make a front panel control into a parameter, I had what must be a common reaction among LabVIEW users: Can it really be that easy?  Thank you for your reply and your assistance.
    Slowpoke
    Slowpoke
    CLAD (believe it or not!), using LabVIEW 8.5
    They don't call me "Slowpoke" for nothin'!

  • How to use COM DLL in LabWindows

    Hello
    I have a COM .dll which looks like that when opened with dll export viewer:
    I would like to use the Get4AxisPos function in LabWindows.
    I understood that, as I only have the .dll, the only way of calling these functions are with the LoadLibrary() and GetProcAddress() functions.
    My problem is that the Get4AxisPos function is not of type Exported Function but COM Method so I don't know how to use it in my LabWindows project!
    My questions are: Is it possibleto use this dll in Labwindows? If yes how?
    Thanks
    Solved!
    Go to Solution.

    Hi ,
    I am new to C++ and COM  .
    i need to implement a client application in C(lab windows CVI) , server is a c++ COM object.
    steps followed by me
    ---> accessed the registered COM object with Labwindows CVI active x controller template,output was a c file which is implementation of the class names in COM (interfaces).
    I can use majority of the functions directly from the generated, but i need to implement some event functions like message box events and then use it.
    I have seen one method of accessing in C++ client sample ,
    which implements Queryinterface function...takes the IID_Unknown as input and returns interface pointer(inhereted static_castof the required class, uses static_cast for that) as output.
    when i try to follow up the same in c , i am lost  with the inheritance concept.
    In short i need to send IID Unknown to the Queryinterface function and should get the interface pointer of message box type or other class type ...
    Sorry for the long mail,Please guide me
    Thanks in advance ,
    Satish

  • Error while using LabVIEW 8.2.1 Dll from Visual C++ 6.0

    I am getting an error while using a LabVIEW 8.2.1 dll from Visual C++ 6.0 application. This is what I am doing:
    1) Created a dll using LabVIEW 8.2.1 (I used a tutorial from NI knowledge base: "Creating DLLs from 6.0i". It is a temperature conversion VI; input DegreeF and get DegreeC out). Instead of LabVIEW 6.0i, I used 8.2.1. It created the dll Convert_Temp.dll successfully.
    2) Then I created a Visual C++ 6.0 application (used a tutorial from NI knowledge base: "Calling a DLL from Microsoft Visual C++ that was Generated by LabVIEW 6i). I could build the project and create an executable application F_To_C.exe.
    3) Then copied the LabVIEW dll Convert_Temp.dll into the folder where F_To_C.exe resides. Using windows explorer, went into that folder, and executed the application.  I got the following error:
    System Error 998 while loading the LabVIEW run-time engine (C:\Program Files\National Instruments\Shared\LabVIEW Run-Time\8.2\lvrt.dll).
    Convert_Temp requires a version 8.2.1 (or compatible) LabVIEW Run-Time Engine. Please contact the vendor of Convert_Temp to correct this problem.
    I checked the folder: C:\Program Files\National Instruments\Shared\LabVIEW Run-Time\8.2\. It has the file lvrt.dll.
    So why am I getting this error?
    GKB

    sounds like you need to install the LabVIEW 8.2.1 runtime. Not the 8.2 runtime engine.
    Paul <--Always Learning!!!
    sense and simplicity.
    Browse my sample VIs?

  • Level of local SQLCE/other DB support in windows phone 8.1/using linq to sql from dll?

    I have had a mixed opinion for SQLCE support in windows phone 8/8.1. Is their still support for a local SQLCE or other database in windows phone 8.1? (A lot of different blog articles created their own handlers it appears and one used
    an visual studio app called SQLmetal) I am hoping to at least figure out the libraries to use for Linq to SQL in windows phone 8.1 in order to access a local Database. I only need to retrieve data from a simple Database with one -
    two tables and one of the tables has three fields.
    I wish to access the local DB from a dll file even if I have to use Linq to SQL. The reason for this is to store data for a simple game while the app is running. However, I may need to send data to the database and would like to separate that
    from the main application if possible. The only other question is: how do I add local database support to a dll file in windows phone 8.1? (This is my main objective but I need to know my database options first)
    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering
    - Yoda. Blog - http://www.computerprofessions.co.nr

    Windows Phone Silverlight 8.1 apps can still use LINQ to SQL (System.Data.Linq) see:
    http://msdn.microsoft.com/en-us/library/windows/apps/hh202860(v=vs.105).aspx
    For Windows Phone 8.1 [runtime] app you would need to use an external library like
    SQLite 
    There is a jumpstart training talk on using SQLite in Windows Phone 8.1 apps here:
    http://channel9.msdn.com/Series/Building-Apps-for-Windows-Phone-8-1/19
    I'm not sure what you mean by: "...access the local DB from a dll file..."  Do you mean you want the library used to access the database to be portable across
    platforms?
    Eric Fleck, Windows Store and Windows Phone Developer Support. If you would like to provide feedback or suggestions for future improvements to the Windows Phone SDK please go to http://wpdev.uservoice.com/ where you can post your suggestions and/or cast
    your votes for existing suggestions.
    I saw the first link and I think I have already been through some of that tutorial on channel 9 already.
    I'm not sure what you mean by: "...access the local DB from a dll file..."  Do you mean you want the library used to access the database to be portable across platforms?
    This would be a yes. I need use it to submit an application to the store (I wish to have the data and business logic in the dll file while having the GUI separate). I am currently using the portable dll but if you think using another dll type would help
    I will try that. I am a VB.NET programmer and so I can see where some programmers get their worries about SQLCE (It seems a lot of VB and VB.NET programmers like it from my time helping on the VB.NET forums second to SQL Server only).
    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering
    - Yoda. Blog - http://www.computerprofessions.co.nr
    Nevermind, I changed the dll type to "Silverlight" and I can use the System.Data.Linq reference at least.
    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to
    suffering - Yoda. Blog - http://www.computerprofessions.co.nr

  • To read a DLL from java using JNI

    Hi,
    I had some DLL files (VB 5.0) which are providing interfaces. Is there any chance of accessing that using java (JNI). Also is there any De - Compiler available so that I can get the source code of the DLL file.
    Regards,
    Hari.

    Hola Hari
    To make a dll loadable through JNI, the interface
    inside
    the dll must be implemented the JNI way. Also a COM
    interface does not help.
    I would reccomend a certain product to automatise the
    JNI interfacing process, but that would
    require that you have the sourcecode of the dll
    available.
    But one thing you can do is to write a wrapper that
    contains the dll classes and is implemented the JNI
    way.
    More precisely you write an interface wrapper in c/c++
    that matches the methods of the dll and does use JNI
    methods. Now inside that c++ wrapper you load the dll
    and forward the calls from java to c++ vice versa.
    Download the demo version of CENTRO.java here:
    www.ablon.de
    Bye, nilsHi Nils,
    Thank you for your suggestion. Im new to JNI.
    That dll's are in Visual Basic. I don't have the source code of the dll file. I got the interfaces available in the dll file from a Visual Basic program which make use of the dll file(which we are talking about). As I know only the method signatures in the interfaces(dll file), I request you to kindly provide me some help to wrap it in C/C++ program.
    Thanks in advance.
    Regards,
    Hari.

  • Using LV DLL from C++

    Hello,
    I've read questions about calling LV DLL with front panel.
    It is recommended to change the configuration to reentrant and not to use UI model.
    I made this but my dll still does not display her front panel when called from my C++ application.
    It seems to run in background.
    Any help?

    To show the front panel of your DLL you will need to use VI properties>>Window Appearance>>Customize. Set the Front Panel when called option. This will open the front panel to your DLL when the DLL is called.
    If you call the DLL from a LabVIEW VI running in the user interface thread (a.k.a. execution system) you will get a deadlock if the VI called inside the DLL needs to do some work (such as showing its front panel).
    To work around the deadlock, you must make sure that the DLL is called from a thread other than the user interface thread. To do so, first configure the shared library node to be "Reentrant" rather than "Run in UI Thread". Then make sure that the VI is not running in the UI thread by looking in VI Properties>>Execution>>Preferred Execution S
    ystem
    I think the same would apply if called from a C++ application.

  • I want to use a VposCOMAPI.dll, written by vs2010,  from PB9 or later.

    I want to use a VposCOMAPI.dll, written by vs2010,  from PB9 or later.
    I use the following code:
    OLEObject obj
    int ret_code, ret_Code2
    obj = create OLEObject
    String Auth_code, Rsp_code,  Rsp_msg
    ret_code = obj.ConnectToNewObject("VposCOMAPI.dll")
    if ret_code <> 0 then
       destroy obj
       messagebox("error", "Error !" + string(ret_code))
       return
    else
       obj.apiInit()
       obj.CARD_NO="9999111188882222"
       obj.MERCHANTID = "0909090909"
       obj.executeAuth()
       ret_Code2 = obj.AUTH_RETCODE
       if ret_Code2 = 0 then
           Auth_code = obj.APPROVE_CODE
           Rsp_code = obj.RESPONSE_CODE
           Rsp_msg = obj.RESPONSE_MSG
           messagebox("OK", "OK !")
       else
           messagebox("error2", "Error2 !")
       end if
       destroy obj
    end if
    I got the ret_code “ Errorcode  -2 ( Class name not found )”.
    Anybody could help me ?
    Could I use the VposCOMAPI.dll in this way ?
    Thanks !
    Jack
    PS : The VposCOMAPI.dll works in VS2010
    1 Add Reference --> Browse
    2 VB sample code
    Public Class Form1
    Dim ac As New VposCOMAPI.ApiClient
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim retCode As Integer
    rspCode.Text = ""
    rspMsg.Text = ""
    approveCode.Text = ""
    txnNo.Text = ""
    txnDate.Text = ""
    apiResult.Text = ""
    ac.setPORT(443)
    ac.setLogFile("D:\workTemp\vposApi.log")
    ac.setURL("nccnet-vpostest.nccc.com.tw", "/vposMert/servlets/apiControl")
    ac.setMERCHANT_ID(merchantId.Text)
    ac.setTERMINAL_ID(posId.Text)
    ac.setEXPIRE_DATE(expireDate.Text)
    ac.setCARD_NO(cardNo.Text)
    3 C# sample code
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Diagnostics;
    using System.IO;
    using VposCOMAPI;
    namespace testCSapi
    public partial class Form1 : Form
    public Form1() {InitializeComponent();}
    private void send_Click(object sender, EventArgs e)
    int retCode = 0;
    ApiClient ac = new VposCOMAPI.ApiClient();
    ac.setURL("nccnet-vpostest.nccc.com.tw", "/vposMert/servlets/apiControl");
    ac.setLOGFILE("D:/workTemp/vpos/log/testCSapi.log");
    ac.setMERCHANT_ID(merchantId.Text);
    ac.setTERMINAL_ID(posId.Text);
    ac.setEXPIRE_DATE(expireDate.Text);
    ac.setCARD_NO(cardNo.Text);

    Hi,
    A few things to remember. They must be 32-bit ComVisible or COM Interop registered assemblies.
    You need to use the ProgId to connect to; have you checked if they were visible in the browser?
    As Jacob mentions,
    These have been discussed before by Bruce, particularly in the PowerBuilder Deveopment Center and in other places.
    A few more references:
    http://scn.sap.com/message/14156871#14156871
    http://scn.sap.com/community/developer-center/powerbuilder/blog/2013/02/28/using-net-assemblies-with-powerbuilder
    http://scn.sap.com/community/developer-center/powerbuilder/blog/2014/07/19/calling-net-assemblies-from-powerbuilder-classic-win32-via-powershell
    http://pbdj.sys-con.com/node/397016
    http://pbdj.sys-con.com/node/258395
    Ben

  • How use DLL from PL/SQL

    Dear Mr/Mrs,
    My system is
    1.Oracle Database 10g express edition(with apex 3.2)
    2.Windows 2003 server
    3.GSM Modem(usb cable + Vendor Provided dll for developer)
    4.Mobile SIM card
    Now ,i want to send SMS from Database.
    N.B: email to sms is not my intention
    Thanks
    Engr.M.K Chowdhury

    Hi,
    What's wrong with the last answer Re: Using DLL from apex ?
    Regards
    Peter

  • Executing DLLs from Java using JNI vs Runtime.exec()

    I am trying to understand the best way to execute a dll using java. The dll I am testing with takes a few input parameter. If I use JNI with System.loadLibrary("dll"); what do I need to do to pass the arguements in as well? Can I just add the arguements in the java code like private int xyz = "value"; and expect that the dll will accept them or is there special definitions I have to set up in the dll to make it work?
    Alternatively I was looking at using Runtime to execute the dll by using Runtime.exec("dll param1 param2",env,filePath); Does anyone know if there are drawback to doing it this way vs. using JNI or is this just as efficient? Any help would be appreciated.

    You seem to be confused...
    "execute a dll using java"
    Unless I'm mistaken, a dll is not executable. A dll is a library of code. This code has (hopefully) some well-defined entry points (declared in a header file somewhere) which you must call in a C/C++ file. The arguments you pass to the dll will come from java through JNI.
    As far as your understanding of this entire process, it is obviously confused beyond the scope of a simple reply. I recommend you read the examples and ALL of the documentation available here:
    http://java.sun.com/docs/books/tutorial/native1.1/index.html
    When you get the/an example running (or just set up to run) then post your code and comments here for more help.
    Ian

  • I am using a DLL from VC++ labview6.1 crash upon loading the DLL

    Labview crashes when I load my DLL from VC++ that calls device net software. It is only _stdcall function. Sometime my whole PC crash upon loading it. I Appreciate any help from anyone......

    Your problem is most likely caused by a memory error. Insure that you are passing the correct data types (especially pointers) into the Call Library Function and make sure that if the DLL is expecting any memory to be allocated that the proper data has been created in LabVIEW (for instance, if the DLL was expecting a string of a certain length, LabVIEW would need to create a string constant which was long enough to satisfy the DLL). Also insure that there are not any race conditions (conditions within LabVIEW in which the order of execution is not defined) which could cause your DLL to access memory which has not yet been allocated. You can generally fix race conditions by using sequence structures. Also, make sure that your DLL cleans up any memory that it all
    ocates.
    Hopefully that helps,
    Ryan
    NI Applications Engineer

  • Using cvirte.dll from teststand

    I am trying to use cvirte.dll from teststand to automatically print test result reports. I am starting with the example sequence PrintEntireReportWhenFinishedTesting.seq that I found on the NI website. I want to change the print font attribute. The dll doesn't include prototype information so I need information on the parameters for the SetPrintAttributeEx function. Specifically what number refers to the ATTR_PRINT_FONT_NAME attribute and what are acceptable values for the value of this parameter.
    Attachments:
    PrintEntireReportWhenFinishedTesting.seq ‏37 KB

    Wendell,
    I believe this question was also posted in the TestStand category. Since this is more of a TestStand question, it was seen and already answered. Please see Using cvirte.dll from teststand.
    Thanks!
    Shannon R
    Applications Engineer
    National Instruments

  • Trying to create DLL from VI to use in TestStand.

    I trying to create a DLL out of an existing VI file.  The VI has about 4 inputs and about 3 outputs.  If I go to Tools >> Build Application and select the Build Target as a "Shared Library (DLL)" i get a dll after the build; but when I try to call that DLL from teststand, it doesn't recognize any of the inputs or outputs.  How do I build a DLL so that teststand will reconize the inputs and outputs?
    Solved!
    Go to Solution.

    The controls and indicators are connected to the connectors.  Also, answering an earlier post, the prototype information for the inputs and outputs are not automatically displayed. I can manually define the prototypes, but then the question is how does each prototype link to its corresponding parameter (by name?). I've also tied creating just a simple VI that has just one string input and one string output.  I built the VI to a DLL and tried calling in TestStand and i get the same results.  I've inserted the resulting header file after that build.  Which, by the way, looks exactly like my other created DLL's header file.  The difference in bold(the name of the VI). Which makes me thik that my build DLL process might be off.
    #include "extcode.h"
    #pragma pack(push)
    #pragma pack(1)
    #ifdef __cplusplus
    extern "C" {
    #endif
    void __stdcall String_input_output(void);
    long __cdecl LVDLLStatus(char *errStr, int errStrLen, void *module);
    #ifdef __cplusplus
    } // extern "C"
    #endif
    #pragma pack(pop) 

  • How to use the checksumdll.lib in LabWindow/CVI to create CRCChecksum();

    Hi All,
    Any one know how to use the checksumdll.lib in LabWindow/CVI to create CRCChecksum() ?
    Thank you.

    Do you ave some documentation about that dll?
    Have you looked into dll properties searching for vendor name? Maybe you can look int vendorìs site and obtain some help.
    Ultimately: are you forced to use that dll or can you use any software to calculate the checksum? There are several CRCs that you can use: provided you know which is the type used you could find an algorithm to calculate the CRC and check an existing one.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

Maybe you are looking for

  • My 7th Generation iPod Nano shuts off whenever I press a button.

    I bought my iPod nano 16 GB a few months ago, and I noticed that sometimes, when I tried to open the screen (pressing the top button or the menu button) instead of opening, the iPod shut itself completely, and then rebooted, I could see the Apple log

  • Error while initializing OIM API in 11G

    I am trying to deploy a webservice exposing some of the OIM API's in 11G[11.1.1.5]. I am using the OIMClient API to initialize the API's. The following code works fine when I run with in the eclipse but doesnt work when it is deployed on the weblogic

  • Urgent !!! How to change Accounting document using Billing document number

    Hi experts, I have one requirement where I have to modify the accounting document using report. User will enter billing document no and I have to find out respective accounting document and I have to change header data.. I am very new to these module

  • Trouble using iTouch after using another computer

    Hi, My friend came over this past weekend and connected his iTouch to my iMac for a charge. While it was connected I put some music on his iTouch. When he went back to his home in Hiroshima he downloaded Google Earth but whenever he starts the applic

  • Free space in ASM

    Hi I want to delete a database instance. This is using ASM instance under it. Is there a way to release the space from ASM that is occupied by the datafiles of this instance so that the new database is able to use the this space? Thanks in advance