Thank you all, very much for all information :)
JLBorges, the code you provided me works well of course.
But I must call GetComputerNameAndOemId() from unrealscript.
When I call GetComputerNameAndOemId() from unrealscript, I get nothing returned.
In order for GetComputerNameAndOemId() in the dll to return something to unrealscript, or modify a certain variable in unrealscript; (one of a few unrealscript-way is that) the function GetComputerNameAndOemId() should have something that looks like what shown in my first thread:
1 2 3 4 5 6
|
int len = wcslen(nameBuf);
for (int i = 0; i<len >> 0; i++)
{
wchar_t temp = nameBuf[i];
s[i] = temp;
}
|
I have learnt something from your code, and spent many hours trying to modify it with no success.
Basically, in the code of my first thread, I use wcscpy, wcscat:
std::wcscpy( buffer, L"computer name: " ) ;
std::wcscat( buffer, nameBuf ) ;
std::wcscat( buffer, L" oemid: " ) ;
SYSTEM_INFO siSysInfo;
GetSystemInfo( &siSysInfo );
std::wcscat( buffer, std::to_wstring(siSysInfo.dwOemId).c_str() ) ;
and then, use that buffer in a for...loop just like you see in my first thread.
The result is: first time calling, it outputs unexpected text. Second time calling, it crashes with error: Not enough storage is available to process this command...
I don't know what to do now....
Could you please help me one more time by rewriting your code so that it close to the way the code in my first thread works?
..........
Short information on how unrealscript interacts with C++ DLL:
https://api.unrealengine.com/udk/Three/DLLBind.html