check out this tools :
codersnotes.com - Very Sleepy:
and this one from AMD :
http://developer.amd.com/tools/hc/CodeAnalyst/archive/Pages/default.aspx
another one shinyprofile
http://sourceforge.net/projects/shinyprofiler/
all from here:
http://stackoverflow.com/questions/67554/whats-the-best-free-c-profiler-for-windows-if-there-are
This Blog is first of all memos for me!! From time to time I get exposed to new and cool stuff for developers and architects ,most of the time its a solution for a problem or tips or tricks, so, I would like to track my memos and share it with you, it can save your time and nervous, I hope you will enjoy it - by Yaniv Tzanany.
Search This Blog
Tuesday, October 22, 2013
Thursday, October 10, 2013
Wednesday, October 9, 2013
Passing jstring to JAVA from C++ - the right way.
hi
i used to use this function
m_env->NewStringUTF(formattedMsg);
and one day i saw that the string i passed in my case it was huge more than 500k, cut in the end.
so i replcae this function with this one ... and its worked !!
jstring WindowsToJstring(JNIEnv* pEnv, LPCTSTR cstr) {
jstring retJstring = NULL;
int slen = strlen(cstr);
int length = MultiByteToWideChar( CP_ACP, 0, (LPCSTR)cstr, slen, NULL, 0 );
unsigned short* tempbuffer = (unsigned short *)malloc( length*2 + 1 );
MultiByteToWideChar( CP_ACP, 0, (LPCSTR)cstr, slen, (LPWSTR)tempbuffer, length );
retJstring = (pEnv)->NewString((jchar*)tempbuffer, length );
free( tempbuffer );
return retJstring;
}
more details could be found here
http://www.anyang-window.com.cn/between-java-and-c-transmission-through-jni-chinese-string-and-hash-issues/
and
http://stackoverflow.com/questions/8258834/sending-utf-chars-to-java-from-c-using-jni
i used to use this function
m_env->NewStringUTF(formattedMsg);
and one day i saw that the string i passed in my case it was huge more than 500k, cut in the end.
so i replcae this function with this one ... and its worked !!
jstring WindowsToJstring(JNIEnv* pEnv, LPCTSTR cstr) {
jstring retJstring = NULL;
int slen = strlen(cstr);
int length = MultiByteToWideChar( CP_ACP, 0, (LPCSTR)cstr, slen, NULL, 0 );
unsigned short* tempbuffer = (unsigned short *)malloc( length*2 + 1 );
MultiByteToWideChar( CP_ACP, 0, (LPCSTR)cstr, slen, (LPWSTR)tempbuffer, length );
retJstring = (pEnv)->NewString((jchar*)tempbuffer, length );
free( tempbuffer );
return retJstring;
}
more details could be found here
http://www.anyang-window.com.cn/between-java-and-c-transmission-through-jni-chinese-string-and-hash-issues/
and
http://stackoverflow.com/questions/8258834/sending-utf-chars-to-java-from-c-using-jni
Subscribe to:
Posts (Atom)