|
im writing a program i dev c++ who skude aktivate an ather program when the
USB-port is aktivated but i do not know who to get indikation from the
USB-port, any sudgestion?
|
|
|
|
|
|
Hello,
Are there any free controls out there that I can use in my application to let users browse folders and files just like Windows' Explorer? If it's possible I want it to have the xp look.
Thanks in advance
~~~~~~~~~~~~~~
Martin Lundberg
Student, Sweden
I have to thank every member of the Code Project for making it such a great place for a beginner to learn!
|
|
|
|
|
|
FolderBrowserDialog , actually.
This simply wraps the SHBrowseForFolder Shell API, which is the common approach.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
But I don't want a dialog that pops up, i want it laying on the form...like in explorer, can I do that too with FolderBrowserDialog?
Thanks again!
~~~~~~~~~~~~~~
Martin Lundberg
Student, Sweden
I have to thank every member of the Code Project for making it such a great place for a beginner to learn!
|
|
|
|
|
No, you can't do that with FolderBrowseDialog . Like I said, it wraps the SHBrowseForFolder Shell API. You should've read about that for more information.
If you're trying to make the umpteenth million Windows Explorer "replacement", you're definitely going to spend most of your time re-declaring unmanaged structs, interfaces, and P/Invoking lots of unmanaged APIs. The link mayasm gave you only shows yet another way to use a function that brings up the same (or very similar - in terms of implementation) dialog that SHBrowseForFolder does, only the latter API encapsulates all the ITEMIDLIST s and what-not, saving the caller a lot of work.
There was an article a long time ago I read either here on CodeProject or on MSDN[^] that discussed a way to do this. You might try searching google.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello again
hehe, I'm not trying to do the tenthmilion windows explorer replancement =) I'm trying to make an basic code editor for html,css and other things. And for that I need an easy way of browsing folders and selecting files to open and do other stuff like renaming, deleating, etc.
I've found a control att windowsforms.com called Hypercode FileList and FolderTree, these seams to work but they don't have the xp look automaticly. Maybe they change if i add a manifest as described in some article here on codeproject, but I don't know.
That explains a little more what I'm trying to do and what I'm searching for? =)
Well, Thanks again for all the answers and thoughts!
~~~~~~~~~~~~~~
Martin Lundberg
Student, Sweden
I have to thank every member of the Code Project for making it such a great place for a beginner to learn!
|
|
|
|
|
There is someone here:
C# does Shell, Part 1[^]
abcdabcdabcdabcda
Don't forget, that's Persian Gulf not Arabian gulf!
Murphy: Click Here![^] I'm thirsty like sun, more landless than wind...
|
|
|
|
|
Thanks! =) I will read it through! =)
~~~~~~~~~~~~~~
Martin Lundberg
Student, Sweden
I have to thank every member of the Code Project for making it such a great place for a beginner to learn!
|
|
|
|
|
Hi
I am trying to write an application that makes calls to the crypt32.dll. I have been able to do this with some other functions within this dll, but I am having problems with the CertVerifyRevocation function. Does anybody have any sample code for calling this function from C# code. I have tralled the forums and message boards of many places but have failed to find a concrete example.
Thanks,
Jamie.
|
|
|
|
|
WHy don't you use .net framework classes for cryprtography? Well, if you couldn't find how to use that function , you can write a managed C++ dll and use it in C#.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
While Mazdak's reply (use the System.Security.Cryptography classes) would normally apply, I realize that the current .NET FCL does not include information for cert revocation lists and verify them.
If you need to call functions defined in the crypt32.dll library, you need to P/Invoke them, so a good working knowledge of how types map between unmanaged and managed code (like knowing that an unmanaged LONG is a managed int (System.Int32 ) is necessary.
While the P/Invoke method declaration is easy, there is a heck of a lot of structures to re-declare in managed code, and the marshaller does not support marshalling nested structs, so you're pretty much stuck. As Mazdak recommened, write a mixed-mode MC++ (Managed C++ extensions) that use the native APIs and provide a managed class wrapper - it'll be MUCH easier than the alternative!
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
thanks for your reply.
You are probably correct in saying that using managed C++ extensions would be easier, but I haven't looked at MC++ enough to know that. The problem is that there is already a sizeable part that has already been written (by other people) that uses calls into the crypt32.dll and the amount of effort and time to change the existing code would be much greater than carrying on in this manner, because adding the call to CertVerifyRevocation is the only extension to the current implementation.
What I was looking for were some resources to explain the mapping of types between managed and unmanaged code, and how to manage memory correctly to use the unmanaged functions (IntPtr usage, Marshalling memory etc...)
Thanks.
Jamie.
|
|
|
|
|
A lot of this just comes with experience with both unmanaged and managed languages. You can read Platform Invoke Data Types[^] in the .NET Framework SDK, but you need to read through that whole Interoperating with Unmanaged Code[^] section to really understand it (and experience, again).
Like I said before, the CertVerifyRevocation accepts one struct but this struct, in turn, uses many levels of nested structs, which the marshallers that the CLR implements/uses does not support. One solution would be to flatten the structures, but you must make sure that each struct's cbSize (as it's typically called - just the size of the struct in bytes) is still set so that only that amount of memory is read as the struct.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I want to let the decision tree accepts string varaibles as a target but the problem that the ID3 algorithm only accepts boolean varaibles as a target by default so i want to now how to overcome this problem
Cherif
|
|
|
|
|
Why don't you try the message board on the article, ID3 Decision Tree in C#[^]? I've already tried ponting you toward the solution, but if you have a specific problem with article content then you should ask on that article's message board.
If you've asked this question far too many times and noticed that you haven't always got the reply you wanted, which probably indicates the regulars here that are answering the questions are not familiar with the ID3 decision tree algorithm. If you have a specific problem doing something in C# that doesn't relate to that algorithm, then this is the place to ask.
Finally, I did reply to your email with a simple solution: define the property as a string property. If you need to convert a boolean to a string, then simply use the ToString method. There's also lots of other classes and methods that can help you convert from one to the other and it's all documented in the .NET Framework SDK, like the Convert class.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How can I implement in C# a structure similar to that of Windows Explorer (the tree structure) but using other elements than directories and files.
Thank you in advance for your answer.
Best regards,
Cristina
|
|
|
|
|
cristina_tudor wrote:
How can I implement in C# a structure similar to that of Windows Explorer (the tree structure)
I am assuming you mean a user interface structure (control).
The System.Windows.Forms.TreeView provides this functionality.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
Coming soon: The Second EuroCPian Event
|
|
|
|
|
Hello, Sir and Madam
Please help me design a database for world soccer.
World soccer has many tournaments, teams and players.
One team stay in more than one tournament.
One player can transfer from a team to the other.
Also thinking about red card, yellow card, goal, player position, club team, country team, etc.
Thank You.
Sorry for bad English.
|
|
|
|
|
god4k wrote:
Please help me design a database for world soccer
Is this a homework question???
You should design the initial database yourself. If you are still having problems post a more specific question along with the part of the design that is causing problems and maybe someone will help let you know how to correct any problems.
At the moment, your question is also too vague: "Also thinking about red card, yellow card, goal, player position, club team, country team, etc."
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
Coming soon: The Second EuroCPian Event
|
|
|
|
|
I mean database structure, tables and relations
This is not homework.
Thank You.
|
|
|
|
|
Okay, I realise you mean structure, tables and relations. The number of objects you mention is quite large, also not every one is an expert on football (soccer) so you really need to explain the rules of how each of these objects relate to each other. The explanation will help you understand the relations better your self.
As a starting point:
A team has many players
A team plays in many tournaments
A tournament has many teams
A player can play for many teams (are you including international teams?)
From this small subset we can create a structure like:
+------------+ +------+ +--------+
| |\ /| |\ /| |
| Tournament |-----| Team |-----| Player |
| |/ \| |/ \| |
+------------+ +------+ +--------+
Now, most relational database systems don't accept a many-to-many joins directly so these m2m joins have to be expanded:
+------------+ +----------------+ +------+
| | /| |\ | |
| Tournament |-----| TournamentTeam |-----| Team |
| | \| |/ | |
+------------+ +----------------+ +------+
So the keys on your the above tables are:
Tournament: TournamentID
TournamentTeam: TournamentID, TeamID
Team: TeamID
The TournamentTeam Table contains a composite primary key (i.e. one that is made up of more than one field). It also contains two foreign keys TournamentID to link to the tournament table and TeamID to link to the Team table.
Does this help you get started?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
Coming soon: The Second EuroCPian Event
|
|
|
|
|
|
Hi,
How do I set background color for status bar?
Direct property not available.
Thankx
Priya
|
|
|
|