|
Hi
In my project i need to implement icon overlay for selected files and folders in a file system.When u right click on a file/folder and select a context menu the icon of the file/folder must be overlayed with a small icon.
I am new to windows shell programming and dont have enough time to do R&D.Searched the net but couldn't find any solution.Found one solution in DotNet247.com but it's not complete code.
can anyone help me.If possible post the code.
Regards
Krishna Choudary
|
|
|
|
|
i save my application settings in a settings.xml file. The settings.xml is editable with any text editor and therefore i always have to consider the fact the settings could ha been mnaullly edited. Is there a way io could encode or something my settings.xml so that the user cant see the the actual content. Also, how can i check wether my file has been modified.
|
|
|
|
|
I think you can create a hash for your file and put it at the beginning.
Then the next time you want to load that file, you must first create
a hash from it and compare it with the hash in you XML file. If it is the
same, then your file is not editted. Otherwise, someone has edit your file.
Use MD5ServiceCryptoProvider.
|
|
|
|
|
Iam working on MDI application and I have some problem.
For the main form, IsMdiContainer is set to true as well as the MdiParent for child form, is set to 'this' (main form).
But problem starts here.
I put all the codes for each controls in each separete class so it's easy to manipulate.
In Tabs class, I have all the methods, properties I need for adding, removing, renaming etc. tabs.
I also have a method for adding new child forms.
In this method, MdiParent isn't set to 'this', but to frmMain.ActiveForm.
The thing is that everything works great unless I try to add new tab from the other Form.
App then breaks at line MdiParent = frmMain.ActiveForm with this error:
Form that was specified to be the MdiParent for this form is not an MdiContainer.<br />
Parameter name: value.
How can I workaround this problem, but still have this method for adding new child forms in Tabs class?
Iam out of ideas.
Sorry if my post is confusing.
|
|
|
|
|
Hi,
ActiveForm is a static property of the Form class that returns currently activated form for the application but not the acitve frmMain instance. So in some cases you try to bind child form to the non-MDI-parent form.
To have access to your frmMain form from all your classes you can add static property to it (as in the Singleton pattern):
class frmMain
{
private static frmMain current;
public static frmMain Current
{
get
{
return current;
}
}
public frmMain()
{
current = this;
}
}
Then you can use this property to construct your MDI-child forms:
childForm.MDIParent = frmMain.Current;
|
|
|
|
|
Thank you Andrew, very much. It works like a clock.
I've tried something similar, but mine wouldn't work .
I've used other class for this, and it happened nothing, no error, no action, no anything .
And again, thanks.
|
|
|
|
|
i'm writing simple application that uses TCPListener and Client - i use BackgroundWorker to make listening in other thread. It set, when any error ocured function will use ReportProgress function and it will cause event and event will notice window etc ;]. My question is - i'm trying without debugging (just run exe) it work fine, with no problems - but WHY when i'm doing this same operation WITH debugging i get exception i can't access component in thread control weren't created in. I chceked - debugger show this line of code is called in BackgroundWorker thread - but how it work in "normal" mode?
Ideal compilator compiling comments without code...
|
|
|
|
|
i think the same problem was with ma project,,,
i think we cannot run two prosess in 1 thread..(ie listening and connecting)
this will cause Cross-Thread exception...
so just create the setup and run the exe file.
|
|
|
|
|
Hello to all.
I have a problem,which is how i backup and restore my database using c# application.
I m using c# and SQL-server.
Plz help my problem along with example(code) also and plz send it also on my own e-mail address.
wahid_dirvi@yahoo
bye
thanks
|
|
|
|
|
Would be nice if you would give detail as to what your problem is with backing up and restoring a database using C#.
I'd like to help but I am too lazy to Google it for you.
|
|
|
|
|
Google[^] . Um take a look at the first result, an article on this website non-the-less.
As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it
|
|
|
|
|
I get a get lastest in VSS for a Huge project
It has several projects that require virtual directories.
So I decided to use the Setup & Deployment package.
So I want this VirtualFolder to point to my working folder. ( This is a Web Service by the way)
But in the properties it has the property "VirtualFolder". DO I use this as my local path to the working directory?
Or is this not possible. Basically I just want to set up virtual folders to point to my working folders that alrady have project files in them.
Can you help?
Thanks,
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Hey
I have a problem, I have a lot of files and each file contains a lot of strings with length of 4.
There might be double strings in each file.
I need a fast way to implement a check of how many different strings I have in all the files together.
I can't load all the strings into memory, there are many strings.
The number of different strings can arrive easily to 100 millions.
Clint
|
|
|
|
|
If you need a distinct count then you have to loop! You don't need to load the entire file into memory, you can use a stream to quickly scan the file.
100 million seems like a large estimate for the number of distinct 4 character strings. Are you really looking for an alphabet of 255 characters? (or worse if unicode)? If you really will have this many distinct records create a file of the number of distinct possible records * 4 bytes and store the count as an unsigned int in the file offset.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
That's even a small estimate.
I will have 2 on the power of 32 records maximum. I don't know if it is a good idea to build such a big file.
|
|
|
|
|
There is a difference between distinct records and records. If you want to count distinct records you must have a way of storing the count. 2^32 is roughly 255^4 which makes me wonder why it is even string data (they would more accurately be binary at this point)
"Got Ram?"
clint1982 wrote: I don't know if it is a good idea to build such a big file
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
You are right, It's 4 character binary. I need an efficient way to count the number of distinct records,
|
|
|
|
|
Index the files then loop through to count. However, 4^255 is huge and you will not be able to store the results in ram so you will need a file structure just to store the results. Better if you could use small subsets at a time.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Build a self building huffman tree to get the counts. It would be slightly slower than an incremental loop but would occupy 50% less space unless the counts are uniform.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
I have developed extensive socket handling routines in C/C++.
These routines read and write TCP blocks using my own compressed/encrypted protocols.
Some of these routines don't return until a full sequence of sends and receives is satisfied.
Actions are controlled using states with work loops broken by Sleep(20) calls.
When these routines are compiled into a C++ server with muti-threading, all works fine. You can have hundreds of simultaneous sockets in use all in various protocol states.
Now I'm developing the server in .NET and the I've simply wrapped the socket handling routines in a Class within a COM DLL.
I have to create the COM DLL Class once (since the socket handling routines communicate via an external socket number that the routines hand out) and then proceed to create threads in .NET to handle concurrent actions within the DLL.
When one .NET thread issues a call to the DLL that implements a Sleep loop internally, it locks up any calls to the DLL from any other .NET threads.
I have tried setting the module and thread apartment state on the COM handling to Multi-threaded mode in the belief this might help but no go...
Surely there is a way of multi-threading the DLL.
Thanks.
psernz
|
|
|
|
|
I read a book , "Thinking in C++".At pg:694( Introduction to templates) he writes:
<br />
"The Smalltalk solution. Smalltalk (and Java, following its<br />
example) took a simple and straightforward approach: You want to<br />
reuse code, so use inheritance. To implement this, each container<br />
class holds items of the generic base class Object (similar to the<br />
example at the end of Chapter 15). But because the library in<br />
Smalltalk is of such fundamental importance, you don’t ever create<br />
a class from scratch. Instead, you must always inherit it from an<br />
existing class. You find a class as close as possible to the one you<br />
want, inherit from it, and make a few changes. Obviously, this is a<br />
benefit because it minimizes your effort (and explains why you<br />
spend a lot of time learning the class library before becoming an<br />
effective Smalltalk programmer).<br />
But it also means that all classes in Smalltalk end up being part of a<br />
single inheritance tree. You must inherit from a branch of this tree<br />
when creating a new class. Most of the tree is already there (it’s the<br />
Smalltalk class library), and at the root of the tree is a class called<br />
Object – the same class that each Smalltalk container holds.<br />
This is a neat trick because it means that every class in the<br />
Smalltalk (and Java1) class hierarchy is derived from Object, so<br />
every class can be held in every container (including that container<br />
itself). This type of single-tree hierarchy based on a fundamental<br />
generic type (often named Object, which is also the case in Java) is<br />
referred to as an "object-based hierarchy." You may have heard this<br />
term and assumed it was some new fundamental concept in OOP,<br />
like polymorphism. It simply refers to a class hierarchy with Object<br />
(or some similar name) at its root and container classes that hold<br />
Object.<br />
Because the Smalltalk class library had a much longer history and<br />
experience behind it than did C++, and because the original C++<br />
compilers had no container class libraries, it seemed like a good<br />
idea to duplicate the Smalltalk library in C++. This was done as an<br />
experiment with an early C++ implementation2, and because it<br />
1 With the exception, in Java, of the primitive data types. These were made non-<br />
Objects for efficiency.<br />
2 The OOPS library, by Keith Gorlen while he was at NIH.<br />
16: Introduction to Templates 695<br />
represented a significant body of code, many people began using it.<br />
In the process of trying to use the container classes, they discovered<br />
a problem.<br />
The problem was that in Smalltalk (and most other OOP languages<br />
that I know of), all classes are automatically derived from a single<br />
hierarchy, but this isn’t true in C++. You might have your nice<br />
object-based hierarchy with its container classes, but then you<br />
might buy a set of shape classes or aircraft classes from another<br />
vendor who didn’t use that hierarchy. (For one thing, using that<br />
hierarchy imposes overhead, which C programmers eschew.) How<br />
do you insert a separate class tree into the container class in your<br />
object-based hierarchy? Here’s what the problem looks like:"<br />
<br />
And a diagram<br />
and he writes:<br />
<br />
"Because C++ supports multiple independent hierarchies,<br />
Smalltalk’s object-based hierarchy does not work so well."<br />
Is this true?
I have 2 questions
1-)Can we say same thing for C#?(I mean: C#’s object-based hierarchy does not work so well).What is C# 's solution?
2-)We know C# is very very differnet than c++.Someone look and see that everyline of code is ended with ";" so says:"C# is similiar to c++".But this is not true.
Can we accept author's expression for "showing differences between C++'s OO fashion and C#'s OO fashion"
What are your opinions.
I am looking for your answers.
|
|
|
|
|
Smalltalk (as the author references) requires that all objects inherit from another object, and new objects are added to the tree. Based on my experiences (surface only) with Smalltalk part of the weakness comes in where a problem in one object causes a cascading failure throughout all objects in the tree. So, for example, you have a message object that contains a collection of messages. If you add a new message but do not explicitely tell that message object it has a new object, it will fail and the object it inherited from fails, and the one that inherited from it fails, etc. There is no way to gracefully handle a failure like that.
C++ does not require that you inherit from anything....however you also need either a header file or write your own for everything you want to do.
C# provides inheritance where it starts by inheriting from Object. However you also have a framework that supports the ability to handle a graceful failure in the heirarchy.
This actually sounds like an old article explaining why Smalltalk is bad. There was a time when that language was the only OO language in existance. But future languages improve upon the basics to provide a richer environment and better behaviour.
|
|
|
|
|
Hey all!
I have implemented a forms designer, with a toolbar and propertygrid etc. It all works well and I have move, resize and add controls to the designer host. I am constructing sort of a monitoring application with graphs and gauges etc. My plan for this application was to let the user enter "design mode" where he/she can choose what controls to show and customize them using the forms designer. When satisfied, the user should be able to switch back to "run mode" where all the designer-related behavior/properties is hidden and the controls acts like normal controls (not in DesignMode).
How do I achieve this? Anyone has some tips of how to do this? Simply, I have a bunch of controls in DesignMode, I want to be able to toggle them between designmode and run-mode.
Any help would be very appreciated!
Best regards,
Peter
|
|
|
|
|
Reading the elements you describe, it seems that what you need is a runtime environment that is interpretive rather than compiled. The runtime manageer would contain the forms and expose a an element for switching between execution mode and design mode.
The runtime manager would then change the containing class as it moves between runmode and designmode. The containing class would be like an MDI container with the toolbox and property grid as decorators in the designmode view of the container.
The hard part will be coming up with a way to represent this stuff and interpret it and then display it in a reasonable level of response time.
-- modified at 15:20 Friday 28th July, 2006
|
|
|
|
|
What can I use instead of struct to store little info? I want create instances, put them in a dictionary, iterate and modify elements in the dictionary. I know every addition will involve a boxing operation, and every modification will involve an unboxing followed by a boxing operation. What is the best thing to do?
|
|
|
|