Hi
While calling dll file from vb.net I am passing a string value to the qt dllas follows:
<DllImport("G:\Varen_CS\02_Projects\01_Softwares\highFreqTrad\test\debug\test.dll", _
CharSet:=CharSet.Auto, _
CallingConvention:=CallingConvention.StdCall)> _
Private Shared Function _ZN11QtEngineDll7randIntEv(ByRef u As String) As String
End Function
<DllImport("G:\Varen_CS\02_Projects\01_Softwares\highFreqTrad\test\debug\test.dll", _
CharSet:=CharSet.Auto, _
CallingConvention:=CallingConvention.StdCall)> _
Private Shared Function _ZN11QtEngineDll7randIntEv(ByRef u As String) As String
End Function
To copy to clipboard, switch view to plain text mode
Now my qtcode goes as follows:
QtEngineDll::QtEngineDll(const char* url)
{
m = url;
}
const char* QtEngineDll::randInt()
{
file.write(result + "\n");
return result;
}
QtEngineDll::QtEngineDll(const char* url)
{
m = url;
}
const char* QtEngineDll::randInt()
{
QByteArray d(m);
QString result = d.data();
QString fileName = QDir::currentPath() + "/Test.txt";
QFile file(fileName);
file.open(QIODevice::Append | QIODevice::Text);
file.write(result + "\n");
return result;
}
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:
[07/03/10 - 12:03:46], Abhijit U‰åVSēpÂE¸‰$èÂT
[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.
Bookmarks