|
Wow, thanks James
I tried out your sample just now and its pretty cool. I'm probably not going to use it though because I want to keep the controls on the same form BUT if the screen painting turns out to be a hassle I’ll definitely come back to your solution.
|
|
|
|
|
Hi all,
I was wondering if there is an attribute that can be applied to a class/struct that tells the compiler not to compile it?
Thanx
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Am I missing something? Could you explain your situation a bit more?
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
I mean it must have some functionality e.g. lets call it an IncompleteAttribute (maybe NotImplementedAttribute) that one would be able to apply to a class/struct (what about maethods and properties) , so when one compile the project that those classes/structs doesnot get compiled.
This would be neat especcially working on a library of classes when certian classes might not be working as it should or the structure has just been put in place. Hey, even class status for example, like WorkingButWithErrors, etc.
I hope you understand a better.
PS: If there is not such an Attribute, would it be difficult to do?
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
There aren't any attributes to stop code from getting compiled, because attributes don't play a part until code execution (except for attributes that the compiler looks for, but this is after the code has been compiled but before the assembly is created).
So you are left with commenting out or #if/#endif
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
|
I hear this works fine:
<br />
class MyClass<br />
{<br />
//Insert methods here<br />
}<br />
*/
David Stone
It seemed similar to someone saying, "Would you like to meet my knife collection?"
Ryan Johnston on Elaine's sig
|
|
|
|
|
Hey leppie,
Did you try the following compiler directive?
#if(false)
.... Your Class
#endif
(But David's solution is easier to type);)
This will keep the compiler from even seeing your class. (But is this what you want to do?) Perhaps what you want is a forward reference? What is your situation?
|
|
|
|
|
Ahhh, mite just be what im looking for Re David solution: I prefer the colors although it works just as well
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
if you are using vstudio, and you are being a good boy and putting each class in its own file... then you can change the "Build Action" property of the file to "None".
|
|
|
|
|
|
Hi
Is there anyone that can help me to better understand what's going on "under the hood" when subclassing a Control (System.Windows.Forms), and overriding the CreateParams property and setting the ClassName of it to, for example, a custom control, say Toolbar (Win32 real name ofcourse). How does my subclass relate to the native Toolbar control that is created? And how do I properly use WinProc (when to call base.WinProc etc) and/or DefWinProc for my subclass. Another thing I don't really grasp is how the message-flow is between my Control-subclass, and the actual TB (notifications from the TB for ex, do I receive them, and how?).
I guess what happens is that the new control (my subclass) becomes a superclass of the native Toolbar (receiving the messages destinated for the native TB before it self does) but I can figure out what base.WinProc/base.DefWinProc relates to respecivly.
Any help on any of theese topics are VERY apprechiated, may it be pointers to documentation, book suggestions, or any other kind of rescoruce.
Thanx a lot!!
/psatvz
per.samuelsson@visionizer.se
|
|
|
|
|
psatvz wrote:
how do I properly use WinProc (when to call base.WinProc etc) and/or DefWinProc
This seems to be Win API related, you might be better off posting in the Visual C++ forum, than here in the C# forum.
Soliant | email
"The whole of science is nothing more than a refinement of everyday thinking." -Albert E.
|
|
|
|
|
hi all
why does VS scream at me for this?
public byte Panning
{
set
{
byte con = value;
if (con > 127) con = byte.MaxValue - con;
else con = Convert.ToByte(128) - con;
...
Im not even using int's , so WTF is going on??????
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
|
not lame - this is what type safe and all the new features of C# is all about - if you convert an int to a byte then you could lose information - by forcing you to cast - you are declaring to the compiler thet you understand the consequences and except that this may happen.
Stupidity dies.
The end of future offspring.
Evolution wins.
- A Darwin Awards Haiku
|
|
|
|
|
Look at the code more carefully, you'll see that ints aren't involved at all. If I had to fathom a guess somewhere ints are getting involved when compiling and that is why the errors are getting thrown up (byte +/- byte should be byte)
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
Eventually what i wanted to do was solved by changing the value of the proterty to sbyte instead of byte and removing the 2 bad lines.
The question i have is, how does the conversion between a signed and an unsigned integer take place when the value is "out of bounds" ?
Eg.:
byte b = 200;
sbyte sb = (sbyte) b;
I remember something from java and some c++ books about the "remainder" gets added starting from the minvalue. The sample would print -55 .
Is that correct? I cant seem to find any mention to this in MSDN
Cheers
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
ah but what about the '-' operator I suspect because it cannot hold the result correctly it moved up to a type that could ie int - I do wish I could see all the operators in C# and loot at their definitions - the msdn is not very good at that.
Stupidity dies.
The end of future offspring.
Evolution wins.
- A Darwin Awards Haiku
|
|
|
|
|
Let me describe the requirements..
There is a Windows 2000 server machine... and i want to perform windows integrated authentication.
Will I be able to receive a username , password , logon domain name from a user and be able to authenticate the user under the workgroup server.
ASP.NET provides authentication using <authentication> and the authentication type can be specified as "WINDOWS".
But , can the same be done using WindowsForms. C++ provides LogonUser() Method which takes the username , domainame and password , the authentication type ,the authentication level and a "token" , which i used as an assmebly.
<br />
public static extern bool LogonUser(String lpszUsername, String lpszDomain, String lpszPassword,int dwLogonType, int dwLogonProvider, out int phToken);<br />
Can a user Windowsidentity be created just from the username and password ?
When i tried using logonuser() i get errors because the usertoken is not known and i cannot be zero.
<br />
bool loggedOn = LogonUser(<br />
textBox1.Text.ToString(),<br />
".",<br />
textBox2.Text.ToString(),<br />
3,<br />
0,<br />
out token1);<br />
A workgroup server can have a lot of servers in the domain and each server machine can have numerous users inside the each server. Is there a suitable way to solve this issue ?
If the problem definition is not clear ,I can restate the problem ..
thanx in advance.
Ragavendran Vaidhyanadhan
|
|
|
|
|
I would love to help you with your problem, but to my disappointment I can't. In fact not many people know about this kind of stuff, because they never thought about using it.
Here's something you can try : Go to http://msdn.microsoft.com/newsgroups[^]
The microsoft newsgroups - have more professionals that work in very narrow feilds (ie. NTLM authentication). So far I always had good luck, and got my questions answered.
|
|
|
|
|
Hi
Thanx a bunch AK . I'll try doing that....
Ragavendran Vaidhyanadhan
|
|
|
|
|
I have been following the various control smaples here on CP and have been learning alot, but my question here is, can these control be used on an aspx page?
I assume that the control would need to be built specifically to know how to render itself onto the web page, or is that something that the web engine figures out an takes care of?
Might be a cool next article? Anyone?
Boton line is this I guess... What makes a control able to be used on a winform and a webform?
|
|
|
|
|
Ray Cassick wrote:
What makes a control able to be used on a winform and a webform?
Controls that are usable on a winform have System.Windows.Forms.Control somewhere in the inheritence chain, where as controls that are usable on a webform have System.Web.UI.Control somewhere in the inheritence chain.
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
I really love CodeProject's message boards because you can get the answer so fast. Thanks guys!!
Todays question:
I have an xml document that looks some what like this:
<en-US word:'hello'>hello</en-US>
<fr word:'hello'>sfddsf</fr>>
<ru word:'hello'>privet</ru>
Or something like this:
<User ID:'0'>Joe</User>
<User ID:'1'>Jim</User>>
<User ID:'2'>Someone</User>
How would I go about quickly find the element, that has an attribute(ie. "word"), with a certain value (ie. "Hello")?
The whole point : I need to search based on a value of an attribute.
Please help me out.
|
|
|
|