Marshalling Date type
I'm trying to marshal a VB6 structure but I don't know how to marshal the Date type ex: DateSaved As Date and the following array of strings: FASTNESSNAME(1 To 6) As String * 16 Thanks in advance for the help. ...
I'm trying to marshal a VB6 structure but I don't know how to marshal the Date type ex: DateSaved As Date and the following array of strings: FASTNESSNAME(1 To 6) As String * 16 Thanks in advance for the help. ...
I have a MyBean annotated @XmlRootElement public class MyBean ... Marshalling/Unmarshalling MyBean w/o problems, e.g. JAXBContext jaxbCtx = JAXBContext.newInstance(MyBean.class); Marshaller m = jaxbCtx.createMarshaller(); m.marshal(myBean, writer); How can I use JAXB to marshall/unmarshall a Collection or List? My attempt results ...
typedef union _Value { signed char c; unsigned char b; signed short s; unsigned short w; signed long l; unsigned long u; float f; double *d; char *p; } Value; typedef struct _Field { WORD nFieldId; BYTE bValueType; Value Value; } Field; typedef s...
In beej's guide to networking there is a section of marshalling or packing data for Serialization where he describes various functions for packing and unpacking data (int,float,double ..etc). It is easier to use union(similar can be defined for float and double) as defined below and transmit integer.pack as packed version of integer.i, ...
I've an unmanaged dll that exports the folowing function: SomeData* test(); Let's assume SomeData as: typedef struct _Data Data; struct _Data{ int a; int b; } Now i want to call this function from C# code. I start to define the C# Struture needed to custom marshaling like this: [StructLayout(LayoutKind.Sequen...
There seems to be quite a bit of folklore knowledge floating about in restricted circles about the pitfalls of hash-consing combined with marshalling-unmarshalling of data. I am looking for citable references to these tidbits. For instance, someone once pointed me to library aterm and mentioned that the authors had clearly thought about...
I want to use PInvoke to bring to managed side something this: (C code) typedef struct{ //some fields... } A; type struct{ A* a; } B; int getB(B* destination){ //destionation will be an output parameter to C# //puts an B in 'destination' return 0; } Now, i need a way to tell managed...
Hi All, I have a simple application that loads an unmanaged dll and passes a few string values to it from C#. But in the C++ dll application, I receive an exception :: Tried to access a read/write protected memory. My DLL Import looks like this: [DllImport("X.dll", CallingConvention = CallingConvention.Cdecl) ] public static extern int...
By default, jaxb 2 lists all (all possible required) namespaces in root element during marshalling: Is there a way to describe namespace in each element instead of root element ?: It also solves the problem of "unnecessary namespaces", which is also important in my case. Any suggestions appreciated. ...
By default, jaxb 2 lists all (all possible required) namespaces in root element during marshalling: <rootElement xmlns="default_ns" xmlns:ns1="ns1" xmlns:ns2="ns2"> <ns1:element/> </rootElement> Is there a way to describe namespace in each element instead of root element ?: <rootElement xmlns="default_ns"> <...
Hi, I've got a class that has constructor: public ContEmpirical(double xs[], double fs[]) { Check.check(xs.length == fs.length + 1 && fs.length > 0, "Empirical distribution array mismatch"); this.xs = new double[xs.length]; this.xs = xs; this.cs = new double[xs.length]; double fTotal = 0.0; for (int...
Hello, I'm after help on how to use complex objects either as return values or passed as parameters to C# class methods exposed to unmanaged C++ as COM components Here's why: I'm working on a project where we have half a dozen unmanaged C++ applications that each directly access the same Microsoft SQL Server database. We want to be ab...
I'm trying to use CredWrite, but get an ERROR_INVALID_PARAMETER 87 (0x57) error. The intent is to have a secure place to save the user's password for my .net WPF application. And my code: public class CredMan { private const string TARGET_PREFIX = "myappname:"; public static void SavePassword(string username, string password)...
I am writing a Resteasy server application and am having trouble getting my superclasses to marshal. I have code something like this: @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement(name = "person") class Person { protected String name; @XmlElement(name = "name") public String getName() { return name; } public void setNam...
Hi, I'm trying to register my castor mapping files with spring and I appear to be getting a null pointer exception. In my application context I have: <bean id="xmlContext" class="org.castor.spring.xml.XMLContextFactoryBean"> <property name="mappingLocations"> <list> <value>DistributionSamplerMappings.xml</value>...
I want to send Interface Ref of IVApplication from Visio Add-in to my other one COM server. But I have Ole exception. Now i do that: Code in Visio Add-in: var IStrm: IStream; hres: HResult; rhglobal: HGLOBAL; VisioAppl: IVApplication; begin hres := CreateStreamOnHGlobal(0, TRUE, IStrm); if Succeeded(hres) then ...
I passed ref of interface from Visio Add-ins to MyCOMServer (http://stackoverflow.com/questions/2455183/interface-marshalling-in-delphi).I have to pass interface as pointer in internals method of MyCOMServer. I try to pass interface to internal method as pointer of interface, but after back cast when i try call method of interface I ge...
I know there's a way, I know I've done it (a long time) before, but I can't remember or find out how to do it!!! var otherDomain = AppDomain.Create("Lol my memory sucks"); var myRemotableType = typeof(MyTypeThatExtendsMBRO); var proxy = otherDomain .CreateInstanceAndUnwrap( type.Assembly.FullName, type.FullName); // how...
I have some legacy code I want to port to C#. I cannot modify the C++ code, I just have to make do with what I'm given. So, the situation. I'm using SwIG, and I came across this function: void MarshalMe(int iNum, FooClass** ioFooClassArray); If I ran SWIG over this, it wouldn't know what to do with the array, so it will create a SWIG...
Hi, I've used JAXB Marshaller as well as my own marshaller for marshalling pure java bean objects into XML. It has been observed that both of them require almost same time to marshal. The performance is not acceptable and needs to be improved. What are possible ways where we can improve performance of marshaller? Like threading? ...