1.調用者分配,調用者釋放
調用格式如:
int GetDLLString(PCHAR pstr, PDWORD count)
先調用一次GetDLLString(NULL,...)通過第二個參數返回需要的大小。
然後爲pstr申請接口new指定大小的內存。再調用一次。使用完後delete [].
2.DLL使用LocalAlloc申請,調用者使用LocalFree釋放。
LPSTR* GetDllString(PDWORD count)
返回的字符串數組組織如下:[pSTR1][pSTR2]...[pSTRn][STR1][STR2]...[STRn]
其中pSTR1是STR1的地址,pSTR2是STR2,以此類推。
count = 0
ppstr = GetDllString(&count)
返回值判斷……
for i in count
print ppstr[i]