|
hi Thanks for the reply,
Im writing this in c++ forum because i came to know that it is possible only in c++.
IM developing an application which monitors the activities of the system.so whenever a user double clicks on a file.The application which is monitoring the activities receives a message that a user is trying to open a file and it is through the application that we decide whether to allow access to the file or deny.The file should open only if the application grants access.Anyway if the application is sttoped the user should have access to the files.
Any Ideas...
Luck is Opportunity with hardwork
|
|
|
|
|
What Christian replied should work if you wanted to lock a file.
sundar156 wrote: Im writing this in c++ forum because i came to know that it is possible only in c++.
Not quite true. Language is just a matter of choice or convenience. BTW, if you just want VC++, not C++/CLI, post your questions on "VC++/MFC" forum.
sundar156 wrote: whenever a user double clicks on a file.The application which is monitoring the activities receives a message that a user is trying to open a file
You may get a mouse click message, but how could you tell that the user is trying to open a file? Apparently this needs more thinking and design.
Best,
Jun
|
|
|
|
|
sundar156 wrote: Im writing this in c++ forum because i came to know that it is possible only in c++.
As has been said, this is not true, and in any case, you're not in the C++ forum but the C++/CLI one
You may be able to write a system wide hook that establishes the attempt to open a file, but it sounds like it's going to be a complex task.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for the reply,
Yes it appears to be complex! And i have posted in lots of forums and i didnt get a feasible solution yet! In some they say it is only possible in Linux! Some say that it isnt possible,yet others say it is possible by API hooking.I have not done any hooks until now.
but system wide hooks should be done using c++.Am i right? Anyway if this is not the right forum please tell where to post?
Luck is Opportunity with hardwork
|
|
|
|
|
sundar156 wrote: In some they say it is only possible in Linux!
That is possible, because you're talking about something OS specific ( how the OS works with files )
sundar156 wrote: but system wide hooks should be done using c++.Am i right?
Probably.
sundar156 wrote: Anyway if this is not the right forum please tell where to post?
The Visual C++ forum
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thank you Christian.I will try in Vc++ forum.
Luck is Opportunity with hardwork
|
|
|
|
|
hello every one i am new in C++
i want to interface to my mouse in my c++ program.And found error. i dnt hav a mouse.h file . how can i interface to mouse with out it. plese help me
|
|
|
|
|
This is the managed C++ forum, is that what you wanted ?
I don't believe there is a mouse.h, what's your source of reference ? What sort of program are you writing ( windows forms, MFC, Win32, console, etc )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Mouse, keyboard, monitor, serial port, etc have become the standard, generic I/O interface built in Windows. There are a number of abstractions above these hardware devices. You don't deal with them directly any more.
If you have specific questions about how to handle mouse clicks, post them on "Visual C++/MFC" forum.
-- modified at 11:52 Tuesday 19th September, 2006
Best,
Jun
|
|
|
|
|
Is it normal for managed c++ classes to be coded with all their members inlined in one file like c# or do you still split the interface and implementation between a .h and .cpp file?
The examples in MSDN that I've seen seem to have everything in lined and coded in one file
|
|
|
|
|
Josh Gray wrote: do you still split the interface and implementation between a .h and .cpp file?
I don't split with VS.NET any more.
Josh Gray wrote: The examples in MSDN that I've seen seem to have everything in lined and coded in one file
One important reason could be that when you use VS.NET IDE, all the compiler generated code is defaulted to the header, including event handlers. Manually relocating the compiler generated code could cause problems to code updates later. That said, I am not aware of any C++/CLI coding standard that supports or objects to this trend.
Best,
Jun
|
|
|
|
|
In managed C++, writing all of a class' members inline is okay especially if it was created by a wizard. However, if you need to reference a class created later in your source code, you will be forced to use the standard way of writing C++ classes.
|
|
|
|
|
I still split my classes into .cxx and .h files (I use .cxx to distinguish C++/CLI from traditional C++).
I prefer having header files which only contain declarations and no implementations, because these can be #included in other header files (in the same project) with minimal cost (together with typedefs of instantiated generic/template types). So when I want to use one class in another class, I can just #include the other class' declaration (I don't want to include the function implementations, just the declarations). Also if I change any part of the implementation, I don't need to recompile several classes. In C# you can use .net classes from the same project in other compilation units without #including any class definition, but not in C++/CLI. If C++/CLI supported metadata importing from other object files in the same project, quite a few of my reasons would disappear, and I would (mostly) only have .cxx files.
|
|
|
|
|
I need some kind of thing that I can run while I'm away from my computer that will automatically refresh the active webpage once every hour. Is this possible and if so, some of your expertise would be greatly appreciated!
I dont really even know if this is the right area to post in, so if its not please let me know where would be a better place for this type of request.
Thanks!
|
|
|
|
|
trixter2004 wrote: I need some kind of thing that I can run while I'm away from my computer that will automatically refresh the active webpage once every hour.
Avant Browser (which is wraps IE) has this as an option, any one of the tabs can be set to refresh at specified intervals.
http://www.Avant.com[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
ok ive got the avant browser now....can anyone help me out on how to make it auto refresh?? ive looked through the options and stuff and cant seem to find anything...maybe ive overlooked? any help would be greatly appreciated. Thanks!
|
|
|
|
|
trixter2004 wrote: can anyone help me out on how to make it auto refresh?? ive looked through the options and stuff and cant seem to find anything
Navigate to the web page.
Right click on the tab,
Scroll Up to Auto Refresh.
Select value
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
thanks so much! works perfectly...really appreciate your help
|
|
|
|
|
trixter2004 wrote: thanks so much! works perfectly...really appreciate your help
You welcome. :->
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Hi All,
I'm writing a program, part of which needs to read text from a .log file in UNICODE line by line, then convert it to ASCII and write it to an ASCII .log file line by line...
I've been battling with this issue for a week, and have yet to find a solution.
PS: I'm writing in C
Thanks a lot
Alex
|
|
|
|
|
|
i have a small console program that shows you, your ip and resolves from your ip your host name(reverse dns) and display then your ip and host name to the screen.
an example output:
IP: 12.34.567.89<br />
Host Name: dslb-012-034-567-089.pools.myisp-ip.net
now i want to convert the
dslb-012-034-567-089.pools.myisp-ip.net
to
dslb.pools.myisp-ip.net
or something similar.
my goal is to remove the numbers and the "- " character from the host name string, because my ip is a dynamic ip and it changes every 24hrs automatically. it should start to find the first "- " character and from there, until the first ". " character or last number in the host name string and then cut out the found unneeded characters and then display the final host name string without the ip and the "- " character.
i'm using msvc++ as compiler.
how would i do that?
any help and hints are more than welcome.
|
|
|
|
|
I would suggest searching for the index of the first '-' and the first '.' using System::String::IndexOf. Then use each index with System::String::Substring to get the "dslb" and ".pools.myisp-ip.net" sub-strings.
|
|
|
|
|
thanks zaccheus, i could solve it with help from a good online friend, his hint was to use:
#include <stdio.h><br />
<br />
void main()<br />
{<br />
char host[]="dslb-012-034-567-089.pools.myisp-ip.net";<br />
<br />
printf("\n %s ", host);<br />
strcpy(strchr(host,'-'),strchr(host,'.'));<br />
printf("\n %s",host);<br />
<br />
} output:
dslb-012-034-567-089.pools.myisp-ip.net <br />
dslb.pools.myisp-ip.net
and i modified it to:
char* cShortHost = host->h_name;<br />
strcpy(strchr(cShortHost, '-'), strchr(cShortHost, '.'));<br />
<br />
printf("\nShortHost Name: %s", cShortHost);
|
|
|
|
|
I noted with joy that the Array class has GetValue(Int64) and SetValue(Object^, Int64); however there does not seem to be a way to (re)size an array using Int64, which makes me wonder (a) why not and (b) why the Int64 versions of Get/SetValue?
|
|
|
|