|
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.
|
|
|
|
|
Something like
Doc.selectSingleNode("User[@ID='0']")
SHOULD return the Joe node above. @ is how you specify an attribute in XPath.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
|
Hey Nnamdi,
I took a quick look and I did not see anything that would directly help. (I think we are all finding out that there is a lot missing in C#.)
But an idea did occur to me, a few threads down you talk about intercepting messages in the WndProc method. You might want to try manually sending a message of your own to force it to do a scroll.
|
|
|
|
|
|
How to pass arguments to a thread?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Rickard,
Do you mean before you start it or after its running?
|
|
|
|
|
I have seen James post now, but thank you for your time!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
It depends on how you create your thread.
The "easy" way is to create a delegate matching the method signature and call the delegate with BeginInvoke. This will cause the delegates method to run in a thread pool thread and you get to pass your parameters in. This is a 'fire and forget' method though; so you don't get access to the underlying Thread object in your main code.
The "hard" way is to create a class specifically for the thread, with the parameters passed in to the constructor or set as properties. The thread's run method is then made public so that it can be started via the ThreadStart delegate. This method gives you far more control over the thread itself; including being able to work on the underlying Thread object.
Remember above all else, if you are modifying the GUI in someway from any thread you absolutely must use the GUI object's Invoke or BeginInvoke/EndInvoke methods to do anything to the GUI object itself. Not doing so is baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaad mojo and will eventually break. All GUI object's expose an InvokeRequired property which tells you whether or not you have to call Invoke or BeginInvoke/EndInvoke. Look in the articles I've done for a sample of doing this.
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
James T. Johnson wrote:
The "hard" way is to create a class specifically for the thread, with the parameters passed in to the constructor or set as properties. The thread's run method is then made public so that it can be started via the ThreadStart delegate. This method gives you far more control over the thread itself; including being able to work on the underlying Thread object.
Aah!
This sounds very cool!
You don'y know an article somehere on this topic?
I will check CP now...
Thank you!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
|
Wow Nish!
Thank you! It really helpt me!!
Are you doing everything in MC++ when programming for the .NET platform!?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I need to draw a rectangle to the screen and then be able to remove it. I would like to have it filled with white but FillReversibleRectangle doesn't seem to allow it (at least not over the standard gray form background). Is there a way around this problem?
Thanks
|
|
|
|