C# :: Blocking File Action Access?
Apr 20, 2014
My problem: I want to make an application that is going to block the action of some files (It is anticheat files actually).
how do I make code to block the application's action?
Maybe there is another way to do that? I need to use Cheat Engine in game, and anticheat blocks it, so I thought if I'll block the activity of the anticheat it couldn't detect the Cheat Engine...
View 2 Replies
ADVERTISEMENT
Dec 3, 2012
consider this code:
Code:
private void DoIf(bool b, Action f)
{
if (b)
f();
}
int x = 0;
bool no = false;
DoIf(no, () => x = 10);
Does the compiler emit code to create a new action when the function is called or only when f() is actually called?
View 2 Replies
View Related
Apr 19, 2013
I have made a complete solar system with key action for zoom in zoom out, moving along x, y, z axes on plus or minus and going up/down/right/left. I am now in a bit of a dilemma. I want to add a text window ( i have made my project in visual studio 2010 in win32 console application) where to put a text like a description of each planet to appear when i hit the left mouse button. E.g. When i click with the left mouse button the Venus planet I want a description to appear in my text window. However I don't know how to put make a text window and how to correctly define the picking methods... for now everywhere i hit the mouse button it appears in to the console that i hit the sun.
View 10 Replies
View Related
Mar 8, 2014
My question is : can you limit an action to a certain time range?
For example, the user has to put character via getchar() within 3 seconds, otherwise the code will move on?
View 1 Replies
View Related
Feb 14, 2014
I have an issue where I iterate through devices and make driver API calls. Unfortunately, these calls take too much time and they are interrupting my real-time scheduler. I have 12 cores, of which one is 100% and the others are < 1%.
I'd like to multi-thread this thing. So far, I've replaced:
for (DeviceIterator d = devices.begin(); d != devices.end(); ++d) {
d->Write(words, numwords);
}
with
void* ThreadedWrite(void* p) {
WritePackage* wp = (WritePackage*)p;
wp->device->Write(wp->words, wp->numwords);
delete[] wp->words;
delete wp;
[Code]...
My problem is that this didn't improve performance at all. The main thread still takes too long to execute. Is there something I need to do to prevent the main thread from blocking?
View 2 Replies
View Related
Oct 6, 2014
I have a class holding my data strcuture:
// Holding real time option data - should be thread safe
public class OptionRTHolder {
ConcurrentDictionary<double, Quates> book_calls;
ConcurrentDictionary<double, Quates> book_puts;
ConcurrentDictionary<double, List<Single_qoute>> transaction_calls;
ConcurrentDictionary<double, List<Single_qoute>> transaction_puts;
ConcurrentDictionary<double, int> volume_calls;
ConcurrentDictionary<double, int> volume_puts;
DateTime curr_time;
}
I get a stream of data messages, that come in order, each message carries a time and data. I have many threads in paralell pulling messages and in turn update the data strucutre as follows:
Quates and volume data are just overrun (new value overrun former values), also thier size and meta data is fixed (they don't grow post init).
Via the list I have a problem, I would want to lock only the list I am working on. so other lists can update in paralell, what I had in mind was to warp the list in order to warp the add/get calls to make it thread safety, this I think will achieve this goal and I would like to get some assertion from this forum if you may.
Here come my real problem, there are points in time I want to read/copy this structure, during this time I want to block all updating threads as I want to freeze structure in time, is that achiveable ? Idea that I had is to use something like aquire that will get a function (update/read) and a flag that will cause a lock when the read is on...something like that.
View 3 Replies
View Related
Apr 22, 2013
I wanted to create an asynchronous/non-blocking udp client server application where the client and server were supposed to chat away with each other without waiting for each other's turns. I came to know that this could be done by select()... here is my Server(Mentioning only the communication part):
Code:
fd_set readfds,writefds;
while(1){
FD_ZERO(&readfds);
FD_ZERO(&writefds);
FD_SET(sd,&readfds);
FD_SET(sd,&writefds);
int rv = select(n, &readfds, NULL, NULL, NULL);
[Code] .....
At first on the server side I wrote:
int rv = select(n, &readfds, &writefds, NULL, NULL);
But that led to the printing of an entire empty array on the server console when the server initialised in addition to the fact that communication between the server and client was not proper. removing "&writefds" did remove the redundant data but the improper communication issue still persists...
View 3 Replies
View Related
Mar 5, 2015
I have a thread that fetch elements from a std:queue, which are pushed from other threads. My question is how can I fetch elements from the queue in a blocking mode, what I mean is if there are no elements in the queue then the fetch call will block until at least one element is pushed. Of course I want to do it this way to avoid polling.
View 6 Replies
View Related
Mar 27, 2014
I am writing an application that needs to temporarily disable the Play/Pause button that appears on multimedia keyboards.
Normally, a key can be blocked quite easily by installing a low level keyboard hook (WH_KEYBOARD_LL) where the KeyboardProc intercepts the key (in this case VK_MEDIA_PLAY_PAUSE) and returns a "1" instead of calling CallNextHookEx. I have tried this with other keys (including the Windows key VK_LWIN) and this works perfectly. I also have no problems with this method under Windows 7 where all keys, including VK_MEDIA_PLAY_PAUSE get blocked.
Windows 8 is a different story. When my application has input focus, everything works as expected, meaning the VK_MEDIA_PLAY_PAUSE key gets blocked and no other application responds to it. However, when my application loses focus, my hook procedure gets called (this was verified by sending out a OutputDebugString) but other applications respond to key even though I return a "1". As soon as my app gets focus again, everything is block as it should.
After some investigation, I found that the multimedia keys not only generate keystrokes but also generate WM_APPCOMMAND messages so I added ShellProc (WH_SHELL) hook with the following hook procedure:
LRESULT __declspec(dllexport)__stdcall CALLBACK ShellProc(int nCode,WPARAM wParam,LPARAM lParam) {
// Do we have to handle this message?
if (nCode == HSHELL_APPCOMMAND) {
OutputDebugStringX(">>>>> HSHELL_APPCOMMAND");
[code]....
This procedure is only getting called when my app has input focus. Whenever I have input focus and return "1" the Play/Pause command gets blocked. As soon as I lose focus the procedure does not get called/hooked.
As I have mentioned, the code works for other keys, just not the multimedia keys.
Alternatively, another way of blocking the multimedia keyboards Play/Pause button?
View 6 Replies
View Related
Feb 17, 2015
I am interested in creating a file of a given size and then randomly accessing the file to populate it. Is there a way to quickly create, for instance, a 4 GByte file in C++, initially populated with garbage?
View 4 Replies
View Related
Sep 9, 2013
if we don't provide the acces modifiers for base class and we need to manipulate the private data of base class in derived class. Is there anyway to acces the private data members? Here's a coding example
class A {
private :
int a;
};
class B : public class A {
public :
void displayA() { cout<<a<<endl; }
};
how i can acces the a of base class A in derived class B without acces modifiers.
View 16 Replies
View Related
Jun 29, 2014
Is it possible to access file properties from c++ program? For example, user could drag file to program and then it displays a detailed information about file like date modified, size, type and etc..
View 1 Replies
View Related
Sep 8, 2014
How to access the name and file name members on line 42 and 43?
Code:
typedef struct {
char * name;
char * filename;
} FILES;
FILES * files[256];
}
[code]...
How to access the name and filename from within function?
*files[count].name = chTmp;
View 9 Replies
View Related
May 21, 2013
How to access a method from a .h file in another .cpp file
Code:
// main.cpp
#include <iostream>
#include "inc/one.h"
using namespace std;
int main( ){
School Tadd;
Tadd.AddTeacher(1);
return 0;
[Code] ....
When I compile , i am getting the below error
In function main:
undefined reference to `School::AddTeacher(int)'
Build finished: 1 error
View 4 Replies
View Related
Sep 2, 2013
I have 3 files: f1.c f2.c and f3.c
I have declared variable int a; in f1.c and int a; in f2.c.
Now I want to use the variable int a; in f3.c . But this variable corresponds to the variable in f2.c .
View 4 Replies
View Related
Dec 18, 2012
I have two cpp files.I m updating a value of an integer in one cpp file and i want to perform a specific function in the second file as per to the value updated in the first file. ie I m initialing the variable in the constructor. I have two buttons in the first cpp file. On clicking the first button I m updating the variable as 1 and on pressing button two , I m updating the variable as 2. I m retrieving this variable in the second cpp file with respect to the object created for the class in the first cpp file.
The problem is that i m not able tot retrieve the updated value in the second file. only the initialized value is being retrieved. neither 1 nor 2 is updated.
View 3 Replies
View Related
Nov 5, 2014
I have been searching through the forums and found a couple snippets of code and from that i came up with this. What i want to do is search for the specific movie code and then update the movie status from inactive to active (for argument sake).
Code:
#include <stdio.h>
#include <stdlib.h>
typedef struct SYSTEM_MOVIE{
int movie_code;
int movie_dur;
char movie_title[25];
[Code] ....
View 1 Replies
View Related
Aug 27, 2014
I want to delete the folder from the file system, but I am getting error of access permission.
I want to change the permission of the folder so my program can delete it.
The problem I am facing on google search is I am getting results mostly for MFC code which is windows specific. However, I want to write a code in core C++ that works on all platforms like unix and windows.
View 12 Replies
View Related
Nov 14, 2012
I have a .png file that my console app reads and puts into a structure that is saved as a file. The png is always the same so I thought I could just add it as a resource image to a resource file so it would be included in my program and not as a separate file. When I did that, the png shows up as a "SystemDrawingBitmap". If I examine this resource in a watch I see "Base" and "Static" members. Expanding those properties does not give me anything useful such as a pointer to the raw png data and its length in bytes.
If worse comes to worse, I can always make a hex dump of the png contents and then put the hex code into a CS file using static initialization.
Surely there is some way I can access the raw data internally and read the bytes into a byte array using C#
View 2 Replies
View Related
Nov 9, 2014
The file name is "movie.dat" and currently i was able to save data into the file in this order:
[movie_code] [movie_dur] [movie_title] [movie_rating] [movie_dir] [movie_genre] [movie_status]
[12345] [120] [Movie] [PG13] [Director] [Comedy] [Active]
I want to search for the "movie_code" and change the [movie_status] from Active to Inactive.
So lets say for example i have a movie code 12345 saved in my movie file. I want to change the value from "Active" to "Inactive"for argument sake.
This is the code i was trying to do it with:
Code:
FILE *movie_fp;
movie_fp = fopen("movie.dat", "r+b");
int m_code;
MOVIE movie_data;
printf("*** Welcome to the movie updater! ***
[Code].....
View 3 Replies
View Related
Sep 29, 2012
i have to upload a ms access database file to the server from my client program. The server program should connect to this database and read the data. What's the easiest way to upload the file? Is it FTP? i tried sockets, but it only allows like 9kb of data transfer capacity.
View 3 Replies
View Related
Apr 1, 2014
I am currently doing the assignment about linked list. Here are some details information about what I am doing.. This program is C++ and should run on Visual Studio 2010. And it contains three file, two datastructure header and one main cpp file.
This program is trying to arrange and show some sports records. The main program which contain the functions such as reading the result text file(each result text file contain several records of athletes), removing a file, arranging the totalresult and printing it out. And the main program is already given and I cannot overwrite it.
But when I finished and try to build the solution and run it, I am not able to run the program and it give me somethings like these...
warning C4172: returning address of local variable or temporary
error C2248: 'Datastructure1::Datastructure1' : cannot access private member declared in class 'Datastructure1'
see declaration of 'Datastructure1::Datastructure1'
see declaration of 'Datastructure1'
This diagnostic occurred in the compiler generated function 'Result::Result(const Result &)'
And I have tried to comment each function part of the header file and see if can run or not. But I still fail to do so. Here are my codes...
#ifndef DATASTRUCTURE1_H
#define DATASTRUCTURE1_H
class Datastructure1 {
Public:
Datastructure1( );
[Code] ....
There are two header files and look quite long. They are all some linked list functions . I have read and learn linked list data structure before I complete this programs. However, when I complete the functions required, the function cannot be compile....
View 11 Replies
View Related
Jan 21, 2014
I have two puzzling issues I am dealing with.
Issue 1: I am using a stringstream object in a block of my program that needs to be visited repeatedly depending on a user's selection from a menu. I want the contents of this stringstream object to be cleared any time control gets to this part of the program. I have tried the clear and flush functions to no avail.
Issue 2: I am reading data from a source text file that would be regularly changed during the course of program run. After the program run is over, I am supposed to save the results(which is basically the source text file AND all updates) in a destination file. This destination file would then serve as the source file when next the program is run. In other words, I want a scenario where my results overwrite the original contents of the source file; implying that my source and destination files are now one, pretty much. How can I do this?
View 7 Replies
View Related
Jan 15, 2015
I am working Visual C++ 2012. I am trying to read a GLOBE file using the following code.
#include "stdafx.h"
#include "iostream"
#include <stdio.h>
#include "stdlib.h"
#include "string.h"
#include "cmath"
#include <errno.h>
using namespace std;
/* Conversion useful */
[Code] ....
I am getting the error in the if condition (bold).
View 12 Replies
View Related
Nov 12, 2014
I have been asked to create a program that accesses an inventory file done in excel, look for a alpha-numeric code, which will be inputed by the user, and return to the user informations related to the position of that code, and informations related to the header of the column in which the code resides.
An example of the function I need the program to perform would be:
User inputs: 1429-R1
And the program returns: Marco's 6A, 8/21/2014, 3/7/2014.
using the following example of file:
Marco's 6A
Assessment 8/21/14 3/7/14
1584-R1 1584-R1 1584-R1
1461-2R1 1461-2R1 1461-2R1
1429-R1 1429-R1 1429-R1
View 1 Replies
View Related
Dec 31, 2014
I would like to copy one bmp file to another using plain fstream (none 3-rd party library). I've managed to come up with something but I keep getting error:
Unhandled exception at 0x504A3442 (msvcr120d.dll) in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0x00380000.
when i try to write the content of the bmp files not the header, namely error occurs in this line:
Code : ofs_differential.write((char*)&picture, (bfh_warm.bfSize - bfh_warm.bfOffBits));
Also i am not sure if i am doing it in a right way, meaning that even after solving this error i will copy the bmp file successfully.
Code:
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
struct BITMAPfileHEADER {
unsigned short bfType;
[code]....
View 3 Replies
View Related