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
S

Subrat Patnaik

@Subrat Patnaik
About
Posts
31
Topics
20
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • ReadDirectoryChangesW failing
    S Subrat Patnaik

    Hi all, i am using ReadDirectoryChangesW synchronously to monitor a Drive...when ever any file is copied the same is validated and deleted if the file fails the validation check..and the loop continues its wait for next change on the directory monitored...however, when i copy a folder there is an issue..if the folder is invalid and deleted, then the code exits out of the loop of monitoring the directory....i am using recursive deletion to delete folders which are found invalid...... please could i get some help on how to fix this issue......

    C / C++ / MFC help tutorial

  • button click not working
    S Subrat Patnaik

    Hi all, i am working on an MFC application, just a small dialog to take password input from user... once the password has been entered in the edit box, if i click ENTER(IN KEYBORAD) a new character is appended to the password.. if i click manually on the OK button in the dialog things work properly..... So could i get some help on how to solve this issue so that once the user types the password and hits ENTER in KEYBORAD, the action is performed which should happen on OK button clicked on the dialog... Thanks...

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

  • USB mass storage vs USB HID
    S Subrat Patnaik

    Hi _Superman_, i already know the device descriptor properties... however, if i could get some code help it would be great....code on how to enumerate the base class of a USB device....

    C / C++ / MFC visual-studio help tutorial question

  • USB mass storage vs USB HID
    S Subrat Patnaik

    hi all, i have an application which requires to monitor USB activities(only USB mass storage devices). i need a small help on how to differentiate between USB mass storage devices and USB Mouse/Keyboard/Printer (USB HUMAN INTERFACE DEVICES) etc... could it be done through device ID?? some code will help a great deal... Thank You all.

    C / C++ / MFC visual-studio help tutorial question

  • Restrict Writing to USB
    S Subrat Patnaik

    Hi all, please could i get some help on how to restrict writing to USB. This is a complicated requirement i have, however this is what i need to achieve. i need to restrict writing to USB. however writing can be done specifically to a folder and that too a specific file type. i can use registry to block writing to USB, however this does not suit to the requirement. hence i need some help on how to block writing to USB and allow only specific files to be written to one specific folder. ThankYou.

    C / C++ / MFC windows-admin help tutorial

  • getting contents from USB drive letter
    S Subrat Patnaik

    As i have already said the criteria is we have the drive letter. That's all.... now we need to get all the files and folders within it.

    C / C++ / MFC help question

  • getting contents from USB drive letter
    S Subrat Patnaik

    Not exactly... however..could it be elaborated a bit on how to get the first, next or last file from a drive, where the drive letter is known?

    C / C++ / MFC help question

  • getting contents from USB drive letter
    S Subrat Patnaik

    Hi all, is it possible to get the contents of a drive i.e the list of all files and folders inside the drive ? i have the drive letter with me. so please can i get some help to get all the contents inside the drive ??? Thank You

    C / C++ / MFC help question

  • Highlight object on mouse click
    S Subrat Patnaik

    any examples to do the same?

    C# help question

  • Highlight object on mouse click
    S Subrat Patnaik

    yes i do agree.... however last time i posted the question, it was only once...however, it was said to delete earlier post...what were the earlier post ?? i do not understand....i did post the question for the first time..so how and where do i delete the earlier posts ???

    C# help question

  • Highlight object on mouse click
    S Subrat Patnaik

    Hi, i am using a web browser control in a form application. after loading of the page , i want to highlight the image/text on which the mouse is clicked... when the mouse is clicked on a text or image the same should get highlighted.. could i get some help on this ? This is not a repost...there are no other questions posted regarding the same..... Thank You all.

    C# help question

  • C# web browser control text and image highlight
    S Subrat Patnaik

    Please can i get a feasible answer ?? i haven't received one yet..

    C# csharp help tutorial question

  • C# web browser control text and image highlight
    S Subrat Patnaik

    Hi all, i am using a C# web browser control in a windows form to display web pages.... after the web page has been loaded , i need to highlight texts and images on mouseover event.... Can i get some help on how to highlight images and texts with specific color when i drag the mouse over any text or image inside the web browser control ??

    C# csharp help tutorial question

  • code to install a package
    S Subrat Patnaik

    Hi, can i get some code examples in vc++ to install a package or an application, basically a .exe file..... Thank You

    C / C++ / MFC c++

  • How to differentiate a floppy drive and a USB drive in VC++?
    S Subrat Patnaik

    you could also use windows registry entry and settings to fetch values for hardware devices. :)

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

  • win32 service crashing in vista
    S Subrat Patnaik

    hi, i am having a service running in vista. it captures the information of the USB devices that are being used in the system. i am registering for device notification when starting the service using the RegisterDeviceNotification API, however the service is crashing when i am calling UnregisterDeviceNotification API Pasting the piece of code below....if needed i would also give the values out of debugging. please could i get some help or hints as to why my service is crashing when i am calling UnregisterDeviceNotification ?

    DWORD WINAPI service_ctrl(DWORD dwCtrlCode,DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext)
    {
    PDEV_BROADCAST_HDR head = (PDEV_BROADCAST_HDR )lpEventData;

    switch (dwCtrlCode) 
    {
    case SERVICE\_CONTROL\_DEVICEEVENT: 
    	if (dwEventType == DBT\_DEVICEQUERYREMOVE)
    	{
    		if(head->dbch\_devicetype == DBT\_DEVTYP\_HANDLE)
    		{	
    			PDEV\_BROADCAST\_HANDLE  db = (PDEV\_BROADCAST\_HANDLE) head;
    			DebugLog("Remove Query");
    
    
    			ht\_pIter = handleThread.find(db->dbch\_handle);
    			if ( ht\_pIter == handleThread.end( ) )
    				DebugLog("cannot find Thread ID using Handle Value ");
    			else
    			{
    
    				killThreadFunc(ht\_pIter->second.threadHandle,ht\_pIter->second.threadID);
    				DebugLog("after killThreadFunc");
    				if(!CloseHandle(db->dbch\_handle))
    				{
    
    					DebugLog("Problem in Closing Directory Handle.");
    				}
    
    				char error\[50\] = {0};
    				if(!UnregisterDeviceNotification(\*ht\_pIter->second.devNotify))
    				{
    					DebugLog("Problem in Unregistering Device notification.");
    					sprintf(error,"Error Code returned is %d",GetLastError());
    					DebugLog(error);					
    
    				}
    
    				handleThread.erase(db->dbch\_handle);
    
    				//SetEvent(hLogTrigger);
    				DebugLog("Thread Terminate Successful");
    			}
    
    		}
    		return NO\_ERROR;
    	}//end if DEVICEQUERYREMOVE
    	break;
    }
    

    }

    C / C++ / MFC help database json question

  • Win32 programming
    S Subrat Patnaik

    hi.thanks for the response. can i get some help on any books available over the web?

    C / C++ / MFC json help question

  • Win32 programming
    S Subrat Patnaik

    Hi, i am working on a application which is to be developed in win32 API. please can i get some help on win32 programming tutorials and resources?? any ebook will be of great help. i tried to find books, however could locate only 1 thats win32 programming by brent.e.rector which is also not available. please can i get some help on this , as i am new to direct api programing in win32. thankyou.

    C / C++ / MFC json help question

  • STL hashmap crashing
    S Subrat Patnaik

    hi all, i have a service application, which maintains a record of each and every USB being used in the windows system. in brief, my problem is with the hashmap values getting corrupted in between two threads. one thread picks the database path where values are to be written and other thread writes into that database path. Service crashes at the, when the below codes are executed. WaitForSingleObject(*hThreadIterBegin->second,INFINITE); rename(hThreadIterBegin->first->c_str(),newFileName.c_str()); ReleaseMutex(*hThreadIterBegin->second); The first thread fetches the values and the values are sent to the second thread so that it can write the necessary things to the fetched value which is the path of the database. but the hashmap value crashes at some point due to which the service crahses at above code executions. i am not able to identify the exact reason, as to why the value of ThreadMutexMapPrimary changes or crashes when it is called from the second thread??? i am attaching the code below, with declarations and values i received while debugging. Thankyou.

    **************************

    Variable declarations


    cahr queryFile[256];

    string queryFileString;

    int currentMap;

    hash_map ThreadMutexMapPrimary;

    hash_map ::iterator hThreadIterBegin;

    hash_map ::iterator hThreadIterEnd;

    **************************

    **********************************************************************************************

    FUNCTION CALL


    In 1st Thread:-> For fetching

    string queryFileString = queryFile;

    HANDLE presentMutex = CreateMutex(NULL,FALSE,NULL);
    
    if(presentMutex == NULL)
    
    {
    
    	WriteLog("Error Creating Mutex");
    
    }
    
    else
    
    	if(currentMap == 1)
    
    		ThreadMutexMapPrimary.insert(hash\_map ::value\_type(&queryFileString,&presentMutex));
    
    	else
    
    		ThreadMutexMapSecondary.insert(hash\_map ::value\_type(&queryFileString,&presentMutex));
    

    In 2nd Thread:-> For writing values

    switch(currentMap)

    	{
    
    	case 1:
    
    		if(ThreadMutexMapPrimary.empty())
    
    		{
    
    			WriteLog("Hash Map Empty No record to Write");
    
    			break;
    
    		}
    
    		hThreadIterBegin =  ThreadMutexMapPrimary.begin();
    
    		hThreadIterEnd = ThreadMutexMapPrimary.end();
    
    		currentMap = 2;
    
    		currentMappingSetReplaced = true;
    
    		break;
    
    	case 2:
    
    		if(Thre
    
    C / C++ / MFC help c++ database cryptography question

  • disabling devices
    S Subrat Patnaik

    yes.it's been done the same way in which u are saying. do u have any ideas or any means to disable the cd/dvd rom in windows xp proffessional 64 bit?? i am following all the pre-requisites for 64 bit development. hope to get a feasible solution this time.. thankyou.

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