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
G

gmlnd

@gmlnd
About
Posts
30
Topics
15
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to create a semaphore for a file
    G gmlnd

    I have created a file and I'm trying to create a semaphore for it using POSIX system calls. My program creates children processes who will open the file and write their pid in the file at the same time. This is my file: void Parent process() File *p, *p2; p=fopen("file1", "w+"); if(p==NULL) //error else fprintf(p,"%u", getpid()) pclose(p); p2=fopen("file2", "w+"); if(p2==NULL) //error else fprintf(p2,"%u", getpid()) pclose(p2); void child1(){ pid=fork(); if (pid==0) //open file1 and write its pid there //open file2 //close file2 //close file1 } void child1(){ pid=fork(); if (pid==0) //open file2 and write its pid there //open file1 //close file1 //close file2 }

    IT & Infrastructure help tutorial

  • How to adapt window size to screen resolution
    G gmlnd

    I tried this, but it still will not adapt to different screen resolution. Is it okay to have GetSystemMetrics in MainFrame? void CMainFrame::OnMove(int x, int y) { Rect rc; SystemParametersInfo(SPI_GETWORKAREA,0,&rc,0); }

    C / C++ / MFC c++ tutorial

  • How to adapt window size to screen resolution
    G gmlnd

    I have a FormView based mfc program. I am trying to adjust my program so it can adapt to different screen resolution. I have the following code in my OnDraw function, but it fails to adapt window size on different screen resolution. CRect rc; SystemParametersInfo(SPI_GETWORKAREA,0,rc,0); I don't know what I'm missing, or if there is anything wrong with my code.

    C / C++ / MFC c++ tutorial

  • How to secure delete files
    G gmlnd

    Thank you for your help.

    C / C++ / MFC tutorial

  • How to secure delete files
    G gmlnd

    Thank's, I deleted the FOF_ALLOWUNDO flag. Now I don't see the deleted files in the recycle bin anymore, but when I click on the Clean File in my program, before it deletes, for every cookie a dialog box pops: Are you sure you want to delete "cookie name"? Is there any way I could stop that message from popping up?

    C / C++ / MFC tutorial

  • How to secure delete files
    G gmlnd

    I use the following class to delete files. void CFileDeleter::Initialize() { m_nDeleteType = 0; LoadDeleteType(); } void CFileDeleter::LoadDeleteType() { HKEY hKey; long lRet; int nType = 0; DWORD dw = sizeof(int); DWORD dwType = REG_DWORD; lRet = RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\iISoftware\\iIWiper",0,KEY_ALL_ACCESS,&hKey); if(lRet == ERROR_SUCCESS) { lRet = RegQueryValueEx(hKey,"DeleteType",0,&dwType,(LPBYTE)&nType,&dw); if(lRet == ERROR_SUCCESS) { m_nDeleteType = nType; } } } BOOL CFileDeleter::FileDeleteOperation(LPTSTR lpszFile) { DWORD dwAttrib; dwAttrib = GetFileAttributes(lpszFile); if (dwAttrib == 0xFFFFFFFF) { return FALSE; } switch(m_nDeleteType) { case DELETE_RECYCLE: { SHFILEOPSTRUCT f; ZeroMemory(&f, sizeof(SHFILEOPSTRUCT)); f.wFunc = FO_DELETE; f.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION; lpszFile[lstrlen(lpszFile)+1] = 0; f.pFrom = lpszFile; SHFileOperation(&f); break; } case DELETE_DELETE: DeleteFile(lpszFile); break; default: { SHFILEOPSTRUCT f; ZeroMemory(&f, sizeof(SHFILEOPSTRUCT)); f.wFunc = FO_DELETE; f.fFlags = FOF_ALLOWUNDO; f.pFrom = lpszFile; SHFileOperation(&f); break; } } return TRUE; }

    C / C++ / MFC tutorial

  • How to secure delete files
    G gmlnd

    I have a file deleter program that deletes cookies and temporary internet files, however, it sends the files to the recycle bin. Is it possible to secure delete the files, this means that the files are not moved to the "recycle bin", but rather are actually fully deleted from the hard drive.

    C / C++ / MFC tutorial

  • How to change the MFC icon
    G gmlnd

    No, I don't know any websites, let me know if you find any. Azi.

    C / C++ / MFC c++ tutorial

  • Adapt window size
    G gmlnd

    If I use this method, will it matter which function I put this in? dc.GetDeviceCaps(HORZRES) dc.GetDeviceCaps(VERTRES) All I need to adapt to different resolutions is to GetDeviceCaps? What is dc? Thank's.

    C / C++ / MFC question

  • Adapt window size
    G gmlnd

    I'm trying to adapt the size of window so it can fit with different resolutions based on the monitor size?

    C / C++ / MFC question

  • How to change the MFC icon
    G gmlnd

    I have a file which is a type Icon, I have placed that in the res folder. Does it have to be .ICO? Once I place the file in the res folder, how do I actually import it in my program so it replaces the IDR_MAINFRAME image of MFC?

    C / C++ / MFC c++ tutorial

  • How to change the MFC icon
    G gmlnd

    I have to change the standard MFC icon located in the top left portion of the main window to another icon.

    C / C++ / MFC c++ tutorial

  • How to call a function from another class
    G gmlnd

    Yes, I do have the #include "leftmenu.h" at top of anonwasher.cpp. Maybe I need a pointer to that class.

    C / C++ / MFC c++ help tutorial

  • How to read command line parameters
    G gmlnd

    I'm trying to adjust my program so it runs in silent mode, meaning it does the work without opening up the main window for the user to click. I have the following code in my InitInstance function: This code does go to silent mode, but I need to adjust it a bit. When I get the command line, I want to be able to see if the lpszCmd is "/s", then run in silent mode, else, run in regular mode(open up the main window). I dont know how to adjust my program to do that. Is it possible? BOOL command_line_keys_detected; LPSTR lpszCmd=GetCommandLine(); // parse lpszCmd if(command_line_keys_detected) { // do all your tasks here CMainFrame* main = dynamic_cast(m_pMainWnd); main->GetCheckedItems(); CFileProgress dlgPrg; dlgPrg.DoModal(); return FALSE; }

    C / C++ / MFC tutorial question

  • How to call a function from another class
    G gmlnd

    It was complaining about GetCheckedItems();

    C / C++ / MFC c++ help tutorial

  • How to call a function from another class
    G gmlnd

    Yes, I have all the #include .h files both my classes.

    C / C++ / MFC c++ help tutorial

  • How to call a function from another class
    G gmlnd

    I have all the .h files. Could there be any other problems? Thanks.

    C / C++ / MFC c++ help tutorial

  • How to call a function from another class
    G gmlnd

    I have a CFormView Project. I'm trying to call a function which is located in LeftMenu.cpp which is my implementation file (CLeftMenu::CLeftMenu() : CFormView(CLeftMenu::IDD)), from AnonWasher.cpp which Defines the class behaviors for the application.(CAnonWasherApp) This is the function that I'm trying to call: void CLeftMenu::GetCheckedItems() { char *checkedItems=NULL; if( m_hWnd != NULL ) { CMainFrame *main = (CMainFrame*)m_hWnd; checkedItems=main->GetCheckedArray(); } } When I call GetCheckedItems from AnonWasher, I get undeclared Identifier error. I don't know how I could do this.

    C / C++ / MFC c++ help tutorial

  • How to read command line parameters
    G gmlnd

    I mean that the program does something without opening up the window. I have found some information about this but it still is not clear to me. BOOL CMyApp::InitInstance() { LPSTR lpszCmd=GetCommandLine(); // parse lpszCmd if(command_line_keys_detected) { // do all your tasks here return FALSE; } // // original body of InitInstance // goes here // } I'm getting command_line_keys_detected error: undeclared identifier. I don't know how this is supposed to be declared. Thanks.

    C / C++ / MFC tutorial question

  • How to read command line parameters
    G gmlnd

    I have a CFormView based project that cleans out the system. For example, it deletes cookies, and temp files. When I run the program, the user can select checkboxes and click on a button to wash. Is there any way to adjust the program so when the user clicks the .exe file, my program reads the command and does the wash automatically without opening the actual program?

    C / C++ / MFC tutorial 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