JNI with Visual C++

Hi,
I am a newbie. I have a code using Visual C++ with integrated libraries. Can I interface it with Java ?
Regards,
D. Anand Kumar

Hi,
I can explain more on the question. I would like to write a program in Java which calls a native method that's described in a C++ program.
Sample.java
public class Sample
     static
          System.loadLibrary("Sample");
     // A native method that receives nothing and returns void
     private native void test();
     public static void main(String[] args)
          new Sample().test(); // invoke the native method
Sample.cpp
#include "stdafx.h"
#include <iostream>
using namespace std;
void test() // native function
// function definition
I compiled and builded the Sample.cpp in a Visual C++ environment into a .dll. Now I tried to execute the java program with this dll and it said it could not find dependent libraries. I tried the following too.
#include <jni.h>
#include "stdafx.h"
#include <iostream>
using namespace std;
JNIEXPORT void JNICALL Java_RUI_test(JNIEnv *env, jobject thisObj)
//code
I added additional dependencies to the program to include the jni header from JAVA_HOME/include and JAVA_HOME/include/Win32. I builded a dll and tried to execute the java code and hit again at the same error "Unsatisfied Link Error : Cant find dependent libraries".

Similar Messages

  • Using JNI with Visual C++!! kIND OF URGENT

    Hi PPL,
    I am trying to interface c++ programs compiled using the g++ compiler with JNI using Visual C++, Visual C++ for some reason is not able to locate pair and map header files, so i used the header file utility.h, but the problem is changing the g++ compiled code which use pair and map.h extensively, any ideas how i can do this.

    I don't see anything in this that suggests it has anything to do with java.
    So you might try posting to a VC++ list/board or a gnu(g++?) list/board.

  • How do I use Qt and OpenGL with Visual Studio

    Hi! I mainly want to program in C++ and I want to use Qt and OpenGL with Visual Studio.
    I am currently revising C++ and later on i am going to start reading Qt and OpenGL. I have a background of
    Embedded firmware design(C and Assembly).
    The Visual Studio Version I have is 2013 ultimate. How do I use Qt and OpenGL with Visual Studio?
    Thanks
    Alexandros

    Hi ClassicalGuitar,
    The forum supports VS setup and installation. And your issue is not about the forum. I will move the thread to off-topic forum. Thanks for your understanding.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • Using Excel with Visual C++ 6.0 (need a graph control that behaves as much like the one in CVI as possible)

    I hate to beat this to death but I was unable to find a
    clear answer to this question.  Does NI provide Excel control from within
    Visual C++ 6.0? 
    I read that NI supports the ANSI-C library only for Visual C++ 6.0 users:
    Thread : "Re: Benifits of using measurment
    studio for VC++ 6.0?"
    NI REP : drohacek
    Quote  : "we made the decision to support Visual
    C++ 6.0 users only through the ANSI-C interface and not through the Measurement
    Studio MFC-based class libraries."
    If there is a suggested way of controlling Excel from within Measurement Studio
    for Visual C++ 6.0 then I’d love to know it. 
    If not, can a plain statement be made basically stating that if you want
    to control Excel you can’t use a Visual C++ 6.0 environment even with Measurement
    Studio support?
    With .NET of course you can just decide to have Excel support added during
    project creation.  CVI can act as an ActiveX server and easily control
    Excel just by building off the examples shipped with CVI.  I see that
    there is support, using the Measurement Studio for Visual C++ 6.0 Project Wizard,
    for taking existing CVI projects and converting them to Visual C++ 6.0 projects
    or for calling CVI libraries from a .dll from within Visual C++ 6.0.  I suppose I could do the work
    in CVI and then convert the project but I'm so deeply tied into all my MFC calls that I don't see
    how I can cleanly include the CVI libraries into my existing VC++ 6.0 projects.
    What I'm really after here is a visual graph control like the one in CVI that I
    can use from Visual C++ 6.0.  I purchased a 3rd party graph control for use
    in VC++ 6.0 that works well but isn't really visual.  I mean you can't
    enter any values in it until you run the program and fill it out programmatically. 
    Then you can see which columns are two narrow, quit the program, adjust the
    column width of your now empty control, and repeat, until you get the thing
    looking the way you want.  If I could call into Excel from within Visual
    C++ 6.0  the way I do from within .NET
    then I could use Excel to hold the table and just read in the values into my table
    control at run time.  Basically I'd use Excel as a visual development tool
    for all my tables.
    I do all my coding from within CVI and Measurement Studio for Visual C++
    6.0.  I'd use CVI for everything if I didn't depend so heavily on certain
    outside controlled C++ .dll's.  Could you please suggest then what I can
    do to get Excel support for Visual C++ 6.0?
    Last question :
    Is there any plan to ever have a NI table control like the CVI table control for
    use in Visual Studio?  One that you can
    completely set up before you do any compiling? 
    I imagine that the way Microsoft sets up their environment makes this idea impossible.  Otherwise someone would
    have come up with a truly “visual” table control before now.
    Thanks,
    Grant
    Grant M. Johnson
    Project Engineer
    LECO Corporation

    Hello Grant
    You can most certainly use Excel with VC++ 6.0. Measurement Studio won't provided you with any classes to talk to Excel in VC++ 6.0. This is because Excel allows control via Automation and you can use its automation API to do anything you need with Excel. This is what CVI uses as well.
    You can see this MSDN article on how to set this up. This mentions VC.NET, but it should work the same way.
    Here is one that talks about VC 6.0 and Excel.
    Here is a code project article about this.
    Even with .NET, you have to do thru the Excel Automation support. Excel started shipping with Primary Interop Assemblies (PIA) which are .NET wrappers about the Excel Automation object model. C++ Automation is definetely not as nice as .NET, BTW
    See this document for more information about the Excel object model.
    I would not recommend using the CVI Excel libraries if all you want to use them for is Excel automation. You will end up creating un-necessary dependencies and go through extra layers that way. You can make calls straight to Excel from VC++ without requiring CVI.
    One quick observation about your excel approach. If you decide to use Excel as your table, you might be requiring everyone who uses your application to have Excel installed on their machines. Just wanted to make sure this was acceptable to you.
    Have you looked at the Datagrid Activex control, which is one of the common controls that ships with Visual Studio? You can add it to Visual Studio by right-clicking and picking it from the list of installed activex control. If you have not already, you should check it out.
    Microsoft has made significant improvements in the number of controls they provide with .NET. They have a Datagrid control that seems to be what you need.
    Measurement Studio did add some high level classes for Excel and Word Automation that simplify some common tasks, but these exists for VS 2003 C++ and VS 2005 C++, not for VC 6.0. Underneath, we end up using the same Excel automation classes, so you can easily setup something similar for VC 6.0. Plus you can find alot of references online on how to use the Excel Automation object model with C++.
    We currently have no plans in Measurement Studio to create a table control unfortunately. I am assuming when you said graph, you actually meant table, since Measurement Studio already  provides a ActiveX graph controls for VC++ 6.0 that is very similar to the CVI graph.
    On a side note, VC++ 6.0 is really really old. Have you considered upgrading?
    To summarize
    - Yes, you can use Excel with Vc++ 6.0 without mstudio.
    - Try using the Datagrid Activex control if you just need a table.
    - Measurement Studio provides high-level excel and word classes for VC++ 6.0
    - Measurement Studio provides a graph control for VC++ 6.0 which is very similar to the CVI graph.
    - Measuremnt Studio does not have a table control.
    - VC++ 6.0 is really really old. Have you considered upgrading?
    Bilal Durrani
    NI

  • Move a Excel 2010 Dokument Addin Project (Visual Studio 2012) to another devleopment machine with Visual Studio 2012 , but Office 2013

    Hi 
    we do have the following situation
    on computer A there is a Excel Document Addin development project , Visual Studio 2012, Office 2010 installed. All works fine.
    we would like to bring the project to another machine with Visual Studio 2012, but Office 2013 installed.
    Visual Studio can not build the project. It says that the application is not installed on the machine (though Excel 2013 is installed , but not Excel 2010) It seems to have a problem with the
    vbproj. 
    In other forums I found a hint that "Hostpackage = ..} needs to be set accordingly in the vbproj. I created then a "empty Excel-Addin project" under Visual Studio , looked at
    the Hostpackage entry, put that into the vbproj of "problem project. It still does not work.
    It would be great if anyone could help.
    Thomas

    Hello Eugene
    Problem is that it says that projectboard (the name of the main project) can not be loaded. All other projects in the solution can be loaded. Strange thing is , now that I try to create a empty excel Project it says that according to Excel security settings
    it can not be generated !? 
    I opened then Excel and set all Trust Center settings to "Default" - but no effect. I really have no idea what is wrong ..!? 
    Tom

  • SharePoint Connection not available with Visual Studio 2013

    I've installed Visual Studio 2013 in my SharePoint 2010 environment. When I try to add the existing SharePoint Connections I've used in Visual Studio 2010 there is always the same error: Remote SharePoint site connections are not supported. The SharePoint
    site is located at the same server, I'm able to access the Central Administration with Visual Studio 2013, but I can't access my development SharePoint Web Application.
    I'm sure I do have access to the configuration database, in Visual Studio 2010 I'm able to delete and add SharePoint Connections without any problems. The URL of the development SharePoint connection (like sp1.sharepoint.contoso.com) is not named like
    the URL of the Central Administration (like servername:5000). The port of my development SharePoint is 80, but I can't access with servername:80 too. My account is in the group of the local administrators, Visual Studio is started as Administrator
    and my account is a SharePoint farm administrator and additionally a site collection administrator of all site collections in my SharePoint web application.
    Any idea what's wrong with this SharePoint connections?
    Thanks in advance. Georg

    Can you try the following workaround and see if it helps? First try adding host entry for your server name and if that works change it to sp1.sharepoint.contoso.com.
    SharePoint
    2013 Visual Studio Project Error – “Cannot connect to the targeted site”
    I understand your situation is different than the one mentioned in the blog but given you seem to have all the permission so may be you try and see if the error is because of above issue. Actually if above does not work (assuming your are on your development
    environment), try adding your account to DB Owner on your site collection database as mentioned here.
    http://www.sharemuch.com/2010/03/19/resolving-vs-2010-solution-deployment-issues-for-sharepoint-2010-projects/
    Amit

  • Crystal Report Dll problem with Visual Studio 2005

    I am using Crystal Reports with Visual Studio 2005. At one time there were two different version of Crystal Decision Dll in Global Assembly Cache (GAC). So I uninstalled both the versions and then only installed 10.2.3600.
    I am facing the following error when building my application in visual studio.
    The type 'CrystalDecisions.CrystalReports.Engine.ReportDocument' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\arms website\301a5b02\e03ad7d9\assembly\dl3\c30f5560\00f92427_3857ca01\CrystalDecisions.CrystalReports.Engine.DLL'
    and
    'c:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.CrystalReports.Engine\10.2.3600.0__692fbea5521e1304\CrystalDecisions.CrystalReports.Engine.dll'
    I have only installed it in .Net Framework. For some reason it appears in the temp folder. I cannot delete it and when I renamed it after the next compile it came back again.
    I would appreciate any help.

    Thanks for the tip.
    I installed CR XI R2 with SP2 and 2.1
    There are few reports in the system they use to run fine but now when I try to run them I get the following error:
    Failed to open the connection. Details: [Database Vendor Code: 4060 ] Failed to open the connection. C:\DOCUME1\SSheikh\LOCALS1\Temp\ZGA370 {71BFCD35-F652-48C8-896D-B93229A4D2C2}.rpt Details: [Database Vendor Code: 4060 ]
    I understand that these reports run ok independently and on production machine as well; however when I try to run them from my development machine I get the above error.
    I would appreciate help to resolve this. The code of the report is with report developer and I need to know what settings do I need to change where to be able to run the reports. Also I use my machine for deployment of application on the production server.
    Thanks.

  • Integrating Crystal Report 2008 Developer with Visual Studio 2008 Standard

    I have Crystal Reports 2008 Developer version 12.0.0.683 on my computer. I also have Visual Studio 2008 Standard. I know the standard edition of VS 2008 does not have the bundled crystal reports, but since I bought the full version of CR 2008 separately, I figure I should be able to use CR within VS 2008. The problem I am facing is integrating Crystal Reports with Visual Studio, so I can create reports from within visual studio.
    Crystal Reports was installed first and then Visual Studio. As per suggestions on this and other forums, I repaired my installation of Crystal Reports, but that did not help. I then ran Visual Studio integration manager, but when I run it, it only detects Visual Studio as the currently installed IDE, but does not detect CR 2008. I downloaded service pack 2 for CR, but have not installed it yet. I do not want to install it if it is not going to help. I would also like to avoid uninstalling my copy of CR if at all possible.
    I am a newbie at development in visual studio. Any help will be highly appreciated.
    Thanks,
    Rajib

    Don't want to go against what Jason said as it may be correct - if we go strictly by the documentation provided (sorry Jason, Dan says...). However, here is something to try;
    Uninstall CR. Look for any left overs; c:\program files\business objects\... and delete all of that.
    Look in the registry for HKLM\software\business objects and remove the business objects entry.
    Download CR 2008 from here:
    http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx
    That is a trial version and I believe it is already at SP 1. Use your keycode to install. Once this is done, you should have the ability to use CR in .NET. I'd recommend you do apply sp 2 now also.
    Ludek
    Follow us on Twitter
    http://twitter.com/SAPCRNetSup

  • Crystal Report X1 compatibility with Visual Studio 2008

    We are migrating an application running on .NET 1.0 to .NET 3.5. Previously Crystal report X1 was working fine with .NET 1.0 however now when it has been migrated to .NET 3.5, we are able to generate crystal report but print and export functionality is not working.
    Please confirm if Crystal report X1 is compatible with Visual studio 2008/.NET 3.5? We even updated Release 2 SP4 patch but that didn't solve the problem.
    If crystal report X1 is not compatible with Visual studio 2008, which version is compatible so that we can buy the license for the same?

    Hello Anurag,
    CR XI R1 is not supported for VS 2008.
    but for
    u2022 Visual Studio .NET 2002
    u2022 Visual Studio .NET 2003
    CR XI R2
    u2022 Visual Studio .NET 2002
    u2022 Visual Studio .NET 2003
    u2022 Visual Studio .NET 2005
    CR XI R3
    u2022 Visual Studio 2003
    u2022 Visual Studio 2005
    CR XI R3 Service Pack 1
    Microsoft .NET Framework
    u2022 .NET 1.1
    u2022 .NET 2.0
    u2022 .NET 3.0
    u2022 .NET 3.5
    Development Platforms
    u2022  Visual Studio 2003
    u2022  Visual Studio 2005
    u2022  Visual Studio 2008
    Hope this helps
    Falk

  • How do I use infopath 2013 with visual studio 2013 to modify forms with code?

    Dear all,
    I am using sharepoint online and infopath 2013, I wonder how do I edit infopath 2013 forms with visual studio? When I try to edit form code it says  I need visual studio 2012 and some other tools, I installed them and visual studio 2013, I wonder how
    do I get rid of the message and start coding? Can someone provide a detailed procedure of doing so? I am having trouble with creating multiple items with single infopath form with repeating table on sharepoint online. Thanks.
    Timothy

    Hi,
    According to your post, my understanding is that you want to create InfoPath form with code using Visual Studio.
    More information about develop InfoPath form with Visual Studio:
    http://msdn.microsoft.com/en-us/library/office/ee526362(v=office.15).aspx
    http://msdn.microsoft.com/en-us/library/office/aa942693.aspx  
    For the second question, I suggest you can create another post , it will be easier for others to focus on one question in one thread.
    Best regards

  • STUDENT WITH VISUAL PROBLEMS

    Dear Adobe,
    currently I'm working in a school with young people of 18 years old. The students all study graphic design and learn indesign, photoshop and illustrator. All of our students have a disability (physically or autism). One of them has a serious problem with his eyes. For example, when he's working in Indesign he can't see the hairlines- and the design he makes are not good as a result. Can we adjust settings, line-thickness or anything? (Zooming doesn't do it) Hopefully we can find a sollution because otherwise he will fail this year's course. greetings Bert

    I think you're missing the point. We are evaluating if the student can 
    stay at the school because his visus-problems are so big (multiple 
    problems-not only hairlines). So now we are asking for help, if you 
    know a sollution, I would like to hear it.
    www.bekvis.be
    T. 0032 486 75 71 63
    BE96779599505605
    0831.994.338
    Op 08 Sep 2013, om 18:53 heeft MW Design het volgende geschreven:
    Re: STUDENT WITH VISUAL PROBLEMS
    created by MW Design in InDesign - View the full discussion
    Hairlines? What is their use?
    >
    And why cannot his designs avoid the use of hairlines? Seems rather 
    harsh to fail a student for the inability to avoid the use of 
    hairlines.
    Please note that the Adobe Forums do not accept email attachments. 
    If you want to embed a screen image in your message please visit the 
    thread in the forum to embed the image at http://forums.adobe.com/message/5663190#5663190
    Replies to this message go to everyone subscribed to this thread, 
    not directly to the person who posted the message. To post a reply, 
    either reply to this email or visit the message page: [http://forums.adobe.com/message/5663190#5663190
    To unsubscribe from this thread, please visit the message page at [http://forums.adobe.com/message/5663190#5663190
    ]. In the Actions box on the right, click the Stop Email 
    Notifications link.
    Start a new discussion in InDesign by email or at Adobe Community
    For more information about maintaining your forum email 
    notifications please go to http://forums.adobe.com/message/2936746#2936746

  • Compile Plug-in with Visual Studio 2010 beta

    Hello there,
    I know that only Visual Studio 2005 is supported for the Acrobat SDK. But maybe one of you is also experimenting with visual Studio 2010 and got it to work.
    I get the following error message. Did anyone solve this problem.
    Error    105    error MSB3073: The command "if not "¬roSDKPIDir%"a == ""a if not exist "¬roSDKPIDir%" mkdir "¬roSDKPIDir%"
    if not "¬roSDKPIDir%"a == ""a copy "C:\Users\test\Documents\Visual Studio 2010\Projects\EPapers_Button\EPapers_Button\Debug\EPapers_Button.dll" "¬roSDKPIDir%"
    if not "¬roSDKPIDir%"a == ""a echo EPapers_Button copied to "¬roSDKPIDir%".
    if "¬roSDKPIDir%"a == ""a echo not performed. AcroSDKPIDir environment variable not set.
    :VCEnd" exited with code 255.
    Thanks for your help.

    this is something that i tried i set AcroSDKPIDir to
    C:\acrobatxsdk\Adobe\Acrobat 10 SDK\Version 1\PluginSupport\Samples\WeblinkDemo\win32\Debug
    and in th e post build events i did the following
    <Target Name="PostBuildEvent" Condition="'$(PostBuildEventUseInBuild)'!='false'">
        <Message Text="Description: %(PostBuildEvent.Message)" Condition="'%(PostBuildEvent.Message)' != '' and '$(AcroSDKPIDir)'"/>
        <Exec Command="%(PostBuildEvent.Command)$(BuildSuffix)" Condition="$(AcroSDKPIDir)"/>
      </Target>
    can u be plzz more specific in terms of it
    the error i got is
    Error
    84
    error MSB4100: Expected "$(AcroSDKPIDir)" to evaluate to a boolean instead of "C:\acrobatxsdk\Adobe\Acrobat 10 SDK\Version 1\PluginSupport\Samples\WeblinkDemo\win32\Debug", in condition "'%(PostBuildEvent.Message)' != '' and '$(AcroSDKPIDir)'".
    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets
    112
    61
    WeblinkDemo

  • Compatibility with Visual Studio 6.0

    Can Acrobat SDK v8.1 or version 9 be used with Visual Basic 6.0?  All of the sample vb apps correspond with VS 2005.

    VS2005 was the only version tested with SDK 8.1 / 9 / 9.1.  That isn't to say you couldn't make it work with VS 6.0, but it wouldn't be supported and you certainly would be running a risk of some unexpected behavior in your projects.

  • Can you tell me how to measure audio signal frequency in measurement studio with visual basic 6.0?

    I'd like to measure two differential input signal(I.e. A+ and A-),below is two test projects,
    1.connect A+/A- to PCI 6052E card's ACH0/ACH8 ,and refer to GND for testing
    2.connect respectively A+/A- to PCI 6052E card's ACH0/ACH8 for testing
    Could you tell me the details of the second project?and give me a illustration in measurement studio with visual basic 6. 0 about the second?
    In addition,I would like to measure the audio signal frequency,could you give me a illustration in measurement studio with visual basic 6.0?
    Wait for your reply!

    Dear kelven,
    Thank you for contacting National Instruments.
    To address your question, there are Analog Input shipping examples that demonstrate how to measure an analog input differentially, as you specify in (2).
    As for measuring the audio signal frequency, you may want to check out the following KnowledgeBase. The link is:
    http://digital.ni.com/public.nsf/websearch/4b08380530d72d3b86256340004c3005
    Let me know if you have any further questions or if this does not resolve your issue.
    Thanks again and have a great day!
    Chad AE
    Applications Engineer - National Instruments

  • Create plug-in for Adobe with Visual Studio 2008

    Hi to all, I'm Italian excuse for my english,
    I see Adobe SDK Help, but I don't see something for built a plug-in with Visual Studio 2008, I see only built with Visual Studio 2005!
    my asks is : Because ? Can I create a plug-in with Visual Studio 2008? if yes WHAT did it?
    thanks

    Post your question in the 'Acrobat Developers SDK' forum.

Maybe you are looking for