dll内调用AfxGetApp到底是得到谁的指针
1个回答
展开全部
//Thisisthestandard,stablewayofmapping,whichsupportsextensive//customizationandmappingofJavatonativetypes.publicinterfaceCLibraryextendsLibrary{CLibraryINSTANCE=(CLibrary)Native.loadLibrary("TestDLL.dll",CLibrary.class);//函数声明byte[]和String都试过,都不行,改变不了传递进去的字符串intgetXMLResult(byte[]result);}/***@paramargs*/publicstaticvoidmain(String[]args){//TODOAuto-generatedmethodstubSystem.out.println("begin");//WStrings=newWString("Hello,World");//System.out.println("s="+s.toString());byte[]c={'a','a','a','a'};System.out.println("c="+Native.toString(c));//ByteByReference[]iref=newByteByReference[4];inti=CLibrary.INSTANCE.getXMLResult(c);System.out.println("i="+i);System.out.println("c="+Native.toString(c));//System.out.println("s="+s.toString());System.out.println("end");}}Java中byte[]c初始化,调用DLL中函数,但byte[]c的值没有被修改。===============================================================现在知道用空宽渣Memory来处理指巧宴针的问题,斗悄调用C的函数声明修改如下:
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询