3,778 questions
1
vote
1
answer
95
views
How do I send a string to this unmanaged C++ function?
I have a .dll written in C++ with a C style API. I have successfully implemented various interop methods but this one is causing exceptions.
BL_API BLResult BL_CDECL bl_image_write_to_file(const ...
0
votes
2
answers
130
views
Allow null for Flask restx's expect
I have setup a Flask project using the flask restx to help me validate the input JSON payload. Note: I am also using restx's Namespace for other things too, so I have ns instead of blueprint
I have ...
1
vote
0
answers
132
views
How to provide custom marshaller to have alternative behavior for tagged fields
Background
I have an application that uses gRPC to communicate with other services. Nothing fancy.
The data exchange includes fields representing SHA-1, SHA-256 and UUIDs, which are stored as bytes. ...
-4
votes
1
answer
206
views
How to pass raw JSON with spaces and tabs to a struct in Go without extra escaping or marshaling
I'm working with a Go application where I need to pass raw JSON data to a struct field, but I am encountering issues with extra escaping when marshaling the struct, especially when the raw JSON ...
0
votes
0
answers
74
views
CXF XJC generation force List<String> to return null instead of empty list with JABX bindings
I'm using cxf xjc plugin version 4.0 to transform a schema to a java class, but this is generating a class that when a list is null, it returns an empty list, but I need the null, so I'm using JAXB ...
1
vote
1
answer
86
views
How to handle a string returned by a .NET exported function in Pascal Script (Inno Setup)? [duplicate]
I’ve created a .NET DLL with exported functions using DllExport, and I would like to call one of these exported functions from the Pascal Script in Inno Setup to retrieve their return value.
Please ...
-1
votes
1
answer
63
views
Go customize json output on one single field
Would using encoder.Encode within Go's customized json marshal function be causing goroutine stack overflow?
Please take a look at (enclosed below)
https://go.dev/play/p/KXLH0B20b1u
Using encoder....
0
votes
1
answer
23
views
what is subclass tf.keras.layers.Layer instead of using a Lambda in this code?
An example of replacing a lambda with a subclass in code is as follows:
scale = tf.Variable(1.)
scale_layer = tf.keras.layers.Lambda(lambda x: x * scale)
Because scale_layer does not directly track ...
0
votes
0
answers
39
views
Jaxb Java: Ordering list of string
Is there a way to "force" the marshaller to respect the order of the elements inside the XmlElementsRefs annotation applied to a list of objects?
I have a Java Class which has an attribute ...
0
votes
1
answer
79
views
Serialize a java enum with multiple values
Here is a simplified version of the actual problem.
I have an enum with each entry having multiple properties
enum MyEntries{
ENTRY1("1","property1"),
ENTRY2("2",...
-1
votes
2
answers
126
views
marshall unmanaged structure to C#
how can I translate this unmanaged structure into c#.
typedef struct _EC_VARIANT {
union {
BOOL BooleanVal;
UINT32 UInt32Val;
...
-3
votes
1
answer
103
views
How to use one or another variable to json marshal with same json tag
Supose I have the structure:
type foo struct {
Name string `json:"name"`
AgeYears int `json:"age" rlp:"optional"`
AgeTimestamp time....
1
vote
1
answer
1k
views
C# LibraryImport string output parameter marshalling
I have a native function that will write a string to a buffer provided in the call along with its size. Let's call it GetFooString(LPStr str, int strLen).
I found out so far that with DllImport the ...
1
vote
1
answer
69
views
How to serialize a list of Java Object to XML using javax.xml library with proper parent/child node names
I have a list called Documents that is comprised of different Document objects I created. I am trying to serialize the list to look like this:
<Documents>
<Document>
.
.
.
&...
1
vote
0
answers
91
views
C# Source Generator Native Marshaling - Use Type Defined in Another Assembly?
We're currently modernizing our native interop implementations for marshaling data between C# and mainly C++ using source generators together with MarshalUsing attributes and CustomMarshallers, etc.
A ...
0
votes
1
answer
127
views
contextPath is not allowed to appear in element oxm:jaxb2-marshaller, when upgrading to Spring Framework 5
Background
Upgrading from Spring Framework 4.3.30.RELEASE to 5.0.20.RELEASE
Using oxm:jaxb2-marshaller
Problem
After upgrading the Spring Framework dependency version, the application fails to start ...
1
vote
2
answers
115
views
JS Object Standard Prototype as a Symbols
Looks like it is not really feasible or very tricky still I'll take a try.
Say we have a config data of a fluent structure for user to provide.
E.g.
configRoot:
fluentSubSection:
someProp: 12
...
0
votes
0
answers
49
views
How can I make sure that unused bytes in a struct are zeroed out?
I have this structure:
[StructLayout(LayoutKind.Explicit, Size=56)]
public struct SaveDataDialogNewItem {
[FieldOffset(8)]
public IntPtr iconBuf;
[FieldOffset(16)]
public ulong ...
0
votes
1
answer
168
views
LibraryImport causes Marshal.GetLastWin32Error() to always return 0
When converting
[DllImport("advapi32.dll", SetLastError = true)]
internal static extern bool QueryServiceStatusEx(SafeHandle hService, int infoLevel, IntPtr lpBuffer, uint cbBufSize, out ...
1
vote
0
answers
125
views
How to send a WM_IME_REQUEST message from C#
I'm working on an IME tool. To figure out the caret position of the foreground window, I'm supposed to use SendMessage() to send a WM_IME_REQUEST (0x0288) message, along with the parameters:
wParam: ...
1
vote
1
answer
227
views
Marshaling gives error "Attempted to read or write protected memory. This is often an indication that other memory is corrupt"
I need to use C library for working with NetCDF file format in my C# project. To receive some portion of informtaion from NetCDF file, i need to use methods nc_open to open CDF file, nc_inq_att to get ...
1
vote
0
answers
46
views
JAXBContext Unmarshaller Marshaller
When i am doing unmarshalling and marshaling for xml file that have different name spaces i want explicitly apply name space type to each child.
Original document:
<?xml version="1.0" ...
0
votes
0
answers
70
views
Connect to Running Program via COM - Marshal.GetIUnknownForObject
I am using a software package that offers an "extension" package, largely undocumented, that allows for creation of extensions that allow automation within the program. It's a COM interface ...
-1
votes
1
answer
134
views
Proper way to marshal char* to string using C# interoperability. Get "a heap has been corrupted" exception
not a lot of experience in C++. Attempting to Marshal char* in C to string in C#, using [MarshalAs(UnmanagedType.LPStr)], but I get a "a heap has been corrupted" exception. It does however ...
1
vote
0
answers
82
views
Marshalling double pointers in C#
I have to interact with a provided C library where one of the functions is declared as follows:
int GetFileList(struct spiflash_file **ptr_spiflash_filelist, int **file_num);
where **...