marshalling

Type marshalling to call a fortran subroutine from C#

笑着哭i 提交于 2019-12-20 03:33:09
问题 I'm trying to call a FORTRAN77 subroutine from C# code using P/invoke - in case you're interested, I'm trying to wrap some of the functionality offered by the ARPACK library (http://www.caam.rice.edu/software/ARPACK). I have 2 questions. First off, I couldn't find clear instructions anywhere regarding type marshalling in this context. More specifically, here are the types that are declared in my FORTRAN subroutine: subroutine getEigenVectors & ( Matrix, n, which, nev, ncv, maxn, maxnev,

Marshalling XML to Java with elements “anyAttribute” and “any” in XSD

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-20 02:50:10
问题 I am stuck with this XSD and JAXB problem... Please help me out... What I need to achieve is to fully generate the xml below. <?xml version="1.0"?> <GovTalkMessage xmlns="http://www.govtalk.gov.uk/CM/envelope"> .... <Body> <IRenvelope xmlns="http://www.govtalk.gov.uk/taxation/PAYE/RTI/FullPaymentSubmission/15-16/1"> .... </IRenvelope> </Body> </GovTalkMessage> Here's an example of the full xml file I need to create from Java: SUBMISSION_REQUEST.xml . Here's a summary of what I have done:

How To Marshal Int Arrays Or Pointers To Int Arrays

心已入冬 提交于 2019-12-19 19:52:46
问题 (I understand this might be duplicate but I don't understand the other threads) I'm working with C# an I have a third party dll that needs int arrays (or pointers to int array) as parameters. How do I marshal an int array between C# and C/C++ ? The functions are declared like this: // reads/writes int values from/into the array __declspec(dllimport) void __stdcall ReadStuff(int id, int* buffer); In C int* would be a pointer right ? So I'm confused if I have to use IntPtr or if I could use int

JAXB Marshalling generic list with variable root element name

落花浮王杯 提交于 2019-12-19 18:52:46
问题 So I'm trying to marshal a generic list of objects, but i want each list to have a specific XmlRootElement(name..). The way I'm doing it, I know it's not really possible without writing a specific wrapper class for each type of object and declaring the XmlRootElement. But maybe there's another way...? Consider the following classes: abstract public class Entity { } @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name="user") public class User extends Entity { private String username;

C# and void pointers

风流意气都作罢 提交于 2019-12-19 18:47:41
问题 I am writing my first C# application, but as luck would have it I must use void pointers (working with a DLL which returns handles). From what I read there are a few options: Unsafe code, for example see http://www.c-sharpcorner.com/UploadFile/gregory_popek/WritingUnsafeCode11102005040251AM/WritingUnsafeCode.aspx In the C# program writing in my function declerations IntPtr instead of void*. e.g.: public static extern char SupportsWhatever(IntPtr h); Using ref, e.g.: public static extern char

NullReferenceException during C++ callback to C# function

杀马特。学长 韩版系。学妹 提交于 2019-12-19 17:42:03
问题 developers! I have very strange problem. My project has DLL writen in C++ and a GUI writen in C#. And I have implemented callback for some interoperability. I planed that C++ dll will call C# code in some circumstances. It works... but not long and I cant understand why. The problem marked in comment in C# part Here the complete code of simplified sample: C++ DLL: #include <SDKDDKVer.h> #define WIN32_LEAN_AND_MEAN #include <windows.h> BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason

How to generate end tag for empty element in XML using JAXB

99封情书 提交于 2019-12-19 17:36:42
问题 I'm generating XML using JAXB. But JAXB is generating an empty Tag closing it self. But my client want separate empty tag. I know both are equals but he is not agree with me. please any one suggest the solution. Thanks. Sample code: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "currencyCode", "discountValue", "setPrice", "spendLowerThreshold", "spendUpperThreshold", "discountApportionmentPercent", "discountApportionmentValue" }) @XmlRootElement(name = "countryData")

Why CXF / JAXB read whole InputStream into memory before marshalling to SOAP message

浪子不回头ぞ 提交于 2019-12-19 14:03:11
问题 INFO - Sample code I've set up sample code (SSCCE) for you to help track the problem: https://github.com/ljader/test-cxf-base64-marshall The problem I'm integrating with 3rd party JAX-WS service, so I cannot change the WSDL. The 3rd party webservice expects Base64 encoded bytes to perform some operation on them - they expect that client sends whole bytes in SOAP message. They don't want to change to MTOM / XOP, so I'm stuck with current requirements. I decided to use CXF to easily set up

Marshalling complex struct to c#

空扰寡人 提交于 2019-12-19 10:52:14
问题 i'm still struggeling to marshal a quite complex struct from c++ to c#. The struct in c++ is the following: typedef struct { DWORD Flags; DWORD TimeCode; DWORD NodeMoving; Matrix NodeRots[NUM_GYROS]; Vector Position; DWORD ContactPoints; float channel[NUM_CHANNELS]; } Frame; Vector: typedef struct { union { struct { float x, y, z; }; float Array[3]; }; } Vector; Matrix: typedef struct { union { struct { float xx, xy, xz; //This row is the right vector float yx, yy, yz; //This row is the up

Problems marshalling a map in Jaxb

╄→尐↘猪︶ㄣ 提交于 2019-12-19 10:14:20
问题 I have a class world that contains a map of humans. If I marshal the class world I get following output: <world> <humans> <human key="2"> <value> <name>Tom</name> </value> </human> <human key="1"> <value> <name>Max</name> </value> </human> </humans> </world> But I dont want to display the "value"-Tag. It should look like: <world> <humans> <human key="2"> <name>Tom</name> </human> <human key="1"> <name>Max</name> </human> </humans> </world> Is this possible? Here is the code of class world and