文章分类 - C#(WinForm)
摘要:通过设置Panel的Location实现,具体代码如下:Panel.Location = new Point((this.Size.Width - Panel.Size.Width) / 2, (this.Size.Height - Panel.Size.Height) / 2);
阅读全文
摘要:根据项目要求,需要在一个WinForm程序中调用C++写的DLL,DLL中有一个导出函数,返回值是MFC中的CString,函数如下:const CString ExecuteCMD(const char* ParamIn){ //………… CString strResponse; int iRet = ((CZJRCIApp*)AfxGetApp())->ExecuteTellerCash(); if (iRet != ZJRCI_SUCCESS) { strResponse.Format("RetCode=[%d]",iRet); } else { XmlPack
阅读全文
摘要:MSDN路径:.Net开发-》.Net Framework SDK文档-》类库参考-》System.Windows.Forms-》FolderBrowserDialog类private void saveMenuItem_Click(object sender, EventArgs e) { try { string path = null; FolderBrowserDialog savePath = new FolderBrowserDialog(); if (savePath.ShowDialog() == DialogResult.OK) { path = savePath.Selec
阅读全文
摘要:C++中的函数声明view sourceprint?1extern "C" __declspec(dllexport) int __stdcall testfunc(char* astr,int* a);extern ”C” 通常来说,C++编译器可能会改变函数和变量的名字,从而导致严重的链接程序问题。例如,假设使用C++编写一个DLL,当创建DLL时,Microsoft的编译器就会改变函数的名字。函数名将被设置一个前导下划线,再加上一个@符号的前缀,后随一个数字,表示作为参数传递给函数的字节数。例如,下面的函数是作为DLL的输出节中的_MyFunc@8输出的:view s
阅读全文
摘要:MSDN路径:.Net开发-》.Net Framework SDK文档-》类库参考-》System.Windows.Forms-》OpenFileDialog类private void button1_Click(object sender, System.EventArgs e){ Stream myStream; OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.InitialDirectory = "c:\\" ; openFileDialog1.Filter = "
阅读全文
浙公网安备 33010602011771号