Not sure if I should be posting here, or in the c++ forum since my app's written in c#, but the error's being generated by a win32 api call. I'm using the following 3 api calls as demonstrated in the msdn article to monitor changes being made to a folder over samba (FileSystemWatcher won't do this). In my tes app the water class works perfectly. When I use my watcher class in my main app everything is fine with one copy running. With two copies though if, FindNextChangeNotification returns false and generates errorcode 0x64006e as returned by Marshal.GetLastWin32Error(). Win32Exception.Message describes this as an uknown error, and no error codes with this large a value are listed in msdn, or winError.h. Looking at the code between my main app and my tester I'm not seeing any meaningful differences, and with an unknown error I don't know wehre to be looking. The biggest difference between the two is that when a change occurs my tester just throws up a message box, while my main app reloads all the files in the folder. (There're only a handful so the performance hit from loading everything isn't enough to justify the extra work needed to ID which file was modified).
I am making a program. When a button is clicked a new form is created (form1.IsMdiContainer = true;) and then I want to put a menu on that form1 so the user can make some choices.
How do I go about doing that? I keep getting into problems
Thanks for the reply.
This not what I meant, if you look in the picture of the article you were kind enough to point me to you see that the big window that houses the smaller ones has menus, I want the offspring to have menus, the windows or forms that contain the picture in the article. How do I do that? That is what I couldn´t do.
I am currently working on an encryption application. I created a windows service that watches over a directory and when a new file is added, it encrypts it.
Now here is the problem . I want to find out which user has added a file to the directory (which is o n network). Is this possible to find out which user has dropped or added the file to the directory in C#.
Thank you very much. I could convert the VB.NET code to C#. Instead of using WMI i used unmanaged code itself calling all the function manually. It summed up to 40lines code and works fine. Thank you very much for help
Moderating emails is rather "vague". If you want a spam filter, there are many good solutions out there. If you want to block certain addresses, regardless of the "spam factor" (ex-girlfriends or so ).. you can have a mail relay tweaked. Postfix for example.
I have designed an windows application in C#. I want to embed the plug-in functionality in it (like Winamp software), such that a third party can create a plug-in and can add its functionality to my application. How can I do it? What should I do extra on a simple Windows Application written in C#?
Whew, where to begin. First about the enums. I am assuming your Card class set method is structured as such: Card.Set ( Rank r, Suit s) and you have an array of Cards in deck. So to set your first card you would say deck.Set ( Rank.Hearts, Suit.Ace ).
Now the first problem is you have Rank and Suit mixed up, the Suit should be hearts, clubs, etc. Confusing to read.
Your second issue is your Card property Rank and Suit have the same name as your enum, that cannot be. I see what you are doing, you want to return that enum to set the next card with it, but you can't have the same name. I would change the name to CardRank and CardSuit and define the property like this:
public Rank CardRank
cardRank = value;
// do the same for CardSuit
now your swap functions will be:
tempCard.Set ( deck[first].CardRank, deck[first].CardSuit );
If you used integers in you Set function prototype then this won't work and you have to modify your properties to convert to integer or from integer depending on what your members are.
Your third issue is your last card will never get shuffled, Random returns a number less than the number passed in and your first and second could theoretcially be the same card (not a real problem, just wasted a shuffle)
If you want the integer value of an enum do this:
int x = (int) Rank.Clubs; //now x = 4
Rank r = Rank.Clubs;
int x = (int) r; //x = 4
finally if you want the string value:
string s = Rank.Clubs.ToString(); // s = "Clubs"
Awesome. Thanks for those pointers. That will certainly help me get sorted out.
There is one issue, the big one, that you didn't mention however (I don't think).
I have two integers from the four loops, s and r. s is between 0 and 3 and r is between 0 and 12. They correspond directly to the integer values I assigned the suits and ranks in the enum.
From those integers, I need to store the suit and rank, in the for loops.
So - I need to do something like:
Rank rank = (Rank)r; // r is in integer. if r == 12, then this should set rank equal to Rank.Ace, however, you can't typecast an integer to the equavalent enum value. I don't need the string. You see what I'm saying?
Last Visit: 31-Dec-99 19:00 Last Update: 24-Feb-24 17:29