Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
K

karle

@karle
About
Posts
41
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • What device context methods are available to Crichedit
    K karle

    I didn't get you real question! CRichEditCtrl is a control an displays its content in the wm_paint event to the paint dc. Only if the control should calculate sizes or draw it's content a device context is needed. If you require a "WYSIWYG" you should apply the device context of the desired device. If you want to calculate the size or want to draw it to a context you have to call FormatRange Method and apply the deviceContext of the target device to the formatrange structure. If you want to learn, how richeditctrl realy works, see MSDN : Rich Edit Control Examples[^]

    C / C++ / MFC

  • string to html tag
    K karle

    I would use WebUtility.HtmlEncode from System.NET library. It provides a correct encoding of '<','>' and '&' ,... Your html code would have bugs, if your string contains one of the chars and you don't encode them. You can decorate the converted string with html tags.

    C# csharp html data-structures question

  • What device context methods are available to Crichedit
    K karle

    A device context is used to render the content of the richedit to a device to intialise the width for word breaks. use CRichEditCtrl::SetDefaultCharFormat to set the default format of the text. It takes a CHARFORMAT2 to structure where you can set the font and the textcolor. Remember to initialize the cbSize with the size of CHARFORMAT2 and to set the dwMask Member to flag which properties you want to set. Use CRichEditCtrl::SetSelectionCharFormat() to format the selected text. When set SetWordWrapMode() you should also call SetTargetDevice to set the width of a line. Use FormatRange to render the content to a device.

    C / C++ / MFC

  • About Multiple Monitors
    K karle

    you can add the monitor number in each caption of your windows or you create a transparent window with the size of the entire desktop (spreading over all monitors) an draw the number with GDI in this window

    C / C++ / MFC question

  • About Multiple Monitors
    K karle

    use GetSystemMetrics(SM_CMONITORS) to detect if there is more than one monitor. You can also use: EnumDisplayMonitors() to enumarate monitors and retrieving the rect on screen. GetMonitorInfo() to get information about a special monitor. MonitorFromPoint() to get a handle to a monitor when you have a point. You can use GDI to draw on screen or display a window to identify monitors

    C / C++ / MFC question

  • How to make a dll re-entrant?
    K karle

    you can implement "dllmain" function in your dll. BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ); this function is called when a DLL is attached/detached to a process or thread. You may use this to do what you want.

    C / C++ / MFC tutorial question

  • File read problem
    K karle

    you better use CStdioFile class which is derived from CFile. It has a ReadString and a WriteString method.

    C / C++ / MFC help question

  • E_Accessdenied
    K karle

    the caspol.exe is part of the sdk ! See <%windows%>\Microsoft.NET\Framework\v2.0.50727 Please try this !

    .NET (Core and Framework) csharp css visual-studio sysadmin help

  • How do I Encrypt Connection String Password in C# Windows Application
    K karle

    try this http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2010907&SiteID=1&pageid=0#2010907

    C# question security csharp database help

  • E_Accessdenied
    K karle

    You have to adjust code access security settings. .NET checks where your application is started and assigns a codegroup. Local executables have "full trust" by default. If you start your app from a UNC path it is in intranet zone. If you start it from a IP Adress it is in internet zone. By default intranet und internet zone have serveral restrictions. try this: Open a command prompt and type: caspol -rsg you can see the codegroups your assembly belongs to. caspol -rsp will show you which permissions are granted to your application. If you have the .NET Framework SDK on the machine you can use the .NET configuration tool. If you want your application to have always fulltrust you can do this: a) sign your assemblies with a strong name and add a codegroup with a strong name condition (you can use caspol) b) sign your assemblies with a certificate and add a codegroup with a publisher condition (you can use caspol)

    .NET (Core and Framework) csharp css visual-studio sysadmin help

  • (MFC)Comfused in OnEraseBkgnd & OnPaint
    K karle

    I would use the device Context given as parameter. May this pDC has cliping areas defined. CPaintDC is not useful here because it calls BeginPaint / EndPaint. Beginpaint emit's an WM_ERASEBACKGROUND. see MSDN documentation of BeginPaint. You should also consider setting WS_CLIPCHILDREN style for dialog window.

    C / C++ / MFC c++ winforms graphics help question

  • delete or delete[]
    K karle

    you must call delete [] if you have an array of objects. if you leave out the [] the destructor only is called for the first object of the list. So, to be sure not to get resource/memory leak you have to use [] for arrays.

    C / C++ / MFC question tutorial learning

  • CString return
    K karle

    may check if the index is >= 0 If no item is selected the index has a value of -1. Check LastError code using GetLastError() Otherwise please post the error message / exception.

    C / C++ / MFC database help question

  • RTF of a Text
    K karle

    I would try this. a) Create an invisible CRichEditCtrl (or use a visible one). b) Set the text with SetWindowText (or type or paste it into your control). c) To get the Text in RTFFormat use StreamOut Method. There is a small sample in MSDN for this. If you are not using MFC: a) Create a Window of richedit class. (CreateWindow(...) b) use WM_SETTEXT c) send EM_STREAMOUT - Message to the created window

    C / C++ / MFC c++ json help tutorial question

  • Unicode - MultiByte
    K karle

    I think it would be the best to use unicode character set. You string handling is much easier than using MBCS. If you are not able to change your setting you have to convert the unicode characters to MBCS. To convert Unicode (=widechar) to MBCS use: WideCharToMultiByte to convert wide to unicode char use: MultiByteToWideChar

    C / C++ / MFC question

  • How can fix linking errors?
    K karle

    static members have to be inialised in cpp file. try: AbsoluteZero Established::ABSOLUTE_ZERO_STATE = AbsoluteZero(); Idle Established::IDLE_STATE = Idle(); Waiting Established::WAITING_STATE = Waiting(); Established Established::ESTABLISHED_STATE = Established();

    C / C++ / MFC csharp c++ visual-studio sysadmin help

  • How to get the information on current standard/format and region setting
    K karle

    You can use GetUserDefaultLCID to detect users default Locale ID. With GetLocaleInfo( lcid, LOCALE_ICALENDARTYPE,... ) you can check if you have a thai calendar for example. This function gives you a detailed information about users formating settings.

    C / C++ / MFC c++ tutorial question

  • Difference between DLL & Process ???
    K karle

    A dll is a dynamic library, a collection of functions and methods. This library kann be linked to an executable (.exe). Windows creates a process for each executable which is started. A process just exists in memory of your OS. A process has an Name and an ID (see task manager). A process executes code which ca reside in a dll.

    C / C++ / MFC question

  • Zip/Archive
    K karle

    As far as I know there is no windows API support for handling ZIP files. Windows just supports cab files. I you want to process zip files from c++ you should zlib which is free. Just google for "zlib" or see

    C / C++ / MFC c++ json help question

  • Help!
    K karle

    TCHAR lszModuleFileName[MAX_PATH] = { '\0' }; GetModuleFileName( AfxGetInstanceHandle( ), lszModuleFileName, _countof(lszModuleFileName) ); lszModuleFileName contains now the complete filename incl. path of your executable !

    C / C++ / MFC question help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups