|
You're in the managed C++ forum, do you mean a managed array of the managed string class ? They have a handle, not a pointer. To get a pointer, you need to pin it, I believe.
That's assuming that is what you meant.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
OK, then a string array IS a pointer.
string * pStrings = new string[20];
If you need more info, I recommend posting in the right forum ( Visual C++ ), and choosing a subject that describes your problem.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
I did say to ask in the right forum...
That's NOT a string array, it's a char array.
char test[20] = "12124312321412432";
char * p = &test[0];
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
Hello Premson,
Despite Christian repeatedly telling you that this is the wrong forum, why did you insist on pursuing the thread here?
|
|
|
|
|
Hi..
Is there a way to prevent a file from being opened in windows desktop ....
The System is not a part of any network..
There is No other users except Administrator is available in the system.
Thanks
Luck is Opportunity with hardwork
|
|
|
|
|
You can run a program which opens the file, which will lock other users from doing so. Why is this in the managed C++ forum ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
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!
|
|
|
|