473,287 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

C# Interop: wchat_t to string problem

Hi,
Is there any way to port C++ code which looks like
wchar_t txt1U[] = {0x65ed, 0x8466, 0x82a6, 0x9bf5, 0x6893, 0x5727, 0x65a1, 0x6271, 0x5b9b, 0x59d0, 0x867b, 0x98f4, 0x7d62, 0x7dbe, 0x9b8e, 0x6216, 0x0};
to C# and further marshall it to the c-style dll? The only reasonable constructor I found for string is one that takes sbyte as a paremeter but i can't figure out how to use it in situation provided above.
Nov 22 '07 #1
1 1673
char[] txt1U = new char[] { (char)0x65ed, (char)0x8466, (char)0x82a6, (char)0x9bf5, (char)0x6893, (char)0x5727, (char)0x65a1, (char)0x6271, (char)0x5b9b, (char)0x59d0, (char)0x867b, (char)0x98f4, (char)0x7d62, (char)0x7dbe, (char)0x9b8e, (char)0x6216, (char)0x0 };
string str = new string(txt1U);
or by the escape sequences.
Nov 22 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Craig | last post by:
I am having problems getting an ActiveX DLL written in VB6 to call a method in a C# class library component. My C# DLL is called CSharpProject.dll and contains a public class called CSharpClass....
6
by: Sudha | last post by:
Hi All, I am trying to use COM DLL in my C#. I have added this DLL in referance and all interface are working fine. I have one issue in calling function decleared like: void...
22
by: glenn | last post by:
I have a COM Server that I've written based on information from the book ..NET and COM / the complete Interop Guide. I have gotten the project to compile and I've located the regasm.exe program...
1
by: Vinoth Kumar | last post by:
Hi I am writing a wrapper class for a unmanaged c++ class, which has the method signature, Method(wchar_t** ppszValue) Anyone please tell me, how to convert the string _gc* _gc* to...
0
by: Chris V | last post by:
Hello, I'm having problems sending MAPI Mail from an ASP.NET applcation (in VB) (which worked fine in traditional asp) When run on our test server, it returns an COMException (0x80010106): ]]...
2
by: Steve | last post by:
I'm using Visual Studio .NET (not 2003), and am developing a class that works with Word theough the Office PIAs (Interop). I can open word and do things with it programatically, but I can't close...
4
by: DotNetJunkies User | last post by:
I am calling a VB6 dll from a vb.net windows application that returns an array of strings. My issue is it seems to truncate after a NULL character. For Example VB 6 is returning a string with the...
2
by: JC | last post by:
Anybody knows what problem has this code? I think, in the Garbage Collector? You know the Solution? The program in the test's case, whit 350 contacts, run OK before number 86. The error is a...
1
by: Don.Leri | last post by:
Hi, I have a logger.dll (unmanaged c++ dll compiled in vs2005). I have a C# interop to use that dll in managed code implemented in Interfaces.dll (used by other C# dlls). I also have a...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.