转换它 - marshal.stringtohglobalansi(“hello world”)到JAVA代码 [英] Convert it - marshal.stringtohglobalansi("hello world") to JAVA code

查看:685
本文介绍了转换它 - marshal.stringtohglobalansi(“hello world”)到JAVA代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题非常简单我需要下面的替代代码

Question is very simple I need alternate code for below line

IntPtr i =Marshal.StringToHGlobalAnsi("Hello World");





我很挣扎,请帮助我。



我尝试了什么:



从2天开始尝试所有可能的解决方案。但是没有输出。



I am struggling a lot for same please help me.

What I have tried:

From 2 days trying every possible solution. But no output.

推荐答案

不,你没有尝试过所有可能的解决方案,因为我昨天在http://www.codeproject.com/Questions/1130172/Csharp-code-to-JAVA-code [ ^ ]您需要做什么。所以现在你需要回去做。在Java和C / C ++ dll之间进行接口的唯一方法是使用JNI。并且您不能使用C#作为代码的模型,您需要检查DLL的要求并从那里开始工作。
No you have not tried every possible solution, because I told you yesterday in http://www.codeproject.com/Questions/1130172/Csharp-code-to-JAVA-code[^] what you need to do. So now you need to go back and do it. The only way to interface between Java and a C/C++ dll is by using the JNI. And you cannot use C# as a model for the code, you need to check the requirements of the DLL and work from there.


这篇关于转换它 - marshal.stringtohglobalansi(“hello world”)到JAVA代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆