随笔分类 - C++
摘要:1.C++数据类型与C#对应关系2.C#中调试C++的DLL3.字符集常识最近项目,需要在C# 中调用C++ 写的DLL,因为C# 默认的编码方式是Unicode,而调用的DLL规定只处理UTF8编码格式的字符串,DLL中的输入参数类型char*被我Marshal成byte[],输出参数类型char**被我Marshal成了string(C++和C#之间的类型转换请参阅相关资料),于是我就经历了无数次用于接收时的string-->string(UTF8-->Unicode)和用于发送时的string-->byte[](Unicode-->UTF8)这样频繁的编码转换,期
阅读全文
摘要:http://vterrain.org/Water/(转)Water Rendering and SimulationThe color of water is influenced by a very large number of factors, especially by sky color and light conditions, so it's radically different on a sunny day vs. an overcast day.RealtimeRealtime Interactive Animations of Liquid Surfaces w
阅读全文
摘要:c#中有两个计时器,一个在FORM使名空间,一个在System命名空间。一般前者在window form 应用中使用,后者在window service,后台管理中使用。常见问题之一:计时器执行时间比间隔要大时出现多线程问题。 private void timer1_Tick(object sender, EventArgs e) { lock(o) { try { if (GrobalManage.gmstepindex < GrobalManage.gmstepcount - 1) { GrobalManage.gmstepindex++; if (MeshSetting.isCon
阅读全文
摘要:[Exception] Unable to load DLL 'zlibdll.dll': 由于应用程序配置不正确,应用程序未能启动。重新安装应用程序可能会纠正这个问题。 (Exception from HRESULT: 0x800736B1)[Message] System.DllNotFoundExceptionzlibdll是我对C++ zlib项目的包装,采用P/Invoke方式在.net下调用,一直工作的很好。但在某些机器上会报出上面的错误。出现这个问题并不一定是我的zlibdll.dll有问题,可能是我的dll的以来库有问题。用Dependency Walker看了
阅读全文
摘要:在编译MFC时有时候出现下面的错误。void __cdecl _CRT_DEBUGGER_HOOK(int _Reserved){/* assign 0 to _debugger_hook_dummy so that the function is not folded in retail */(_Reserved);_debugger_hook_dummy = 0;}其实这个错误的原因主要是因为内存空间的重复分配时发生错误。如下面:CString str = L"aaaaaaaaa"; 或者 str.Format(L"%s",L"aaaaaa
阅读全文

浙公网安备 33010602011771号