473,326 Members | 2,133 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,326 software developers and data experts.

char* from C++(unmanged) to C#

1
I am trying to write a C# program to call a C++ (Unmanaged) program
the API is:

extern "C" DLL_EXPORT long lQueryDefinedWarehouses(long lSocket,long &lWarehouseCount, char* &pstOutPut, long lOutputSize);


I am able to call it by using a String variable (for the 3rd argument - pstOutPut).

However, it has a list of warehouses and it has Low Values (nulls) between the valid entries

In C#, because of the NULLS, I only get the First WareHouse Code-

I used to use COBOL and there I can see that all of the warehouse codes are there- but C# is stopping when it hits the X"00" after the first (there are actually about 24 between the last character of the first and the first character of the 2nd)

I have tried using Array, CHAR, BYTE - all to no avail.

Any ideas?

I do not have source code so converting to C++ .Net is not an option.

thanks for any help
Oct 25 '06 #1
0 1017

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

Similar topics

0
by: P Reddy | last post by:
Hi All, Greetings!!! I have a question. Please respond.... I am trying to write a C# component that need to inherit some of the the interfaces from unmanged code(VC). I think one way to...
2
by: Paul Sneddon | last post by:
Hi, I'm using VS.NET 2005 RC to create Windows Mobile apps. I'm trying to call the following shell function which is new on Windows Mobile 5. SNDGETSND...
3
by: kilroytrout | last post by:
When trying to use some unmanged C++ libs in a VS 2005 Release Candidate Windows Forms (/clr) project, I found that any dynamic initialization in the lib's global STL objects (perhaps other C++...
5
by: Maxwell | last post by:
Hello, Newbie question here. I have a VS.NET 2003 MC++ (not C++/cli) project where I have a managed class reference in a unmanaged class...simple enough. To keep things short I am for the most...
7
by: brian_harris | last post by:
I have a string object that I need to convert into an unmanged char * to be used by several unmnaged 3rd party functions. I have tried to use: (Marshal::StringToHGlobalAuto (Profname)) This would...
1
by: mschuck | last post by:
Here is the scenario I'm trying to make work. I've got 2 managed C++ classes, each of which wrappes an unmanaged C++ class, kind of like so: __nogc class UnmanagedClassA { public: void...
6
by: B. | last post by:
my small project has two files, umg.cpp (unmanaged c++) and mged.cpp (MC++), and unmanged code will call managed code. However, I cannot debug from unmanged code into managed code. Can anyone help...
1
by: hkasten | last post by:
Hello, I have a unmanged C++ dll which has a function defined like: Modify(char* str) The char* is an in/out with a max length of 1024 I'd like to have a C++.Net Wrapper function which...
1
by: sonic1981 | last post by:
Hi Everyone I'm trying to access an unmanged dll from ASP.Net (C#). I'm basically calling a logon method within the dll but when I get to this method call the system hangs? I've checked all the...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.