zoukankan      html  css  js  c++  java
  • wpf调用VC++ dll

    环境  VS2010

    // DllDemo.h
    
    #pragma once
    
    using namespace System;
    
    namespace DllDemo {
    
    	public ref class MyValue
    	{
    		// TODO: 在此处添加此类的方法。
    		int value;
    	public: MyValue()
    			{
    				value = 123456789;
    			}
    
    	public: int printValue()
    			{
    				return value;
    			}
    	};
    }
    

      

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    
    using System.Runtime.InteropServices;
    
    using DllDemo;
    
    namespace WXDWXT_WPF
    {
        /// <summary>
        /// MainWindow.xaml 的交互逻辑
        /// </summary>
        public partial class MainWindow : Window
        {
    
            MyValue myv1;
            public MainWindow()
            {
                InitializeComponent();
    
                myv1 = new MyValue();
            }
            
    
    
            private void button1_Click(object sender, RoutedEventArgs e)
            {
                MessageBox.Show("" + myv1.printValue());
            }
        }
    }
    

      

  • 相关阅读:
    P3332 [ZJOI2013]K大数查询
    树上最短路---------------树链剖分,优化建边。
    BZOJ_4386
    2016_1_13(3)
    2016_1_13(2)
    2016_1_13
    BZOJ_1698
    BZOJ_4152
    BZOJ_3110
    BZOJ_2141
  • 原文地址:https://www.cnblogs.com/zhangkun35268/p/10945489.html
Copyright © 2011-2022 走看看