Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Question is very simple I need alternate code for below line
IntPtr i =Marshal.StringToHGlobalAnsi("Hello World");


I am struggling a lot for same please help me.

What I have tried:

From 2 days trying every possible solution. But no output.
Posted
Updated 19-Sep-16 21:33pm
Comments
Mehdi Gholam 20-Sep-16 2:15am    
The code is used for pinvoking to Windows, which might not make sense with java on non windows systems.

1 solution

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.
 
Share this answer
 
Comments
[no name] 24-Sep-16 8:49am    
Thanks Great Help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900