Using a dll in the JNI dll defined

Hello,
I'm new to JNI and I have managed to compile and run a simple Hello world program, now this is my problem:
The C++ code I'm using need to make calls to some dlls (msado15.dll and cdoex.dl) so that I have a function doing this (I have tested the function in pure C++ and it works):
#import "msado15.dll" no_namespace rename("EOF","adoEOF")
#import "cdoex.dll" no_namespace
* Class: AdaptorNative
* Method: login
* Signature: (Ljava/lang/String;)V
JNIEXPORT void JNICALL Java_AdaptorNative_login
(JNIEnv *env, jobject obj_this, jstring userId)
     printf("login\n");
     // Try to retrieve a pointer on a Connection object     
ConnectionPtr conn(_uuidof(Connection));
When I try to call the function in my JAVA code and run it, I have the following error:
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : unknown exception code occurred at PC=0x77e7f142
Function name=RaiseException
Library=C:\WINNT\system32\KERNEL32.DLL
Could anyone please help me? I have tried to include the path of the msado.dll and cdoex.dll in the java.library.path but it does not change anything.
Thanks
Tanguy

Thanks for replying but this does not seem to work.
* I have set the path to this libraries in the PATH and LIBPATH environment variables. (I'm on windows 2000 Server)
* I have loaded explicitly the library
* I have set the java.library.path variable in the VM to: .;paths to dlls
and I have still the same error except that now in the list of loaded libraries they seem to be loaded:
Dynamic libraries:
0x08DB0000 - 0x08DBD000 C:\SyncExchangeNative\syncmlclient_dbadaptor_SyncExchangeAdaptor.dll
0x620B0000 - 0x62460000      C:\Program Files\Fichiers communs\Microsoft Shared\CDO\cdoex.dll
0x1F440000 - 0x1F4B7000      C:\Program Files\Fichiers communs\System\ado\msado15.dll
I do not know if this is important but the msado.dll and cdoex.dll liberaries are for COM objects. They seem to define tlh and tld files.
I'm really desperate to find an answer with this... Please help me!
Thanks a lot
Tanguy

Similar Messages

  • To add the JNI dll to the jar file and use the dll inside the jar file

    Hi to everybody,
    I am new to java.
    I want to add the JNI dll to the jar file and use it in the java class.
    How can I achieve it.
    Please help me.
    Thanks in advance.
    Regards,
    M.Sivadhas.

    can't be done because none of the known operating systems support reading binary libraries from .jar files ... you can add the binary to the jar but then you have to extract it...
    besides, mixing platform specific and platfrom independent components is not a very good idea, i'd keep the dll out of the jar to begin with

  • How to use multiple instances of the same dll ?

    Hi,
    I'd like to use multiple instances of a jni dll . I have created
    different threads, in each thread, I have called System.loadLibrary(..),
    and I would like each thread to access a different instance of this
    library.
    Unfortunately, the loadLibrary function is effective only once so I
    can not find the way to do this.
    Can anyone help me on this ?
    Thanks.
    Francois.

    Hi, :)
    and I would like each thread to access a different
    instance of this library.In Win32, this is outright impossible. A DLL will only exist once in a process space.
    In Unix, or at least in Solaris, I think this is also not possible, as libraries are loaded by the dynamic linker, and it keeps tabs of which modules have already been loaded into the process space.
    I'm assuming your problem is that your native library has non-reentrant code.
    If so, there are two approaches you can take to this:
    1) If you have access to the source code for the native library, change it so that it is reentrant.
    2) If you do not, change your Java code so that access to the native code is made from whithin synchronize blocks.
    If your problem is of a different nature, I'll second the words of the previous poster and ask you what it is...
    Cheers,
    J.

  • How to link a wrapper DLL to the target DLL

    I appreciate your help!
    Question:
    In my project, I need to deal with a hybrid programming of C++ and Labview. The C++ part has been encoded into a DLL, which aims to do a complex mathematics. The main function in the DLL has the following form:
                              float RateEqCalculate(class CLaserPulse *Pulse, class CMaterial *Material, class CThresh *ThreshPara, class CRateResults &r);
    The four arguments are all of the class type. The first three arguments are used to input parameters to the function and the last one is used to record the process of computation. For example: class CLaserPulse is composed by several numerics and two functions as the following form:
    class CLaserPulse
    public:
     float fDuration;  
     float fWave;  
     float fNA;   
     float fRefrIndex;                                     // Refractive Index
     float fAbsCoeff;                                     // Absorption coefficient [1/m]
     CLaserPulse();
     virtual ~CLaserPulse();
     virtual double Shape(double dTime);       // gives Temporal Shape
     float SpotDiameter();                            // Calculate Spotdiameter
    As in labview "class" cannot be accepted as an argument of the "Library Function Node" directly, a wrapper DLL is required to translate the "class" to the type labview can understand. The following link is a good illustration of this process. http://labviewwiki.org/DLL/shared_library Given the argument class CLaserPulse has been converted into the wrapper DLL by the method from the link, how can I later link this wrapper DLL to the target DLL. My understanding is like this:
                                                                                                 Target DLL
                                                                                    float RateEqCalculate(
      class CLaserPulse  ->   wrapper DLL       .........linking.........        class CLaserPulse,
      class CMaterial      ->   wrapper DLL       .........linking.........        class CMaterial,
      class CThresh        ->   wrapper DLL       .........linking.........        class CThresh ,
      class CRateResults  ->   wrapper DLL     .........linking.........        class CRateResults );
    Am I right? Four wrapper DLL to four class type arguments?
    Many thanks!!!

    Hello Rolf and Christian: 
    Thank you for your suggestions! I'm now working on it. I appreciate your continuous help!! 
    I'll briefly summarize my question here:
    In the original DLL, which is compiled by VC++ 6.0 and named RateEquation.dll, three class types (CLaserPulse, CMaterial& CThresh) are inclueded to do parameter exchanges; one class type is designed to save the calculation results(CRateResults);one main function to do the calculation and save the results as following form:  
     float RateEqCalculate(class CLaserPulse*, class CMaterial*, class CThresh*, class CRateResults &r); 
    My question now is the initialization of the struct type and the communication between this type with labview. 
    I'll take class CMaterial as an example to show how I made it into wrapper DLL.Original class CMaterial is defined as following:
    class CMaterial
    public:
     float AbsorberGap;
     float BandGap;
     float CollTime;
     float ElDensity; float RefractiveIndex; 
     float AbsorptionCoeff;  
     float MoleculeMass;  
     float Density;  
     float HeatCapacity;  
     float HeatConductivity;  float TAmbient;  
     CMaterial();
     virtual ~CMaterial();
      In a wrapper dll it's like this: 
    WrapperDll.h
     extern "C" { /*using a C compiler*/            //Using a C compiler to write the wrapper DLL
    #endif 
    struct RATEEQUATION_API CMaterial{                  
      //Electronical properties
      float AbsorberGap;
      float BandGap;
      float CollTime;
      float ElDensity;
      //Optical properties
      float RefractiveIndex;
      float AbsorptionCoeff;
      //Other properties
      float MoleculeMass;
      float Density;
      float HeatCapacity;
      float HeatConductivity;
      float TAmbient;
      typedef struct CMaterial CMaterial;                                             /* make the class opaque to the wrapper*/
     RATEEQUATION_API CMaterial* creat_CMaterial(void);           
    RATEEQUATION_API void destroy_CMaterial(CMaterial* LV_ref);
    #ifdef __cplusplus
    #endif  
    WrapperDll.cpp
    RATEEQUATION_API CMaterial* creat_CMaterial(void)
           return new CMaterial();                              
    RATEEQUATION_API void destroy_CMaterial(CMaterial* LV_ref)
           delete LV_ref;
     In function creat_CMaterial(), one can see the constructor of class CMaterial is called. As struct type CMaterial has the same memory layout as class type CMaterial, so it’s safe and possible to return a class CMaterial* to struct CMaterial* and it’s initialized by the default values in the class constructor. Now I’m confused by how one communicates between labview and struct CMaterial. For example, if I would like to change the parameter _CMaterial-> BandGap=6.5eV to 8eV. How to make it? My feeling is I need a cluster type from Labview as an input in the function creat_CMaterial:
                              CMaterial* creat_CMaterial(cluster_LV*)
    Many thanks!
    Message Edited by Kuo on 09-15-2009 09:56 AM
    Message Edited by Kuo on 09-15-2009 09:59 AM

  • Could not load DLL or External library "c:\folder\123.dll" - This DLL requires the following DLL which could not be found or loaded: abc.dll (Not Found)

    I am having an issue when I try to run a Test Stand sequence that calls a CVI DLL.  The error I get is the subject of this post. 
    If I were to put "abc.dll" in the same folder where "123.dll" resides, this error will go away.  However, "123.dll" is used in other applications and I don't want to create multiple copies of this DLL for every program or sequence that wants to call it - that could get messy.
    Does anyone have any suggestions as to what the issue might be?
    Thank you,
    Seth Kline

    I think, http://msdn2.microsoft.com/en-us/library/7d83bc18(VS.80).aspx will give you an idea how to solve the problem 

  • Using cl.exe of visualstudio to create a dll for the jni

    In the sun site I saw to create a dynamic link library
    On Win32, the following command builds a dynamic link library hello.dll using Microsoft Visual C++ 4.0:
    cl -Ic:\java\include -Ic:\java\include\win32
    -LD HelloWorldImp.c -Fehello.dll
    Of course, you need to specify the include path that corresponds to the setup on your own machine.
    I have visual studio installed in
    C:\Program Files\Microsoft Visual Studio\
    there is a win32 dir in this visual studio in
    C:\Program Files\Microsoft Visual Studio\Common\VSS
    instead of the "include" inthe above mentioned "cl" command what do I write? Thanks.

    I know the way via spool, you'll need to SUBMIT ... TO SAP-SPOOL instead of EXPORTING LIST TO MEMORY, grab the spool number RQIDENT from table TSP01, then call function CONVERT_ABAPSPOOLJOB_2_PDF.
    Thomas

  • Jdev crash when loading JNI dll

    Greetings:
    I have the following msg when I either
    click in "Design" tab or start debugger:
    -------------- cut here -------------
    JniPortal for D:\JDeveloper\java1.2\jre\bin\OJVM\jvm.dll reported
    Native Library D:\JDeveloper\java1.2\bin\JTACCDLL.dll already loaded in another classloader
    java.lang.UnsatisfiedLinkError: Native Library D:\JDeveloper\java1.2\bin\JTACCDLL.dll already loaded in another classloader
    void java.lang.ClassLoader.resolveClass0(java.lang.Class)
    void java.lang.ClassLoader.resolveClass(java.lang.Class)
    java.lang.Class borland.jbuilder.jot.JotClassLoader.loadClass(java.lang.String, boolean)
    java.lang.Class borland.jbuilder.jot.ClassManager.loadClass(java.lang.String, boolean)
    java.lang.Class borland.jbuilder.jot.JotPackageManager.loadClass(java.lang.String, boolean)
    int borland.jbuilder.uidesigner.$491.getType(borland.jbuilder.cmt.CmtSubcomponent, borland.jbuilder.cmt.CmtComponents)
    com.objectspace.jgl.Array borland.jbuilder.uidesigner.$491.$TGb(borland.jbuilder.cmt.CmtComponents, borland.jbuilder.cmt.CmtComponent, borland.jbuilder.cmt.CmtMethodSource)
    void borland.jbuilder.uidesigner.DesignerAddin.annotate(borland.jbuilder.cmt.CmtComponentModel, borland.jbuilder.cmt.CmtComponents)
    void borland.jbuilder.designer.DesignerManager.annotate(borland.jbuilder.cmt.CmtComponents, borland.jbuilder.cmt.CmtComponentModel)
    void borland.jbuilder.designer.DesignContext.open(borland.jbuilder.addin.Url, boolean)
    void borland.jbuilder.designer.DesignContext.changeUrl(borland.jbuilder.addin.Url)
    void oracle.jdeveloper.addin.impl.JavaMasterViewerImpl.changeViewerUrl(java.lang.String)
    void oracle.jdeveloper.addin.CustomViewer.changeUrl(java.lang.String)
    void oracle.jdeveloper.addin.JavaMasterViewer_JavaDispatch.invoke(int, borland.javaport.JavaCallStack)
    The jtaccdll.dll is my JNI dll. I am not sure
    why is it tryin to load when I launch "Design". The dll has nothing to do with
    screen objects.
    Before I put it in that place JDev was
    complaining that the dll is missing and
    refused to do anything (run debugger at all).
    Did anybody figured how to fix it? JDev
    is v3.1.1.2.
    TIA,
    V.
    null

    jasro wrote:
    Could you elaborate a little bit? Maybe provide an example? How exactly should I rename the jni wrapper functions?1. Run javah again.
    2. Verify that the signatures in the h file match those in the c/cpp file.
    3. Include the h file in the c/cpp file.

  • I have uninstalled and reinstalled the new iTunes but it still will not work.  I keep getting the error mesage relating to MSVCR80.dll, the installation error 7 (windows error 126). I have tried moving and removing the dll files including the QTMovie dll

    I have tried uninstalling and reinstalling iTunes 15 times regarding the latest release and still get the MSVCR80.dll and Error 7 (Windows error 126) messages.
    I have tried moving the dll filesincluding the QTMovie dll file to now avail.  Can anyone please help, as I am sure you all, like me, have thousnads of dollars and songs invested in this system and need a fix fast.  Can anyone please help???

    Dear avid iTunes users - I have cracked it!!!
    The response from Apple/iTunes was extremely poor and did not solve the problem.
    I have a look in msconfig and observed which applications/services were running - one of which was the 'Apple Application Support'
    So ... I had a look at what was in this folder and found the APS Daemon.exe file causing all the trouble.
    So ... I simply deleted the Apple folder found in C:\program files\common files\.
    I did a restart and did not get the MSCVCR80.dll or Error 7 (windows 126) error messages.
    I reinstalled the current version of iTunes (for the 16th time!)
    Hey presto!!!
    IT WORKED :-O Woooohooo!!!
    So ... to all those smarty-pants boffin-brianiacs out there (apple/iTunes): this is how you do it!!!!!!!!!!
    YOU DO NOT NEED TO UNINSTALL ALL THE APPLE/QUICKTIME OR RELATED PROGRAMS - JUST DELETE THE APPLE FOLDER IN THE C:\PROGRAM FILES DIRECTORY.
    Nuff said.

  • Using PCSCJCTerminal to find the readers

    Hi,
    there is a very strange thing that has happenned.
    I am trying to develop an off-card application, that uses the jpcsc.dll (not the jct.dll)
    to make it application portable accross the platforms. Thus, i have to use PCSCJCTerminal class, that works using jpcsc.dll and jpcsc.jar. Th eproblem is, that when i am trying to get all the readers attached to the machine, i can't:
    listReaders() method seems to always return 0, despite the real number of readers attached.
    This method works fine in e.g. NativeJCTerminal, bit then jct.dll is needed - i want to avoid using of it.
    Could you tell me, where the error may have happened?
    Code looks like this:
    JCTerminal t = new PCSCJCTerminal();
    t.init(" any|ed");
    t.open();
    t.listReaders(); //there zero is returnedI would appreciate any comments.
    Best regards,
    Eve

    Your problem statement seems a little odd. If the robot can only go "down" or "left", then every sequence of moves will get him to (1,1) and all the sequences will have exactly the same length.
    Also, I think perhaps you don't quite understand recursion. Even though a function is recursive, if-then-else still works the same way - only one of the branches will be taken, not both.
    So for instance with the second version of the code that you posted, the initial call CountPaths(6,3) will result in just one recursive call to CountPaths(5,2). This in turn will result in a call to CountPaths(4,1). At that point, the calls will start falling into the earlier branch of the code and you will get calls to CountPaths(3,1), CountPaths(2,1), CountPaths(1,1). So then you will have a stack of six calls, each (except the last) waiting for the recursive call it made to return. CountPaths(1,1) returns without making a recursive call, and each of the others returns immediately (in reverse order) without making any other recursive calls.
    On the other hand, if you really want the code to explore all the possible paths, it should recurse to explore the paths that begin with a "down" move and recurse again to explore the paths that begin with a "left" move. Something more like
    CountPaths(IkeStreet-1, IkeAvenue);
    CountPaths(IkeStreet, IkeAvenue-1);However, if you do just that without adding some adding some additional intelligence, you will find that you get a bit more than you bargained for.
    Edited by: EricDittert on Sep 11, 2009 6:19 PM

  • I am using a Application in c dll calling from jni jar by java applet in firefox version 19.0 , the problem is click event message box will not working correct

    I am using a Application in c dll calling from jni jar by java applet in firefox version 19.0 , the problem is button click event message box or popup window will not working correctly. Please any one suggest me the steps to overcome this not responding or slowness in the responding problem of Button click event.

    Hello,
    In Firefox 23, as part of an effort to simplify the Firefox options set and protect users from unintentially damaging their Firefox, the option to disable JavaScript was removed from the Firefox Options window.
    However, the option to disable JavaScript was not removed from Firefox entirely. You can still access it from about:config or by installing an add-on.
    '''about:config'''
    # In the address bar, type "about:config" (with no quotes), and press Enter.
    # Click "I'll be careful, I promise"
    # In the search bar, search for "javascript.enabled" (with no quotes).
    # Right click the result named "javascript.enabled" and click "Toggle". JavaScript is now disabled.
    To Re-enable JavaScript, repeat these steps.
    '''Add-ons'''
    You can alternatively install an add-on that lets you disable JavaScript, such as
    *[https://addons.mozilla.org/firefox/addon/noscript/ No-Script] (to disable JavaScript on a per page basis, as required)
    *[https://addons.mozilla.org/firefox/addon/quickjava/ QuickJava] (to easily disable and enable JavaScript, automatic loading of images, and other content)
    Thank you and I hope this helps!

  • How do you use the MPUSBAPI.dll?

    For some reason the attached DLL driver (Mpusbapi\Dll\Borland_C\Mpusbapi.dll) seems to crash whenever it is run within LabVIEW.  I have run this dll under visual c++ and it works just fine.  In particular the functions MPUSBRead and MPUSBWrite are generating errors within LabVIEW. The other functions of this DLL such as MPUSBGetDeviceCount and MPUSBGetDllVersion are working correctly.   I am using the "Call Library Function" to access this DLL.  Is there anything special that I have to do to use the functions MPUSBRead and MPUSBWrite?  Any suggestions?  Thanks.  Below is the header for this dll.
    #ifndef _MPUSBAPI_H_
    #define _MPUSBAPI_H_
    #define    MPUSB_FAIL                  0
    #define MPUSB_SUCCESS               1
    #define MP_WRITE                    0
    #define MP_READ                     1
    // MAX_NUM_MPUSB_DEV is an abstract limitation.
    // It is very unlikely that a computer system will have more
    // then 127 USB devices attached to it. (single or multiple USB hosts)
    #define MAX_NUM_MPUSB_DEV           127
    extern "C" __declspec(dllexport)
    DWORD MPUSBGetDLLVersion(void);
    extern "C" __declspec(dllexport)
    DWORD MPUSBGetDeviceCount(PCHAR pVID_PID);
    extern "C" __declspec(dllexport)
    HANDLE MPUSBOpen(DWORD instance,    // Input
                     PCHAR pVID_PID,    // Input
                     PCHAR pEP,         // Input
                     DWORD dwDir,       // Input
                     DWORD dwReserved); // Input <Future Use>
    extern "C" __declspec(dllexport)
    DWORD MPUSBRead(HANDLE handle,              // Input
                    PVOID pData,                // Output
                    DWORD dwLen,                // Input
                    PDWORD pLength,             // Output
                    DWORD dwMilliseconds);      // Input
    extern "C" __declspec(dllexport)
    DWORD MPUSBWrite(HANDLE handle,             // Input
                     PVOID pData,               // Input
                     DWORD dwLen,               // Input
                     PDWORD pLength,            // Output
                     DWORD dwMilliseconds);     // Input
    extern "C" __declspec(dllexport)
    DWORD MPUSBReadInt(HANDLE handle,           // Input
                       PVOID pData,             // Output
                       DWORD dwLen,             // Input
                       PDWORD pLength,          // Output
                       DWORD dwMilliseconds);   // Input
    extern "C" __declspec(dllexport)
    BOOL MPUSBClose(HANDLE handle);
    #endif

    Attached is the DLL's .cpp code.  From the .cpp code:  "//  dwLen   - Specifies the number of bytes to write to the pipe."
    Attachments:
    _mpusbapi.cpp ‏32 KB

  • How can I use the CFDAQ6004.dll in a embedded c++-application?

    Hi,
    I´m working on a reaserch project and I´m trying to write a embedded c++-aplication which reads from values the Compactflash Card CFDAQ6004 of NI. Can I use the cfdaq6004.dll to read from? If yes, how to?
    I hope anyone has a solution for me
    Best regards, Homi!

    Hi there,
    I know this post is very old but i guess many guys visit it when reading the topic or by googling about CFDAQ6004 driver. Unfortunately CFDAQ6004.dll is very low level driver that support several functions dealing directly with CF6004 card such as ATTset and ATTget... etc. as one can view in any PE explorer for Windows CE. After a month of testing and analysis, i have successfully write a dll based on CFDAQ6004.dll to open, configure, read, write analog/digital data from/to CF6004 card. The new library was given a name CF6004LIB.dll the following is comparison between my dll and daqmxbase driver:
            New Dll                                                                                     DAQmxbase driver
    1. Can be used inside any programming environment                        Can only be used inside Labview
        inc. eVC++ , VC++ .net, VC# .net, VB .net
    2. Support fully dynamic task configuration                                       Only static configration possible (dynamic task can be done with modified VIs)
    3. Remove a lot of overhead by accessing CF6004 directly                Puts a lot of overhead passing through GUI, objects, controls, ...etc.
    4. Support full error detection                                                           Some errors can not be catched
    5. Full sampling rate can be achieved 200 kS/sec                               system dependent (max. 130 kS/sec in hp ipaq 211 PDA)
    6. Support contiuous/limited sampling                                               continuous sampling is possible but at reduced rate`
    7. small in size < 10 kB                                                                    Minimum program size 600 kB
    Also, I have written some modified VIs for CF6004 including reduced (specifically used for CF6004 card ) VIs and dynamic task configrable VIs.
    Bye
    Jaf

  • Using PCI-6503 on Win NT 4.0, with NIDAQ 6.8 or 6.9, in a C++ program I found the following DLL Initialization error..

    "Initialization of the DLL C:\WINNT\System32\NIPALU.dll failed. The process is terminating abnormally"
    The card tests OK with MAX2.0 and if I open the test panel first and then compile the exe, it works. So what exactly is the initialization Im missing but happens in MAX ?? While using PCI-6503 with Windows NT 4.0 SP6, and NI-DAQ 6.8.1 or 6.9, is there any initialization that a C++ program needs to do before trying to write to DIO lines ? I have a program in C++ which works fine (writes and reads the DIO lines from PCI-6503) IF I run it after opening the test panel for PCI-6503 in MAX 2.0. Otherwise it gives the following error..
    "DLL Initialization failed
    Initialization of the dynamic link library C:\WINNT\System32\NIPALU.dll failed. The process is terminating abnormally."
    The PCI-6503 tests OK using either NI-DAQ 6.8.1 or 6.9 and I can read write to the DIO lines using the MAX2.0's test panel. Also my program works fine if before compiling the code I open the test panel for PCI-6503 in MAX2.0, so I suspect there is some initialization Im missing in my program. Can someone educate me more on this. Thanks.

    Are you using ComponentWorks++ or just the NI-DAQ C interface?

  • 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.

  • Unable to use C++ dll in the windows phone 8 application.

    Hi folks,
    I am trying to use the native c++ dll compiled for Win32 platform using PInvoke. The native dll is a simple library which is returns some dummy values of native data types. The dll is working fine with the traditional Windows Forms Applications. But when
    I am trying to use the same dll in the Windows Phone 8 app, I am getting a runtime exception, "An exception of type 'System.NotSupportedException' occurred in Unknown Module. but was not handled in user code".
    [System.Runtime.InteropServices.DllImport("win32dll.dll", EntryPoint = "Hello")]
    private static extern int Hello();
    As one can see the InteropServices classes in Windows Phone 8 sdk, the PInvoke must be supported! am I going wrong some where? Can some one give me sample windows Phone 8 app project which is using native C++ dll.

    Here's the official list of InteropServices classes supported by the phone:
    http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.runtime.interopservices(v=vs.105).aspx
    DllImport isn't one of them.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

Maybe you are looking for

  • Is there a way to keep animated gifs moving when a page loads? At some point it just stops but the next page is still loading

    I am working on creating a website that has this "loading" image gif when I go to another page (php). Yes, ajax is cooler but i'm no expert and seo thing keeps me from using it thus i'd go for something this simple. I already tried and realized it wo

  • Upgrade Tool error

    I want to install lightweight IOS  into Aironet 1131AG by using Upgrade Tool. However, some error messages appear saying 1. ACL / Firewall might be blocking the TFTP. 2. Disable the ACL/Firewall setting for TFTP. I don't set up any ACL because I am t

  • Mobile Me Gallery Login & Password using Aperture

    I recently migrated my entire iPhoto library to Aperture and I have a few questions. 1. How can I tell if an Album in Aperture is a Mobile Me Album? 2. Where can I find the Username and Password info. for each of my already existing Mobile Me Albums?

  • Branch object wire without creating a copy

    Hello, I try to interact with a device. I abstracted the device into a class with several methods. My application is one big event frame taking care of user input from the front panel and converting it into method calls in order to control said devic

  • How to upload multiple images

    Hey folks.      I have 10 file upload files for users to upload up to 10 different images into the same folder, but not sure how i should go about it. I did 10 different inserts, but it seemed very "chicken scratch" type coding. Not sure how to do it