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
A

ashokvishnu

@ashokvishnu
About
Posts
24
Topics
15
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • CFile open and create file
    A ashokvishnu

    I found out the problem. If you use createfile function with dwDesiredAccess flag as 0, then it will not try to open the file. It will only check whether the file exists.

    C++beginer

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

  • CFile open and create file
    A ashokvishnu

    I want to lock a file so that another application will not be able to open it. I am using CFile.open method with the flags CFile::modeRead|CFile::shareExclusive. However, after opening the file (and keeping it open) I am able to open the file using the windows api CreateFile function. How can I lock the file so that, the CreateFile function will fail?

    C++beginer

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

  • Mutex
    A ashokvishnu

    We have an application, say A which is used to start some other applications (B,C,D). That is when A starts, it also starts B,C and D. Now if any of B,C or D has been started manually, A should not start these applications. I would like to know whether we can implement such a scenario using mutex.

    C++beginer

    C / C++ / MFC c++

  • Com exe and dll
    A ashokvishnu

    We have to implement a com server as an executable which will be communicating with a COM dll. COM server would need to call certain functions in COM dll and the com dll would also need to invoke certain functions in the com exe. That is, both would be acting as a server as well as a client. What are the design issues to be considered? Any code samples, tips and suggestion would be most welcome. Thanks

    C++beginer

    COM c++ com design sysadmin question

  • Converting exe to com
    A ashokvishnu

    Well our requirement is to turn our exe into a com server. The question is whether we can do so without starting from the scratch. What I am looking at is, we will add the COM interface and implementing classes to the project and build the exe as a com exe by, if possible changing the project settings. I was just wondering is there any well defined steps for this.

    C++beginer

    COM c++ com

  • Converting exe to com
    A ashokvishnu

    Actually its a requirement from the client. The existing app is used as a component manager. It is used to start/stop/activate/deactivate etc other modules. Now the client is changing the interfaces of the other modules. And we will have to use those changed interface. So its not a question of converting an exe to com, rather we have to make it a com server. How we do it is left to us. Either we can start from the scratch (that will be lot rework) and build a com application or use the existing one, make the necessary changes with respect to com standards and run it as a com server. I hope you got the point.

    C++beginer

    COM c++ com

  • Converting exe to com
    A ashokvishnu

    Hi All, We have a project which is standard exe. Our new requirement is to convert it into a COM application. I would like to know what are the minimum steps required to make a standard exe application (that is make minimal changes to existing code)into a COM one. Any links or suggestions would be most welcome. Thanks

    C++beginer

    COM c++ com

  • Event log file
    A ashokvishnu

    Yeah. We have created a custom log for one of the applications and came across this behaviour by chance. Now the customer wants any microsoft document on this but we cant find any.

    C++beginer

    System Admin c++ windows-admin help announcement

  • Event log file
    A ashokvishnu

    Hi All, If I update the value of File key in registry of Application event log (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application) to D:\ApplicationLog\Loggggggggggggggggggggggggggggggggggggggggggggggggggggg\AppEvent.Evt which has a length of 87characters, and restart the system windows event log will still write events to its default file in %SystemRoot%\System32\config directory. However if i give the path as D:\ApplicationLog\Logggggggggggggggggggggggggggggggggggggggggggggggggggg\AppEvent.Evt whose length is 86characters and restart then events will be written to this file. It seems windows will not consider a path whose length is greater than 86 characters in registry for event logging. I have tried expandable path also, and the issue remains even though the full path after expanding can be greater than 86 characters. That is %xxxx%/etc/etc will not be taken if length greater than 86. I have searched a lot for a an explanation for this behaviour but found none. Anyone here has some idea why this is happening. Thanks

    C++beginer

    System Admin c++ windows-admin help announcement

  • Registry file path
    A ashokvishnu

    Hi All, I have created custom log file and its key is added to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\CustomLog. But if I give a path value greater than say 100 characters for File key under CustomLog windows is not taking this path. Is there any restrictions on path length for File key in registry?

    C++beginer

    C / C++ / MFC c++ windows-admin question

  • Registry file path
    A ashokvishnu

    I have created custom log file and its key is added to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\CustomLog. But if I give a path value greater than say 100 characters for File key under CustomLog windows is not taking this path. Is there any restrictions on path length for File key in registry?

    C++beginer

    System Admin c++ windows-admin question

  • Windows date and time conversion
    A ashokvishnu

    Hi Folks, Want to convert, system current time (local time) to GMT and vice versa preferable using windows api or else MFC. Any code samples available please? Thanks

    C++beginer

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

  • RegFlushKey doubt
    A ashokvishnu

    Ok. Thanks for clearing the doubt. :-)

    C++beginer

    C / C++ / MFC c++ windows-admin question

  • RegFlushKey doubt
    A ashokvishnu

    Hi Gurus, Does using RegFlushKey automatically close the handle to a new registry key created using RegCreateKeyEx function. Or we have to use RegCloseKey if the handle needs to be closed? Thanks

    C++beginer

    C / C++ / MFC c++ windows-admin question

  • event log doubt
    A ashokvishnu

    It seems only error, information, warning, audit_success and audit_failure can be used as event types for logging. They what is the purpose of EVENTLOG_SUCCESS in winnt.h?

    C++beginer

    C / C++ / MFC c++ question

  • event log doubt
    A ashokvishnu

    I have gone through these articles. In winnt.h the event types are given as #define EVENTLOG_SUCCESS 0X0000 #define EVENTLOG_ERROR_TYPE 0x0001 #define EVENTLOG_WARNING_TYPE 0x0002 #define EVENTLOG_INFORMATION_TYPE 0x0004 #define EVENTLOG_AUDIT_SUCCESS 0x0008 #define EVENTLOG_AUDIT_FAILURE 0x0010 Still if I log an event with event type value as zero, Success is not shown as the type in EventViewer. Thats what I do not understand.

    C++beginer

    C / C++ / MFC c++ question

  • event log doubt
    A ashokvishnu

    Hi Gurus, I log an event with event type as 0 ( EVENTLOG_SUCCESS ). In event viewer the event has the Information icon. But when I open the properties window for the event, the Type is displayed as None. Why? Thanks

    C++beginer

    C / C++ / MFC c++ question

  • Sid in report event function
    A ashokvishnu

    Hi Gurus Couple of questions. 1) While using ReportEvent function to log an event, do we have to provide user id explicitly if we have to retrieve the user name when reading data from the event log? If so any sample code on how to get the current user id to use in ReportEvent function. 2) Any code sample to how to retrieve userid from ReadEventLog function and converto sid to username. Thanks

    C++beginer

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

  • Getting folder names
    A ashokvishnu

    Hi Gurus, I want to retrieve the sub directory names from a directory. I dont want the file names if any are present. Presented below is code I am working on. However FindFileData.cFileName is giving only the first letter of the directory. How do I correct this? Since I have to use the code for productions, any corrections or better sample code will be most welcome. void GetSubFolderNames( LPCTSTR szFolderPath ) { WIN32_FIND_DATA FindFileData; HANDLE hFind = INVALID_HANDLE_VALUE; DWORD dwError; hFind = FindFirstFile(szFolderPath, &FindFileData); if (hFind == INVALID_HANDLE_VALUE) { printf ("Invalid file handle. Error is %u\n", GetLastError()); return (-1); } else { do { if(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { if ( !lstrcmp( FindFileData.cFileName, L"." ) || !lstrcmp( FindFileData.cFileName, L"..")) { //Do nothing for "." and ".." folders } else { CString fileName = FindFileData.cFileName; printf ("First file name is %s\n", fileName); } } } while (FindNextFile(hFind, &FindFileData) != 0) ; dwError = GetLastError(); FindClose(hFind); if (dwError != ERROR_NO_MORE_FILES) { printf ("FindNextFile error. Error is %u\n", dwError); return (-1); } } return (0); } Thanks

    C++beginer

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

  • Close Handle and FindClose
    A ashokvishnu

    Hi Gurus, While using FindFile, FindFirstFile, CreateDirectory functions, if the return is INVALID_HANDLE_VALUE do we still need to use the CloseHandle or FindClose functions to close the handle anyways? Thanks

    C++beginer

    C / C++ / MFC c++ question
  • Login

  • Don't have an account? Register

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