我正在尝试在两个程序之间发送数据,WM_COPYDATA
但我的定义有问题COPYDATASTRUCT
;
这是错误:
这是代码:
#include <iostream>
#include <Windows.h>
#include <string>
#include <stdio.h>
#include <tchar.h>
#include < stdlib.h >
#include < vcclr.h >
#include <msclr\marshal.h>
#include "MyForm.h"
namespace TestGraphique {
using namespace System;
using namespace msclr::interop;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::Xml;
using namespace std;
typedef struct tagCOPYDATASTRUCT {
ULONG_PTR dwData;
DWORD cbData;
PVOID lpData;
} COPYDATASTRUCT;
/// <summary>
/// Description résumée de MyForm
/// </summary>
public ref class MyForm : public System::Windows::Forms::Form
{
public:
typedef struct COPYDATASTRUCT cpd;
cpd.dwData = 0; // there is the problem
cpd.cbData = dataToSend.GetLength(); // there is the problem
LPTSTR pszMem = new TCHAR[10000];
HWND hWnd;
HWND hWnd1;
HWND hWnd2;
HWND hWnd3;
String^ a = "";
String^ b = "";
String^ c = "";
String^ d = "";
String^ result="";
String^ TABLE = "";
MyForm(void)
{
InitializeComponent();
}