小编tai*_*ibc的帖子

对PInvoke函数的调用使堆栈失衡.这很可能是因为托管的PInvoke ..(.NET 4)

我的项目在.NET Frame 3.5中成功运行且没有错误.但是,当我将它定位到.NET Frame工作4.我得到了错误:

" 对PInvoke函数的调用使堆栈失衡.这可能是因为托管的PInvoke签名与非托管目标签名不匹配. "

我使用了非托管库,如下所示:

[StructLayout(LayoutKind.Sequential )]
public class DGNElemCore
{
    public int offset;
    public int size;
    public int element_id;
    public int stype;          
    public int level;
    public int type;
    public int complex;
    public int deleted;
    public int graphic_group;
    public int properties;
    public int color;
    public int weight;
    public int style;
    public int attr_bytes;       
    public IntPtr attr_data;  
    public int raw_bytes;
    public IntPtr raw_data;                 

}

[DllImport("DgnLib.dll", EntryPoint = "DGNOpen")]           
public static extern IntPtr  DGNOpen(string fileName, int bUpdate)
Run Code Online (Sandbox Code Playgroud)

你知道如何解决这个错误吗?

.net c# pinvoke

18
推荐指数
1
解决办法
2万
查看次数

更改图表中图例的文字?

请参阅我的示例图表

在此输入图像描述

现在,我想更改图例的文本(不显示百分比值)与系列数据的xValues相同,例如:伦敦,东京,巴黎......(仍然保留饼图中的百分比值).

你知道怎么做吗 ?

我使用以下代码:

int[] yValues = { 50, 20, 10, 20 }; 
string[] xValues = { "London", "Paris", "Newyork", "Tokyo"};

myChart.Series["Default"].Points.DataBindXY(xValues, yValues);
myChart.Series[0].Label = "#PERCENT{P2}";
Run Code Online (Sandbox Code Playgroud)

.net c# charts visual-studio-2010

4
推荐指数
2
解决办法
3万
查看次数

标签 统计

.net ×2

c# ×2

charts ×1

pinvoke ×1

visual-studio-2010 ×1