开发者

dll having method returning a class

开发者 https://www.devze.com 2023-03-03 13:20 出处:网络
How could I create a method in dll written in c++ which returns a class, and how could I use that dll in java?

How could I create a method in dll written in c++ which returns a class, and how could I use that dll in java?

If i am export that class th开发者_StackOverflow中文版e name of that class get changed. Could any body help me? Thanks in advance.


You can't export a C++ class from a DLL and use it from a different compiler. What you can, and should, do is to export a COM object.


You can't. You could use JNI, but that's pretty horrible, and you'll have to write the code to convert from a C++ object to a corresponding Java object.

You could also look at JNA, which tries to make this a little easier.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号