![](/img/trans.png)
[英]How can I override default encoding when marshalling strings?
我有一個 Delphi 2007 DLL 這個出口:function TestSignString(s, Sign: PChar): LongBool; stdcall; 我使用此導入在 .NET Core v7 C# 中調用它:[DllImport(@"LibraryName.dll")] [ ...
[英]How can I override default encoding when marshalling strings?
我有一個 Delphi 2007 DLL 這個出口:function TestSignString(s, Sign: PChar): LongBool; stdcall; 我使用此導入在 .NET Core v7 C# 中調用它:[DllImport(@"LibraryName.dll")] [ ...
[英]Why jboss uses deprecated DOMSerializerImpl org.apache.xerces 2.12.0.SP03
我在部署時遇到問題,將鍵值放入 infinispan 緩存一些 object ISPN000559: Cannot marshall 'class org.infinispan.marshall.protostream.impl.MarshallableUserObject': org.w3c.d ...
[英]Allocating object inside unmanaged memory in C#
首先,我知道我什至不應該嘗試這樣做,但我喜歡嘗試一些沒有意義的事情。 我對這篇文章很感興趣,並根據我的需要進行了修改,我想通過在非托管 memory 中實現 arrays 的分配來改進它。 對於值類型(short、int、long 等),它可以工作(我還沒有嘗試過結構),但是在為對象分配數組后崩潰 ...
[英]Not able to properly map c struct to c# struct
我正在嘗試 map 中的字節數組 c#,它有 56 個字節,我得到的結構在 C 中是這樣的 我已經把它改成 我不確定我是否遺漏了一些東西,因為當我嘗試將我的 byteArray 轉換為這個結構時,但該結構沒有完全采用適當的 sizeconst 定義,任何輸入都會有所幫助。 ...
[英]Error on line 2 at column 1: Extra content at the end of the document in Spring Java (Marshaller)
我正在嘗試使用 Marshaller 將 POJO 轉換為 XML。 我想讓它像 XML<youthPolicyList> <respResult>resilt</respResult> <errMsg>200</errMsg> ...
[英]How can you fill an entire array pointer with a single value with a single write operation?
我有一個指向字節數組的指針,我需要將這個數組的某個區域的值設置為 0。我非常熟悉通過 Marshal/Buffer/Array 類可用的方法,這個問題不在都很難。 然而,問題是我不想創建過多的 arrays,或者一個字節一個字節地寫。 不過,我熟悉的所有方法都需要完整的 arrays,而且它們顯然 ...
[英]Correctly Convert const char* in C++ dll to string in C#
我正在編寫一個程序,將我的C++ dll 中的 const char*作為字符串傳遞到我的C#代碼中。 某些字符沒有按我預期的方式傳遞,這會干擾以后處理字符串。 例如C#中的"ß.\x3"到達我的C++程序時就變成了"ß®\x3" 。 在另一種情況下, "(\x2\x2"變成"Ȩ\x2" 。我相 ...
[英]Marshalling utf8 encoded chinese characters from C# to C++
我正在編組一些具有十進制表示形式(utf8)的漢字作為228,184,145,230,161,148 然而,當我在 C++ 收到這個時,我最終得到了字符-77,-13,-67,-37 我可以使用sbyte[]而不是 c# 中的string來解決這個問題,但現在我正在嘗試編組string[] ,所以 ...
[英]Marshal c# struct to C struct is not working
我想從 C# 撥打以下 C function,但它不起作用。 C代碼是.so文件的一部分。 在我的例子中,代碼應該在 Linux 環境中運行! C# 代碼是使用 .so 文件的控制台應用程序的一部分 以下是所需參數的定義:(C 代碼) 這是 nfc_tag_info_t 的定義:(C 代碼) 我 ...
[英]Marshal.AllocHGlobal instead of VirtualAlloc from kernel32.dll on dotnet core 6
我有一些遺留的非托管代碼(不安全,intptr),它多次使用 kernel32.dll 中的 VirtualAlloc 方法來分配非托管 intptr。 此代碼在從 .net 框架升級到 .net 6(核心)的項目中。 當我在 linux ubuntu 平台上發布並運行此代碼時,出現以下異常: 我 ...
[英]Go How to deal with float infinity before converting to JSON
我遇到過這樣一種情況,我有一些可能是無窮大/NaN 的 float64 字段,並且嘗試編組到 JSON 會導致有關不支持 +Inf 類型的錯誤。 該結構最初是通過另一個庫 (Google Firestore) 填充的。 實際上,這個結構要大得多,有更多的浮動字段。 我想我可以使用類似下面這個循環的 ...
[英]How do I copy part of a custom struct to a different struct in Golang
我已經堅持了幾個小時了,希望你們中的一個人能幫助我找到一個優雅的解決方案。 基本上,我有以下結構: 現在使用這些數據並沒有被證明是困難的,但現在我正在嘗試做一些我不確定是否可行的事情。 基本上我創建了另一個名為 Transfer 的結構: } 這只是我需要的 response.Data.Items ...
[英]Convert sub struct to string and back
我在使用UnmarshalJSON和MarshalJSON時遇到了一些麻煩,我不確定我是否正確理解了它們,或者至少我有一個我無法發現的錯誤,在我 3 小時的谷歌搜索中我還沒有找到,所以這里. 我有以下用戶結構type User struct { ID uuid.UUID ...
[英]Can't delete email using MAPI
我在 C# 中創建了 Outlook 加載項,並嘗試使用 MAPI 中的 DeleteMessages 方法刪除 email。 但是我總是得到 E_INVALIDARG 結果(請看下面的代碼)。 我檢查了以下文章: https://www.codeproject.com/Articles/4558 ...
[英]When I try to send message through the JmsTemplate, Jaxb2Marshaller throws an error while attempting to conver obj to xml
我嘗試使用 jaxb 庫來解析 xml。 這是我的代碼: JmsConfig.class JmsApplication 聚甲醛 因此,問題是,當我嘗試通過 JmsTemplate 以 xml 格式發送生成的 ProductDto object 時:Jaxb2Marshaller 拋出錯誤: 由以 ...
[英]Marshall C# string[] to VBScript
我有一個 Com-Visible -Net-Assembly,我想從 VBScript 使用它。 除了一個向 VBS 返回string[]的屬性外,大多數事情都可以正常工作。 界面: 實施: VBScript 客戶端: 但是,當我嘗試在 VBScript 中使用它時,我看到字符串以數組的形式出現 ...
[英]Building a struct with a field name which has a comma
我正在嘗試根據我得到的響應創建一個結構。 我無法控制響應,並且在它的結構中有字段名稱使用逗號作為文件名本身的一部分 JSON 示例: 當嘗試以“常規”方式創建結構時,我會收到一個錯誤,因為一旦我使用逗號字符, reflect.StructTag.Get需要一些特定的東西,而不是名稱的 rest。 結 ...
[英]Marshalling a System.IO.Stream object in c# COM interface
I have a function in my c# COM interface which returns a System.IO.Stream object: I intend to use this COM interface within unmanaged c++ code, and ...
[英]convert string of array to array of string
我有一串數組。 例如 我想將其轉換為字符串數組,如下所示 有人可以幫我嗎? ...
[英]Extract entire string containing xml tags from request form in Java
I have created a SOAP web service in Spring Boot and the request object has a field of string type called block which contains an xml content. 當我嘗試提取 ...