Compiling JMagick ( creation of dll using msys and mingw soft)

Hi friends,
I am getting UnsatisfiedLinkError exception when I tried to run my program..
I used msys and mingw soft to compile dll.
Please tell me what are the possibilities for this exception..
Thank you very much..
Regards,
Krishna.

Please do not shout.
Because the end of the main() method does not always meen that the program has ended.
To return a value from a java program use :
System.exit(XX)where XX is an integer (the exit value that you get with $? in bash for example)
--Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Access ni4882.dll with Qt and MinGW

    I have to control some electric loads and power supplies over GPIB. We use Qt 4.7.4 with MinGW 4.4 (32-bit) on Windows 7 64-bit.
    The packet NI-488.2 GPIB Drivers packet 3.0.2 for Windows 7 64-bit is installed. The GPIB Troubleshooting Utility tool shows "pass" and the Measurement & Automation application can connect to the board and talk to an intrument. So far so good.
    Now I want to write an application to use the NI4882.dll (3.0.0.49153). Unfortunately, there are just object files for Microsoft and Borland compilers and no lib file.
    So we generate a def file from the ni4882.dll with:
    pexports -h ni4882.h ni4882.dll > ni4882.def
    -ni4882.def-
    LIBRARY NI4882.dll
    EXPORTS
    ?compareVersion@nGPIBAPI_NI4882@@YGXABVtSSVersion@@0AAJPBD@Z
    ?getCurrentVersion@nGPIBAPI_NI4882@@YG?AVtSSVersion@@AAJ@Z
    ?getOldestCompatibleVersion@nGPIBAPI_NI4882@@YG?AVtSSVersion@@AAJ@Z
    AllSpoll@12
    DevClear@8
    DevClearList@8
    Then generate the lib with:
    dlltool -k -D ni4882.dll -d ni4882.def -l libni4882.a
    Now, I've build a small test program in Qt.
    -.pro file-
    INCLUDEPATH += $$PWD/include
    LIBS += $$PWD/lib/libni4882.a
    -.cpp file-
    #include "ni4882.h"
    void MainWindow::Init()
      int dd = idev(0,3,0,T10s,1,0);
      if(Ibsta()&ERR)
        Err(tr("Unable to open board:ibdev=%1").arg(dd));
      if( ibonl(0,0)&ERR)
        Err(tr("Unable to close board"));
    void MainWindow::Err(QString message)
      switch(Iberr())
        case 0:
          message.append("(EDVR - System error)");
        } break;
      qDebug("Error : %s\nibsta = 0x%x iberr = %d\n",
        (unsigned int)Ibsta(), (int)Iberr());
    The source code will be compiled and linked without an error.
    But if I run it, the output is:
    Error : Unable to open board: ibdev=32768 (EDVR - System error)
    ibsta = 0x8000 iberr = 0
    Error : Unable to close board (EDVR - System error)
    ibsta = 0x8000 iberr = 0
    So, the question is: What is wrong? Why do I always receive this EDVR error. I also tried SendIFC(0) with the same result.
    With the GPIB Interactive Control tool, I can communicate with my instrument and the NI I/O Trace logs it. But I can't see logs in the Trace tool from my application. Is this an indication?
    Any ideas?
    Marko
    Solved!
    Go to Solution.

    Hi to all,
    after some questions about using the GPIB library with Qt, I've written a step by step description to create object files for MinGW:
    1. Create a folder and copy the "gpib-32.dll" from the "C:\Windows\System32" ("C:\Windows\SysWOW64" in Win7) to this folder.
    2. Copy "ni488.h" from "c:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\include\". (Not ni4882.h!)
    3. Load PExports (my version is 0.44) and put the exe in your folder to. I do not have a URL to load this tool but should be easy to find. It's freeware.
    4. Copy dlltool.exe from "c:\QtSDK\mingw\bin\" to your folder.
    5. Create a batch file "1 - build def file.bat" with the content: "pexports -h ni488.h gpib-32.dll > gpib.def"
    6. Create a batch file "2 - build lib file.bat" with the content: "dlltool -k -D gpib-32.dll -d gpib.def -l libgpib.a"
    7. Start the batch file "1 - build def file.bat" to create the def file "gpib.def"
    8. Start the batch file "2 - build lib file.bat" to create the library file "libgpib.a"
    9. Copy "gpib-32.dll" and "libgpib.a" to your software project. I created the subfolder "lib" and copied the files into.
    10. Copy "ni488.h" to your software project. I created the subfolder "include" and copied the file into.
    11. Into your PRO file type:
    # Include the NI 488.2 library
    INCLUDEPATH += $$PWD/include
    HEADERS += include/ni488.h
    LIBS += $$PWD/lib/libgpib.a
    12. In your source code type:
    #include "windows.h"
    #include "ni488.h"
    bool InitializeGPIBBoard( )
    bool isStarting = false;
    int boardID;        /** @brief Board id. */
    QString boardName;  /** @brief Board name. */
    int boardDescr;     /** @brief Board descriptor. */
    // Get board ID
    SendIFC(boardID);
    if( ThreadIbsta() & ERR )
        ErrorHandling(tr("Unable to open board"));
        return isStarting;
    // Open and initialize a board or a user-configured device descriptor
    wchar_t *aName = new wchar_t[boardName.size()+1];
    m_para.boardName.toWCharArray( aName );
    aName[boardName.size()] = 0;
    m_para.boardDescr = ibfind( aName );
    delete []aName;
    // The board is the System Controller.
    if( ibconfig( boardDescr, IbcSC, 1 ) & ERR )
        ErrorHandling(tr("Unable to set the board to System Controller"));
        return isStarting;
    // Assert interface clear.
    if( ibsic( boardDescr ) & ERR )
        ErrorHandling(tr("Assert interface clear"));
        return isStarting;
    // aso.
    isStarted = true;
    return isStarted;
    13. Be happy! :-)
    I hope that helps. If you have problems, please write me a message or post on this board thread.
    Gruß und viel Erfolg!
    Marko

  • Deploying a VB dll using some web service and accessing it through java

    I'm new to Web Services Based Programming. I would like to know whether this is possible and if so has anyone tried it. I want to create a vb dll that contains the remote methods that the client will access from a java program. After going thru a lot of articles, I'm still unsure on how to do this. I found one method was to Create a VB program/dll, deploy it in a web service and create the java program that accesses by another web service.
    I'm doing this as part of my lab syllabus. The thing is My lab exercises do not state anything about the technologies that I can use to do this.
    This is all that is stated there:-
    Creation Of DLL Using VB And Deploy it in Java
    I just cant get any ideas other than deploying both the parts as web services. If anyone has Better ideas for this, I would really appreciate it.
    I dont know anything about CORBA for languages other than Java and I'm already using the servlets and EJB's in my normal life. I'm also learning the ORB based programming in java. Therefore your help will probably help me learn something new then what I know.

    Sorry I wasn't too specific in my last question.
    This is my java class calling the native method print
    //HeyWorld.java
    class HeyWorld {
    private native void print();
    public static void main(String[] args) {
    new HeyWorld().print();
    static {
    System.loadLibrary("HeyWorld");
    In this case, my C method for calling a C++ method: HelloWorld.cpp
    #include "jni.h"
    #include "stdio.h"
    #include "stdafx.h"
    #Include "HeyWorld.h" //this is where i get my function prototype
    #include "Test.h" //this is the C++ header where the print method and the Test class is
    JNIEXPORT void JNICALL
    Java_HeyWorld_print(JNIEnv *env, jobject obj)
    CTest a; //CTest is the print class I created
    a.print();
    //This is the header for Test.h
    class CTest: public CWinApp
    public:
         CTest(); //constructor
         void print(); //our method
    //And this is the implementation of the class Test.cpp
    void CTest::print()
         printf("Hey World!\n");
         return ;
    I could compile the Test.cpp, HeyWorld.cpp successfully. However when I tried to compile HeyWorld.cpp using
    cl -I<path of jdk include> -I<path of jdk include win32> -LD HeyWorld.cpp -FeHeyWorld.dll,
    the VC++ 6.0 compiler gave me this error:
    HeyWorld.obj:error LNK2001: unresolved external symbol "public:_thiscall CTest::CTest(void)"
    HeyWorld.obj:error LNK2001: unresolved external symbol "public:_thiscall CTest::print(void)"
    Thanks for the help.

  • Get "Creation Script" of the existing table ( in SQL database) using C# and without using SMO dlls

    Hi All,
    I need to get the "Creation Script" of the existing table using c# and without using SMO dlls (is it possible? I don't know).
    I.e. In SQL Management Studio -> right click on any table -> Script table as -> Create To  - > open in the new query editor window. This will give you the schema of the table with the constraints of the table.
    For E.g. In Northwind database, for the table "Categories", I would like to get it as show below
    USE [Northwind]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[Categories](
        [CategoryID] [int] IDENTITY(1,1) NOT NULL,
        [CategoryName] [nvarchar](15) NOT NULL,
        [Description] [ntext] NULL,
        [Picture] [image] NULL,
     CONSTRAINT [PK_Categories] PRIMARY KEY CLUSTERED
        [CategoryID] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO
    I would like to get the same schema using c#. Please help.
    Thanks & Regards,
    Kalai.

    SMO is the easiest way to get this. This is what Management Studio uses. If you can't use SMO, get a Profiler trace of the queries that SMO executes when generating the script and execute the same using ADO.NET.
    Regards,
    Farooq Mahmud
    Support Escalation Engineer 
    •  Microsoft Health Solutions Group

  • I built a DAQ vi in the labview6.1 and i compiled it to a dll.And then I wanted to call it and expected it pass acquired data to visual c++

    I built a DAQ vi in the labview6.1 to acquire four channels'data(use pci_6110E) .And i compiled it to a dll.I wanted to use visual c++ to call it and expected it pass acquired data to visual c++.

    Hello
    If you are using Visual C++, then I would recommend using the NI-DAQ function calls instead of having labview layer in there. YOu can pretty much accomplish any task using the NI-DAQ function calls that you can by using the LabVIEW DAQ vi's. Plus this way you wont have to worry about passing the correct data type from LabVIEW into C++. You can find the examples for using these function calls under ../NI-DAQ/Examples/.
    I hope this helps
    Bilal Durrani
    NI
    Bilal Durrani
    NI

  • JSP precompilation and my .java files compilation issues /  building WAR file using ANT

    Hello.
    I am new to working with WAR files and the whole process of it. A little
    background on what we are using. We are using, WLS 6.1 SP3. I am using the
    ant.bat that is supplied in the bin directory of the WLS install.
    I am trying to work with ANT and getting it to build the file. I am making
    progress, but at a point where I am having trouble getting my java code
    files to compile using ant. I am having one issue and looking to do one
    other item.
    1) I would like to precompile the JSPs if possible prior to putting into the
    WAR file. Not sure if this is done or not, but there was a utility when I
    was working with ibm's app server that gave us the ability to do a batch
    complile. Was thinking that maybe a similair concept is possibly here.
    2) Having issue getting ant to compile code properly. In the compile
    section of the build.xml file for ant, I tell it where the source files are,
    and the destionation folder for the compiled class files. I then try to set
    the classpath so that it finds the .jar files that are necessary for my
    source files to complile. But, it won't find them. And not sure how come.
    I may be going about this all wrong, but dont know. Here is the compile
    section of the build.xml I am using:
    <target name="compile" depends="prepare">
    <javac srcdir="classes" destdir="${deploy.home}/WEB-INF/classes"
    classpath="$(lib.home)"
    debug="on" optimize="on" deprecation="off"/>
    </target>
    One note, I've tried many different items in the classpath line, which
    don't work. if I do *.jar it fails at complie time, invalid argument. As
    well as if I use *.* and so on. if I list the explicit file names, it still
    doesn't seem to find them.
    I was wondering if anyone could help, if you need anymore information let me
    know, I can send the entire build.xml if necessary. I may be missing
    items, seeing that this is my first try at using ANT.
    Any help is appreciated and thanks in advance. Hopefully not sounding too
    off the wall. Hopefully get some clarification and understanding.
    Thank you.
    Kevin.

    Kevin Price wrote:
    Hello.
    I am new to working with WAR files and the whole process of it. A little
    background on what we are using. We are using, WLS 6.1 SP3. I am using the
    ant.bat that is supplied in the bin directory of the WLS install.
    I am trying to work with ANT and getting it to build the file. I am making
    progress, but at a point where I am having trouble getting my java code
    files to compile using ant. I am having one issue and looking to do one
    other item.
    1) I would like to precompile the JSPs if possible prior to putting into the
    WAR file. Not sure if this is done or not, but there was a utility when I
    was working with ibm's app server that gave us the ability to do a batch
    complile. Was thinking that maybe a similair concept is possibly here.you can use weblogic.jspc
    http://e-docs.bea.com/wls/docs70/jsp/reference.html#57794
    or just set the precompile flag in weblogic.xml
    You can configure WebLogic Server to precompile your JSPs when a Web
    Application is deployed or re-deployed or when WebLogic Server starts up
    by setting the precompile parameter to true in the <jsp-descriptor>
    element of the weblogic.xml deployment descriptor.
    >
    2) Having issue getting ant to compile code properly. In the compile
    section of the build.xml file for ant, I tell it where the source files are,
    and the destionation folder for the compiled class files. I then try to set
    the classpath so that it finds the .jar files that are necessary for my
    source files to complile. But, it won't find them. And not sure how come.
    I may be going about this all wrong, but dont know. Here is the compile
    section of the build.xml I am using:
    <target name="compile" depends="prepare">
    <javac srcdir="classes" destdir="${deploy.home}/WEB-INF/classes"
    classpath="$(lib.home)"
    debug="on" optimize="on" deprecation="off"/>
    </target>
    maybe because you are not using curly braces there on lib.home??
    if you do it the way above, you would have to list all your jars
    classpath="$(lib.home)\lib1.jar:$(lib.home)\lib2.jar"
    or you can nest
    <javac srcdir="classes" destdir="${deploy.home}/WEB-INF/classes"
    debug="on" optimize="on" deprecation="off">
         <classpath>
              <fileset dir="${lib.home}" includes="*.jar" />
         </classpath>
    </javac>
    One note, I've tried many different items in the classpath line, which
    don't work. if I do *.jar it fails at complie time, invalid argument. As
    well as if I use *.* and so on. if I list the explicit file names, it still
    doesn't seem to find them.
    I was wondering if anyone could help, if you need anymore information let me
    know, I can send the entire build.xml if necessary. I may be missing
    items, seeing that this is my first try at using ANT.
    Any help is appreciated and thanks in advance. Hopefully not sounding too
    off the wall. Hopefully get some clarification and understanding.
    Thank you.
    Kevin.

  • Creating dll in c++ and using labview to call it

    Greetings All,
    I have created a .dll file in visual C++ 2005 Express... I have attached both the c file and header file I used to create this dll in the .txt files cfile and header file. I have also included the .dll file itself so that you can use the vi. Please let me know if you have problems using it after you have configured the dll to go to the path you store and call the function ReturnMaxVal.  The problem is the max value keeps giving me a rediculous number. I did this with a 1-D array and it was no problem. If anyone can help it would be much appreciated.
    Thanks,
    Clint
    Attachments:
    helpPlease!.zip ‏14 KB

    OK, here's a one way to do it. This is the C way, using malloc() to reserve memory.
    There's propably a more C++ way to do this, using new and delete, but this works,
    although I don't guarantee that it doesn't have memory leaks
    This will initialize a 2D int array, but you should get the hang of things with this
    example.
    #include <iostream>
    using namespace std;
    int **a = NULL;
    void f2(int rows, int cols)
        // create array
        a = (int **)malloc(rows * sizeof(int *));
        for(int i = 0 ; i < rows ; i++)
            a[i] = (int *)malloc(cols * sizeof(int));
        // init values
        for(int i = 0 ; i < rows ; i++)
            for(int j = 0 ; j < cols ; j++)
                a[i][j] = i+j;
                cout << a[i][j];
            cout << endl;
    int main(void)
        int rows = 0;
        int cols = 0;
        cout << "Enter number of rows: ";
        cin >> rows;
        //cout << endl;
        cout << "Enter number of colums: ";
        cin >> cols;
        //cout << endl;
        f2(rows, cols);
        // free reserved memory   
        for(int i = 0 ; i < rows ; i++)
            free(a[i]);
        free(a);
        a = NULL;
        return 0;
    Hopefully this helps. You can try to google for other possibilities, there seems
    to be a lot of forum post about this matter.

  • Why LabVIEW crashes when I'm trying to use "in" and "out" in my DLL?

    Calling function from DLL using Call Library Function.
    Function source:
    extern "C" __declspec(dllexport) long ReadPort(long base, long off)
    unsigned char c;
    long d;
    __asm
    push eax
    push dx
    push ax
    mov eax, base
    add eax, off
    mov dx, ax
    in al, dx
    mov c, al
    pop ax
    pop dx
    pop eax
    d = c;
    return d;
    Using LabVIEW 5.0 and MSVC 6
    OS: Win2k

    > I am sure... When I delete "in" command from DLL source, it works...
    > but when I use "in" or "out" assembler command, LV crashes (sometimes
    > without any error message)...
    >
    Windowd 2000, and most of the more modern MS OSes do not allow direct
    access to HW. That means that applications do not have permission to
    call in and out instructions. Those instructions are protected and any
    app calling them will be terminated because it did something illegal.
    To get direct I/O to work, you should look for the driver on the NI web
    site that will redirect it for you.
    Greg McKaskle

  • Using tlb and DLL

    Hi,
    I was wondering how to use a tlb associated with a DLL in Labview.   I know the tlb has the function and bject prototypes and the DLL has the actual code.  Now question is, how do I create an object according to the tlb and the use this with the DLL?  Thanks
    Yohan

    more specifically...
    The .tlb contains an interface (eg: ITestInterface) that is implemented by the .dll using the (visual c++ 8.0)  "implement interface" on a class defined in the .dll (eg: CConcreteTest)
    The project that created this is a visual studio 8 c++ .dll project.  There is one interface defined and a separate class that uses the "implement interface" option in vc8. 
    --> when importing this .tlb and .dll into a visual c++ project: I use a COM smart pointer (of type ITestInterfacePtr) and call the CreateInstance() function using the name of implementing class.
    Also,
    This is the code to load the .dll and
    .tlb:
    #import "..\drivers\vna\debug\vna.tlb"
    no_namespace
    IcVNABASEDriverPtr pVNA;
    HRESULT hr = pVNA.CreateInstance("VNA.RS_ZVC");
    pVNA->setAddress(20);

  • How to Use Delphi and Nidaq.dll and DAQ_start to control daqcard700

    Iam using Delphi5 and Nidaq.dll and AI_read to control daqcard 700.
    Has anyone examples to use DAQ_op or DAQ_start and DAQ_rate ??

    Your question actually belongs in the Measurement Devices Multifunction IO category. In the future, you will find it beneficial to post directly to the appropriate category, as there are similar questions already posted, and others with similar interests may have answers to your questions.
    I am currently not aware of any examples with Delphi and NI-DAQ function calls. There are examples for using the ComponentWorks DAQ (ActiveX) controls with Delphi. Or, you can model your Delphi examples after the Visual C examples for the text-based NI-DAQ function calls. The operations for the NI-DAQ function calls would be the same in Delphi, and you would only need to use the appropriate syntax for the Delphi environment, as well as use the appropriate include file.
    You ca
    n install the Visual C examples and the Delphi support by following the KnowledgeBase entries below.
    KnowledgeBase 24DJMNPH: "How Do I Install Examples for Visual Basic, Visual C++, and Delphi with NI-DAQ 6.8 (or higher)?"
    KnowledgeBase 0UQFO1L7: "NI-DAQ and the Delphi Language Interface"
    Also, you will find the NI-DAQ User Manual and the NI-DAQ Help file vital to programming with the NI-DAQ functions.
    You can find the KnowledgeBase entries and manuals by going to the http://www.ni.com/support pages.
    Regards,
    Geneva L.
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • JVM Crash When Using JNI and COM

    I'm trying to call a DLL compiled from VB6 source code that I do not have access to. The VB6 code simply retrieves data from a DB2 database using ADO and my client code grabs that data and marshals it to my Java code. I'm attempting to achieve this using JNI and COM (without a third-party bridge). It works 75% of the time, but the other 25% of the time, the JVM crashes with the usual Hotspot crash log containing an access violation exception. However, I don't know what in my C++ code (VC++ 8) could be causing this except for passing a "wild" pointer to the code lying underneath the COM object interface. If that is the case, I don't know how I am doing that.
    The Java code that is calling my native method is running on Tomcat 5.5.25 and just to be safe, I am not allowing multiple threads to concurrently call the method in my JNI DLL (though I realize that this will kill performance). Once I can get past this problem, I'll do the COM interfacing on a worker thread in my native code so I don't screw up CoInitialize and CoUninitialize calls in the case the same thread is concurrently executing multiple calls to my native code.
    I've noticed that in most cases, the JVM crashes during my call to the pClsAccount->OpenConnection method. However, my DLL isn't what is listed on the top of the call stack, which is why I suspect the passing of a wild pointer, though I'm just taking a guess at that. Does anyone have an idea as to what's going on ?
    JNIEXPORT jobject JNICALL Java_CustomerInfo_nGetCustomerAccountInfo(JNIEnv *env, jobject customerInfo, jstring accountNumber, jstring iniFileName)
    jboolean isCopy;
    // Account info class and instance to be instantiated
    jclass accountInfoCls = NULL;
    jobject accountInfoObj = NULL;
    // The constructor ID of the accountInfoCls
    jmethodID ctorID = NULL;
    // Pointer to the interface for the ClsAccount COM object
    _clsAccount *pClsAccount = NULL;
    HRESULT hr;
    BSTR bstrIniFileName(L"");
    try
    const char *nativeAccountNumber = NULL;
    if (accountNumber != NULL)
    nativeAccountNumber = env->GetStringUTFChars(accountNumber, &isCopy);
    else
    jclass newExcCls;
    env->ExceptionDescribe();
    env->ExceptionClear();
    newExcCls = env->FindClass("java/lang/IllegalArgumentException");
    env->ThrowNew(newExcCls, "accountNumber passed in was null !");
    return NULL;
    // Initialization
    variantt varConnectionSucceeded = variantt(false);
    variantt varGetAccountInfoSucceeded = variantt(false);
    variantt varAccountNumber = variantt(nativeAccountNumber);
    bstrt bstrLastPaymentDate = bstrt();
    bstrt bstrLastErrorMessage = bstrt();
    bstrt bstrLastErrorNumber = bstrt();
    jlong jTotalDue = NULL;
    jlong jEstablishedDueDay = NULL;
    jlong jLastPaymentAmount = NULL;
    jstring jLastPaymentDate = NULL;
    jstring jLastErrorMessage = NULL;
    jstring jLastErrorNumber = NULL;
    jthrowable jException = NULL;
    const char *chLastPaymentDate = NULL;
    const char *chLastErrorMessage = NULL;
    const char *chLastErrorNumber = NULL;
    long long totalDue;
    long long lastPaymentAmount;
    long establishedDueDateDay;
    //Convert string from Java string to C string to VB string
    const char *nativeIniFileName = NULL;
    if (iniFileName != NULL)
    nativeIniFileName = env->GetStringUTFChars(iniFileName, &isCopy);
    else
    jclass newExcCls;
    env->ExceptionDescribe();
    env->ExceptionClear();
    newExcCls = env->FindClass("java/lang/IllegalArgumentException");
    env->ThrowNew(newExcCls, "iniFileName passed in was null");
    return NULL;
    bstrIniFileName = comutil::ConvertStringToBSTR(nativeIniFileName);
    CoInitialize(NULL);
    // Create an instance of the COClass with the interface over it
    hr = CoCreateInstance(__uuidof(clsAccount), NULL, CLSCTX_INPROC_SERVER, __uuidof(_clsAccount), (void **)&pClsAccount);
    if (hr == S_OK)
    varConnectionSucceeded.boolVal = pClsAccount->OpenConnection(&bstrIniFileName);
    &#12288;
    if (varConnectionSucceeded.boolVal == -1)
    varGetAccountInfoSucceeded.boolVal = pClsAccount->GetAccountPaymentInformation(&(varAccountNumber.GetVARIANT()));
    env->ReleaseStringUTFChars(accountNumber, nativeAccountNumber);
    // Extract all available account information from the ClsAccount object
    if (varGetAccountInfoSucceeded.boolVal == -1)
    totalDue = pClsAccount->TotalDue.int64;
    establishedDueDateDay = pClsAccount->EstablishedDueDateDay;
    lastPaymentAmount = pClsAccount->LastPaymentAmount.int64;
    bstrLastPaymentDate = pClsAccount->LastPaymentDate;
    chLastPaymentDate = comutil::ConvertBSTRToString(bstrLastPaymentDate.GetBSTR());
    jTotalDue = (jlong)totalDue;
    jEstablishedDueDay = (jlong)establishedDueDateDay;
    jLastPaymentAmount = (jlong)lastPaymentAmount;
    jLastPaymentDate = env->NewStringUTF(chLastPaymentDate);
    delete[] chLastPaymentDate;
    pClsAccount->CloseConnection();
    // Populate error fields if any errors occur
    bstrLastErrorMessage = pClsAccount->LastErrMessage;
    chLastErrorMessage = comutil::ConvertBSTRToString(bstrLastErrorMessage.GetBSTR());
    bstrLastErrorNumber = pClsAccount->LastErrNumber;
    chLastErrorNumber = comutil::ConvertBSTRToString(bstrLastErrorNumber.GetBSTR());
    jLastErrorMessage = env->NewStringUTF(chLastErrorMessage);
    jLastErrorNumber = env->NewStringUTF(chLastErrorNumber);
    delete[] chLastErrorMessage;
    delete[] chLastErrorNumber;
    const char* clsName = "com/nuance/merchantsmutual/businessentities/CustomerAccountInfo";
    // Find the Java class and the ID of its constructor
    accountInfoCls = env->FindClass(clsName);
    ctorID = env->GetMethodID(accountInfoCls, "<init>", "(JJJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
    jException = env->ExceptionOccurred();
    if (jException != NULL)
    env->ExceptionDescribe();
    env->ExceptionClear();
    //Release all resources associated with the ClsAccount instance
    pClsAccount->Release();
    //Instantiate the class with the given parameters
    accountInfoObj = env->NewObject(accountInfoCls, ctorID, jTotalDue, jEstablishedDueDay, jLastPaymentAmount, jLastPaymentDate, jLastErrorMessage, jLastErrorNumber);
    jException = env->ExceptionOccurred();
    if (jException != NULL)
    env->ExceptionDescribe();
    env->ExceptionClear();
    else if (hr == REGDB_E_CLASSNOTREG)
    cout << "COM class not registered" << endl;
    else if ( hr == CLASS_E_NOAGGREGATION)
    cout << "COM class can't be aggregated" << endl;
    else if (hr == E_NOINTERFACE)
    cout << "No interface for COM class clsAccount" << endl;
    else if (hr == E_POINTER)
    cout << "*ppv pointer was NULL !" << endl;
    else
    cout << "Error occurred while creating COM object. HR is [" << hr << "]" << endl;
    // Free the BSTR because a new one was returned with a call to comutil::ConvertStringToBSTR
    SysFreeString(bstrIniFileName);
    // Release the string when it's no longer needed. MUST call if string won't be used
    // anymore or else a memory leak will occur
    env->ReleaseStringUTFChars(iniFileName, nativeIniFileName);
    CoUninitialize();
    &#12288;
    catch (_com_error &e)
    cout << "Encountered an exception in GetCustomerAccountInfo: Error was " << e.ErrorMessage();
    pClsAccount->Release();
    catch (...)
    pClsAccount->Release();
    return accountInfoObj;
    Edited by: Cthulhu76 on Jan 5, 2010 9:18 AM

    0x49202400 JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_blocked, id=5340, stack(0x49bf0000,0x49c40000)]
    0x48a7e800 JavaThread "Thread-1" [_thread_in_native, id=5976, stack(0x48f00000,0x48f50000)]
    0x48a0dc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3072, stack(0x48c60000,0x48cb0000)]
    0x48a09000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=4988, stack(0x48c10000,0x48c60000)]
    0x48a07c00 JavaThread "Attach Listener" daemon [_thread_blocked, id=3124, stack(0x48bc0000,0x48c10000)]
    0x48a07000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2572, stack(0x48b70000,0x48bc0000)]
    0x489f5c00 JavaThread "Finalizer" daemon [_thread_blocked, id=5752, stack(0x48b20000,0x48b70000)]
    0x489f4c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=2596, stack(0x48ad0000,0x48b20000)]
    0x003c6000 JavaThread "main" [_thread_in_native, id=4252, stack(0x00820000,0x00870000)]
    Other Threads:
    0x489f0400 VMThread [stack: 0x48a80000,0x48ad0000] [id=5624]
    0x48a18800 WatcherThread [stack: 0x48cb0000,0x48d00000] [id=1192]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 36288K, used 12762K [0x02940000, 0x050a0000, 0x07800000)
    eden space 32256K, 34% used [0x02940000, 0x0343af58, 0x048c0000)
    from space 4032K, 37% used [0x04cb0000, 0x04e2ba28, 0x050a0000)
    to space 4032K, 0% used [0x048c0000, 0x048c0000, 0x04cb0000)
    tenured generation total 483968K, used 7518K [0x07800000, 0x250a0000, 0x42940000)
    the space 483968K, 1% used [0x07800000, 0x07f57958, 0x07f57a00, 0x250a0000)
    compacting perm gen total 14080K, used 14016K [0x42940000, 0x43700000, 0x46940000)
    the space 14080K, 99% used [0x42940000, 0x436f0320, 0x436f0400, 0x43700000)
    No shared spaces configured.
    Dynamic libraries:
    0x00400000 - 0x0040f000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\tomcat5.exe
    0x7c800000 - 0x7c8c0000      C:\WINDOWS\system32\ntdll.dll
    0x77e40000 - 0x77f42000      C:\WINDOWS\system32\kernel32.dll
    0x77380000 - 0x77411000      C:\WINDOWS\system32\USER32.dll
    0x77c00000 - 0x77c48000      C:\WINDOWS\system32\GDI32.dll
    0x77f50000 - 0x77feb000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77c50000 - 0x77cef000      C:\WINDOWS\system32\RPCRT4.dll
    0x76f50000 - 0x76f63000      C:\WINDOWS\system32\Secur32.dll
    0x77ba0000 - 0x77bfa000      C:\WINDOWS\system32\MSVCRT.dll
    0x7c8d0000 - 0x7d0cf000      C:\WINDOWS\system32\SHELL32.dll
    0x77da0000 - 0x77df2000      C:\WINDOWS\system32\SHLWAPI.dll
    0x76290000 - 0x762ad000      C:\WINDOWS\system32\IMM32.DLL
    0x77420000 - 0x77523000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.3959_x-ww_D8713E55\comctl32.dll
    0x6d7c0000 - 0x6da10000      C:\Program Files\Java\jre1.6.0_07\bin\client\jvm.dll
    0x76aa0000 - 0x76acd000      C:\WINDOWS\system32\WINMM.dll
    0x7c340000 - 0x7c396000      C:\WINDOWS\system32\MSVCR71.dll
    0x6d270000 - 0x6d278000      C:\Program Files\Java\jre1.6.0_07\bin\hpi.dll
    0x76b70000 - 0x76b7b000      C:\WINDOWS\system32\PSAPI.DLL
    0x6d770000 - 0x6d77c000      C:\Program Files\Java\jre1.6.0_07\bin\verify.dll
    0x6d310000 - 0x6d32f000      C:\Program Files\Java\jre1.6.0_07\bin\java.dll
    0x6d7b0000 - 0x6d7bf000      C:\Program Files\Java\jre1.6.0_07\bin\zip.dll
    0x6d570000 - 0x6d583000      C:\Program Files\Java\jre1.6.0_07\bin\net.dll
    0x71c00000 - 0x71c17000      C:\WINDOWS\system32\WS2_32.dll
    0x71bf0000 - 0x71bf8000      C:\WINDOWS\system32\WS2HELP.dll
    0x71b20000 - 0x71b61000      C:\WINDOWS\system32\mswsock.dll
    0x5f270000 - 0x5f2ca000      C:\WINDOWS\system32\hnetcfg.dll
    0x71ae0000 - 0x71ae8000      C:\WINDOWS\System32\wshtcpip.dll
    0x76ed0000 - 0x76efa000      C:\WINDOWS\system32\DNSAPI.dll
    0x76f70000 - 0x76f77000      C:\WINDOWS\System32\winrnr.dll
    0x76f10000 - 0x76f3e000      C:\WINDOWS\system32\WLDAP32.dll
    0x76f80000 - 0x76f85000      C:\WINDOWS\system32\rasadhlp.dll
    0x4a6a0000 - 0x4a6ac000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\CustomerInfoProxy.dll
    0x77670000 - 0x777a9000      C:\WINDOWS\system32\ole32.dll
    0x77d00000 - 0x77d8b000      C:\WINDOWS\system32\OLEAUT32.dll
    0x7c420000 - 0x7c4a7000      C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_E6967989\MSVCP80.dll
    0x78130000 - 0x781cb000      C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_E6967989\MSVCR80.dll
    0x777b0000 - 0x77833000      C:\WINDOWS\system32\CLBCatQ.DLL
    0x77010000 - 0x770d6000      C:\WINDOWS\system32\COMRes.dll
    0x77b90000 - 0x77b98000      C:\WINDOWS\system32\VERSION.dll
    0x75da0000 - 0x75e5d000      C:\WINDOWS\system32\SXS.DLL
    0x75e60000 - 0x75e87000      C:\WINDOWS\system32\apphelp.dll
    0x4dc30000 - 0x4dc5e000      C:\WINDOWS\system32\msctfime.ime
    0x4b0d0000 - 0x4b395000      C:\WINDOWS\system32\xpsp2res.dll
    0x71bb0000 - 0x71bb9000      C:\WINDOWS\system32\WSOCK32.dll
    0x4bbe0000 - 0x4bbea000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\ClearTranProxy.dll
    0x745e0000 - 0x7489e000      C:\WINDOWS\system32\msi.dll
    0x71c40000 - 0x71c97000      C:\WINDOWS\system32\NETAPI32.dll
    0x4bc50000 - 0x4bc6c000      C:\WINDOWS\system32\DBNETLIB.DLL
    0x71f60000 - 0x71f64000      C:\WINDOWS\system32\security.dll
    0x76c90000 - 0x76cb7000      C:\WINDOWS\system32\msv1_0.dll
    0x76cf0000 - 0x76d0a000      C:\WINDOWS\system32\iphlpapi.dll
    0x761b0000 - 0x76243000      C:\WINDOWS\system32\crypt32.dll
    0x76190000 - 0x761a2000      C:\WINDOWS\system32\MSASN1.dll
    0x4bcf0000 - 0x4bcff000      C:\Program Files\Common Files\System\Ole DB\SQLOLEDB.RLL
    0x4a8a0000 - 0x4a8aa000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\MIGI.DLL
    0x73570000 - 0x736c2000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\MSVBVM60.DLL
    0x4a950000 - 0x4a9e2000      C:\Program Files\Common Files\System\ado\msado15.dll
    0x74a50000 - 0x74a6a000      C:\WINDOWS\system32\MSDART.DLL
    0x4c850000 - 0x4c8c9000      C:\Program Files\Common Files\System\Ole DB\oledb32.dll
    0x4dbb0000 - 0x4dbc1000      C:\Program Files\Common Files\System\Ole DB\OLEDB32R.DLL
    VM Arguments:
    jvm_args: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 5.5 -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\logging.properties -Djava.library.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib vfprintf -Xms512m -Xmx1024m
    java_command: <unknown>
    Launcher Type: generic
    Environment Variables:
    JAVA_HOME=C:\Program Files\Java\jdk1.6.0_07
    [error occurred during error reporting (printing environment variables), id 0xc0000005]
    --------------- S Y S T E M ---------------
    OS: Windows Server 2003 family Build 3790 Service Pack 2
    CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 7 stepping 6, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3
    Memory: 4k page, physical 2097151k(2097151k free), swap 4194303k(4194303k free)
    vm_info: Java HotSpot(TM) Client VM (10.0-b23) for windows-x86 JRE (1.6.0_07-b06), built on Jun 10 2008 01:14:11 by "java_re" with MS VC++ 7.1
    time: Mon Dec 28 15:24:00 2009
    elapsed time: 600 seconds

  • Calling Functions of Loading DLL using java

    I have a dll file
    I know the functions which are ther in the dll
    But how to call those functions using JAVA ?
    can anyone tell me how to do the same...
    Thanx in advance
    regards,
    Ritesh

    I assume that you have a regular DLL and that the functions in that DLL are exported and that you know the signatures of each function.
    With that in mind, you will need to use the Java Native Interface (JNI), to call those functions from Java. In a nutshell, you will need to create at least one class which declares some native methods, code a class static code block to load the JNI-DLL you are about to create, compile the class(es), run the javah tool supplied with the JDK which will emit a C compatible header file, implement the functions from the generated header file and compile that source file to into a DLL. It would be in this DLL that you would use the functions in the DLL that you ultimately want to access. So, what you wind up doing is creating a wrapper DLL.
    Take a look at the JNI tutorial trail from Sun at http://java.sun.com/docs/books/tutorial/native1.1/index.html.

  • Asynchronuous functions don't work in a C# dll used by a CVI application

    Hello,
    I have an existing application written with CVI 9.0.1, which have to interact with a C# 2010 dll (which doesn't have any window) via a CVI<->.net wrapper (created using the usefull .net controller of CVI).
    This C# dll uses asynchronuous functions, like NetworkStream.BeginRead() and EndRead() functions of a System.Net.Sockets.TcpClient object for example.
    These asynchronuous functions work fine when the C# dll is used by a C# application (having a main window) or when the C# dll is converted in a standalone C# program (having a main window with buttons, to call its methods, just to try), but asynchronuous functions don't work when my C# dll is called by my CVI application (which is my goal): execution stays inside NetworkStream.BeginRead() for example (for the concerned thread).
    NetworkStream.BeginRead() can be successfully bypassed by using the synchronuous function NetworkStream.Read() instead, but the C# dll uses others asynchronuous functions wich have no associated synchronuous functions.
    Here is a portion of C# code (I don't have the source code for the Snmp object ; got_trap() method is never called when asynchonuous calls don't work):
    public void run() // the thread
     Snmp snmp = null;
     try
      snmp = new Snmp(true);
      snmp.NotifyListenPort = 162;
      snmp.NotifyRegister(null, null, new NotifyCallback(got_trap), CB_DATA_);
      isActive = true;
      Thread.Sleep(Timeout.Infinite);
    Thinking it could be a problem with window messages which could be not processed (in the C# dll), I tried to replace the Thread.Sleep(Timeout.Infinite) instruction, in the code where the asynchronuous management take place, by a window creation plus my Win32 window message loop, but asynchronuous functions don't work better (whereas my loop seems to successfully process messages):
    Form myForm = new Form(); // an empty window
    myForm.Show();
    int bRet;
    MSG msg = new MSG();
    while ((bRet = GetMessage(out msg, IntPtr.Zero, 0, 0)) != 0)
        if (bRet == -1)
           // handle the error and possibly exit
        else
          switch (msg.message)
            default: // everything else
            TranslateMessage(ref msg);
            DispatchMessage(ref msg);
            break;
    Any idea ?
    Thank you,
    rvfr.
    Solved!
    Go to Solution.

    Solved: in fact, the snmp assembly that I was using just needed to be dotNet registered.
    rvfr.

  • Php4apache.dll uses plain apache 1.3 API,this module might crash under EAPI

    Hi,
    I am a total PHP beginner.
    I am trying to install and configure Oracle, PHP, and Apache on Windows XP. For this purpose I am trying to follow the installation guide that I found on http://www.oracle.com/technology/tech/opensource/php/apache/inst_php_apache_windows.html.
    I have first installed the Oracle 9i DB server on my E drive, which has by default created the following directory which contains the APACHE exe file
    E:\oracle\product\10.1.0\db_1\Apache\Apache\
    (it is Apache 1.3.22)
    I have downloaded php 4.3.8 from php.net and have been through the following steps given by the guide.
    I have copied the php.ini and edited it (uncomment the extension=php_oci8.dll line and specified the doc_root as E:\oracle\product\10.1.0\db_1\Apache\Apache\htdocs).
    I have copied php4ts.dll and php_oci8.dll to E:\oracle\product\10.1.0\db_1\Apache\Apache\
    i have edited the httpd.conf file by adding the 3 following lines:
    LoadModule php4_module e:/php-4.3.8/sapi/php4apache.dll
    AddModule mod_php4.c
    <IfModule mod_php4.c>AddType application/x-httpd-php .php
    </IfModule>
    When i start the Apache server i get:
    e:/php-4.3.8/sapi/php4apache.dll/php4apache.dll uses plain apache 1.3 API, this module might crash under EAPI!
    Apache seems to be working fine and to run php. The "hello world" test runs fine as well.
    Is this EAPI error a problem? (some forums seem to be implying that it is not a major error but a warning)
    If yes, I can I solve it?
    Your help would be very much appreciated.
    If needed, my email is [email protected] please feel free to use it.
    Frankie

    If you downloaded the binary version of PHP, then pretty much you can't do anything about it. It's just a warning. However, if you compiled and built it (using vc++ or something else), you'll have to add the EAPI flag to the compile flags (/DEAPI to CFLAGS in the vc++ project file/makefile) to remove this warning.

  • Creating a CompactRIO compatible dll using Borland

    Hello
    I am trying to get a dll running on a CompactRIO 9004 using Labview8.5 developer's suite. The dll works fine when I run the VI on Windows, but when I copy the vi (called host.vi) to the CRIO target and try to run it I get the following message in the deployment status box:
    Deploying host.lvproj 
    Deploying Jag1
    LabVIEW:  Failed to load shared library c:\ni-rt\startup\data\extractor.dll on RT target device.
     (successfully deployed target settings)
    Deploying dllclone.vi  (3.20 K)
    Deploying RT board LEDs.vi  (11.66 K)
    Deploying RT LEDs.vi  (7.05 K)
    Deploying host.vi
    Failed to download host.vi
    LabVIEW:  Failed to load shared library e.dll:getaddress:C on RT target device.
    Having read some other posts on the forum, I am working from a folder called ni-rt\startup to mimic the CRIO's directory structure when configuring the call library function node and the dll is called e.dll to be certain of being filename compatible and the function being called is 'getaddress'. The dllclone.vi is a vi that performs exactly the same operation as the dll, to get an idea of speed difference. Jag1 is the name of the CRIO.
    I have run 'DLL Checker 8.2.exe' and it gives two bad imports: one in kernel32.dll (GlobalMemoryStatus) and one in user32.dll (EnumThreadWindows). I am using Borland Builder 5 as the compiler and even running this from the command line pointing explicitly at the lib files in 'cintools' and making the dll 386 compatible gives this result. Would changing to MSVC++ make a difference?
    I have been running the CompactRIO successfully up till now. Can anyone help with this?
    Thanks,
    Nathan

    Hello Tom, thanks for the reply.
    I haven't tried re-installing - my other apps still work on it, so I don't think it's broken. We only have the one CRIO at the minute - I need to get this problem fixed before we go buying any  more! I haven't tried any other dlls yet. As you will see, the one I am using is almost as simple as a dll can get and the application I am running is to test the loading/calling time of the dll and to experiment with passing structures. I've attached the full directory of the project but there are not many files. The dll was originally called extractor, but after building this I've tried renaming it as e.dll as I saw the message in another post about long filenames, though I understand this is an old problem and not an issue any more.
    I hope this all makes sense,
    Nathan

Maybe you are looking for

  • How do I upgrade my iPod for apps

    How do I upgrade my iPod for apps?

  • GR price is not matching with the PO price

    Hi Gurus, I am created a PO with qty = 4 set and PO price = 70,750 EUR per 1 set. And in my pricing procedure i am using 3 condition types i.e, PB00,PBXX and GRWR(statistical value) = 2% . Total value of the PO = 3,04,480 EUR (including GRWR-2%). Usi

  • Livecycle/Dataservices 2.6.1 [Transient] property

    Hi Guys and Girls I am using livecyle 2.6.1 with AIR 2.0.2 and a java backend, with the flex 3.4 SDK. I have a managed collection with a property that has a [Transient]  variable set which is used as a flag for products that have been  ordered.This v

  • How to block ABAP Debugger Controls Session 1 (Exclusive) pop-up ?

    Hello dear experts, Whenever I save my report after my first debugging, the program automatically pops-up open a debugger window of controls session 1.  I tried to delete all the breakpoints but it still kept coming. Kindly, help me with this issue,

  • Database file problem

    hii when i try to make a database in app_data an error message occur that is: "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instan