#include "stdafx.h" #include "windows.h" #include "stdio.h" int _stdcall f() { double dNum = 3.45; char str[33]; sprintf_s(str,"The solution is %lf",dNum); MessageBox(NULL,(LPCWSTR)str,(LPCWSTR)"Thong bao",MB_OK); return 0; }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; namespace WindowsFormsApplication1 { public partial class Form1 : Form { [DllImport("TestDll.dll")] public static extern int f(); public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { int ret; ret = f(); } } }
MessageBox
GetLastError
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)