473,241 Members | 1,554 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,241 software developers and data experts.

System.Chart[] when convert to string

Hi,

I am using a DLL file to get a function. This has one parameter which
is a pointer. To access the function I do the following:

---------------------------------------------------------------------------------------------------
[DllImport("statax.dll")]
public static extern unsafe int fnReadMeas(char* buf);

---------------------------------------------------------------------------------------------------
Later on, in a button event I call this function as follows:

---------------------------------------------------------------------------------------------------
int Valor=0;
char[] m_BufMeas=new char[256];
fixed(char* DataRead=m_BufMeas)
{
Valor=fnReadMeas(DataRead);

if(Valor==1)
{
Mylabel.Text=Convert.ToString(m_BufMeas);
break;
}
}
---------------------------------------------------------------------------------------------------
On MyLabel I get the following text "System.Chart[]".
Any tip of how to solve this problem? I should be getting several
numbers in m_BufMeas.

Thanks in advance for your help.

Axel.
Aug 27 '08 #1
1 1166
Axel,

I assume that by System.Chart[], you mean System.Char.

You can pass that array to the constructor of the String class to create
the new string. Use the overload that takes the start index and the length,
in case not all 256 characters are used from the buffer (I assume the return
value of the unmanaged function will indicate the number of characters
written).

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"jadlaxel" <ja******@yahoo.comwrote in message
news:9f**********************************@i76g2000 hsf.googlegroups.com...
Hi,

I am using a DLL file to get a function. This has one parameter which
is a pointer. To access the function I do the following:

---------------------------------------------------------------------------------------------------
[DllImport("statax.dll")]
public static extern unsafe int fnReadMeas(char* buf);

---------------------------------------------------------------------------------------------------
Later on, in a button event I call this function as follows:

---------------------------------------------------------------------------------------------------
int Valor=0;
char[] m_BufMeas=new char[256];
fixed(char* DataRead=m_BufMeas)
{
Valor=fnReadMeas(DataRead);

if(Valor==1)
{
Mylabel.Text=Convert.ToString(m_BufMeas);
break;
}
}
---------------------------------------------------------------------------------------------------
On MyLabel I get the following text "System.Chart[]".
Any tip of how to solve this problem? I should be getting several
numbers in m_BufMeas.

Thanks in advance for your help.

Axel.

Aug 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: TC | last post by:
Hello, Here is what I'm trying to do: -- Make sure both MS Excel and MS Word are running -- Create an Excel chart -- Save the Excel file -- Copy the Excel chart onto the clipboard using Ctrl...
3
by: Mahesh Devjibhai Dhola | last post by:
Hi All, I want to make a custom class in c#, which extends System.Xml.XmlNode class of BCL. Now in custom class, I have implement abstract methods of XmlNode class also. Now when I am trying to...
22
by: PeteCresswell | last post by:
I've been to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mschrt/html/vbobjtitleobject.asp, but still don't have a clue. For example, I've got a chart object namde...
3
by: StBond | last post by:
Hi everyone, I am new to Access and Visual Basic so things my be getting across a bit cloudy. I only started using VB for one week. I am having a little problem with the database that I am...
15
by: Yifan | last post by:
Hi Does anybody know how to convert System::String* to char*? I searched the System::String class members and did not find any. Thanks Yifan
5
by: rcolby | last post by:
Evening, Wondering if someone can point me in the right direction, on how I would compare a system.guid with a system.byte. system.guid (pulled from sql server table with a data type of...
3
by: Widge | last post by:
Hi, I've made a piece of VBA that uses a combination of combolists and listboxes to run a query. I just can't think of a way to make this query generate a chart based on its results. Here is my...
5
by: grant | last post by:
I'm trying to use a scatter chart to plot level reading for a pump station level sensor. The sensor takes a reading every 4 seconds, and there are 23,000 reading per chart There appears to be...
1
by: cubekid | last post by:
I am using OWC 11 in my new web application for displaying charts. Is it possible in OWC 11 to combine and display a column and a line graph (Looking like they overlap each other)? I tried it using...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
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:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
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
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...

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.