<分区>
我已经用C#完成了我的部分编码,下面给出了一个小方法
public static unitdefn GetUnit(XmlDocument doc)
{
XmlNodeList nodeList1 = (XmlNodeList)doc.DocumentElement.SelectNodes("//UnitDefinitions/Unit");
int countdefn = nodeList1.Count;
unitdefn[] arrunt = new unitdefn[countdefn];
if (countdefn != 0)
{
int i = 0;
foreach (XmlNode node in nodeList1)
{
XmlAttribute att = node.Attributes["name"];
if (att != null)
{
string idu = node.Attributes["name"].Value;
//System.Console.WriteLine(id1);
arrunt[i].name = idu;
}
i++;
}
}
return arrunt[0];
}
我想在我的 C++ 项目中使用这个方法,我已经按照下面给出的方法做了
int xmlRead()
{
int x=1,s=1;
char xmldllpath[1000]="//dllpath";
HMODULE h = LoadLibrary(xmldllpath);
if (!h) {
printf("error: Could not load %s\n", xmldllpath);
return 0; // failure
}
getAdr(&s, h, "GetUnit");
}
dll 已成功加载,但未获取该方法 任何特定的方式来做到这一点