Original file: C# to C++ / Qt T4 generator cc.Name == p.PropertyType.Name); if(contains) WriteLine(“#include “); } } private void GenerateFromEnum(Type t, string objectName, bool useQTTypes) { FieldInfo[] memberInfos = t.GetFields(BindingFlags.Public | BindingFlags.Static); WriteLine(“enum class ” + objectName + “”); WriteLine(“{“); for(int i = 0; i < memberInfos.Length; i++){ Write("\t" + memberInfos[i].Name + " = " […]
<?xmlversion=“1.0“encoding=“utf-8“ ?> <CodeSnippetsxmlns=“http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet“> <CodeSnippetFormat=“1.0.0“> <Header> <Title>Qt Property</Title> <Shortcut>QtProp</Shortcut> <Description> Code snippet for an automatically implemented Qt property Language Version: C++ Qt </Description> <Author>cihant</Author> <SnippetTypes> <SnippetType>Expansion</SnippetType> </SnippetTypes> </Header> <Snippet> <Declarations> <Literal> <ID>type</ID> <ToolTip>Property type</ToolTip> <Default>QString</Default> </Literal> <Literal> <ID>propertyName</ID> <ToolTip>Property name</ToolTip> <Default>MyProperty</Default> </Literal> </Declarations> <CodeLanguage=“csharp“> <![CDATA[ public: /* $propertyName$ Property */ Q_PROPERTY($type$ $propertyName$ READ $propertyName$ WRITE set$propertyName$ […]
MFC C++ projesinde DEBUG modda sorunsuz derleyebiliyorken RELEASE modda “Please use the /MD switch for _AFXDLL builds” hatasi aliyorsaniz: Project Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library ayarini Multi-threaded DLL (/MD) olarak degistirip oyle deneyin.
Aslinda tum olay MFC projesinde GDI+ kullanmayla basladi. GDI+ kullanmaya basladiginizda Gdiplus::GdiplusStartup, isiniz bittiginde Gdiplus::GdiplusShutdown fonksiyonlarini cagirmalisiniz. Projede devamli GDI+ kullandigim icin InitInstance() icinde start, ExitInstance() icinde stop yaptim. //////////////////////////////////////////////////////////////////////////// // GDI+ Start Stop functions ULONG_PTR gdiplusToken; Gdiplus::GdiplusStartupInput gdiplusStartupInput; Gdiplus::GdiplusStartupOutput gdiplusStartupOutput; BOOL StartGdiPlus() { if (Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL)) { MessageBox(NULL, TEXT(“GDI+ failed to start up!”), TEXT(“Error!”), MB_ICONERROR); return FALSE; } return TRUE; } void StopGdiPlus() { Gdiplus::GdiplusShutdown(gdiplusToken); } //////////////////////////////////////////////////////////////////////////// // CActivexApp::InitInstance – DLL initialization BOOL CActivexApp::InitInstance() { BOOL bInit = COleControlModule::InitInstance(); if (bInit) { […]
Pointer i eger asagidaki gibi loop bittikten sonra sileyim derseniz cok fena yanilirsiniz. Memory siser, siser, siser. Eger GDI object ise cok beklemenize de gerek kalmaz 🙂 Yanlis Brush* brush; for (int i = 0; i < 100; i++) { brush = new Brush(Color.Red, 1.0f); } delete brush; Dogrusu pointer i her kullanimdan sonra, […]
Recent Comments