Hi

While calling dll file from vb.net I am passing a string value to the qt dllas follows:
Qt Code:
  1. <DllImport("G:\Varen_CS\02_Projects\01_Softwares\highFreqTrad\test\debug\test.dll", _
  2. CharSet:=CharSet.Auto, _
  3. CallingConvention:=CallingConvention.StdCall)> _
  4. Private Shared Function _ZN11QtEngineDll7randIntEv(ByRef u As String) As String
  5. End Function
To copy to clipboard, switch view to plain text mode 
Now my qtcode goes as follows:

Qt Code:
  1. QtEngineDll::QtEngineDll(const char* url)
  2. {
  3. m = url;
  4. }
  5.  
  6. const char* QtEngineDll::randInt()
  7. {
  8. QByteArray d(m);
  9. QString result = d.data();
  10. QString fileName = QDir::currentPath() + "/Test.txt";
  11. QFile file(fileName);
  12. file.open(QIODevice::Append | QIODevice::Text);
  13. file.write(result + "\n");
  14. return result;
  15. }
To copy to clipboard, switch view to plain text mode 

But the file output is something like this:
[07/03/10 - 12:03:46], Abhijit U‰åVSƒìpE¸‰$èT Code:
  1. [07/03/10 - 12:03:46], Abhijit U‰åVSƒìpE¸‰$èT
To copy to clipboard, switch view to plain text mode 

Can you pls tell me what is the wrong that I am committing in the code?

Thanks in advance.