|
oh!
i found that page editing the unsafe options
thanks!
|
|
|
|
|
hi,
your class is faster than framework's Bitmap class but i found that Christ's method still much much much faster...
i did greyscale for 1600x1200 image with 20s. but, christian's application used less than 1s .
just a little report. i will check the code to find the reason of this.
|
|
|
|
|
Yes, this is an old story... fight between ease of programmer and the performance. You get best possible speed when you write code in assembly. But you can't write big programs in it. Since machines are faster now, so we compromise performance on ease.
Anyway, thank for telling me
Good Day;
mE
---------------------
A gasp of breath,
A sudden death:
The tale begun.
A rustled page
Passes an age:
The tale is done.
|
|
|
|
|
Hi there,
my problem is, that i have to create web references to 10 different servers (i only got there ip) at Runtime. On all of theses servers are running the same web services (i now the name of the provided services). How can i do that? Is there a class where i can create the wsdl, disco, etc. files or do i have to generate them manually?
If i can create the web references, how do the client knows, how to call the web services? (I can't use the "using"-statement, because at compilation the web references aren't created.
I appreciate any help you can give me
Thanks
Sven
|
|
|
|
|
|
|
Hi!
I've developed some c# app which uses some external libraries such as magic (docking manager) and crystal reports. The app works fine, so I wanted to create setup program for it. I've added msi setup project to my solution and pointed external merge modules such as crystal licensing etc. When I try to build my setup, there is an error thrown during msi file creation:
ERROR: Could not find file 'G:\DOCUME~1\hgs\USTAWI~1\Temp\VSDB.tmp\reportengine.A95D0BB4_0582_442D_B456_D295EAEB7628\Program Files\Common Files\Crystal Decisions\2.0\bin\crxf_html_res_en.dll' 'Interface is not registered.'
The file crxf* is included in msm files, so why the compiler needs it at external location?
When I decided to remove crystal libraries (for testing purposes), similar error was thrown on Magic.dll which is pointed directly in project references. When I've excluded all of dependent libraries, the error thrown was:
ERROR: Could not find file 'E:\praca\23.09\17.30\WindowsApplication21\obj\Release\WindowsApplication21.exe' ''Interface is not registered.'
WindowsApplication21.exe is my project output file.
What is going wrong?
Did I miss something?
thanks
h.
|
|
|
|
|
is it possible to tell if a socket is already bound ..or in listening state ?
Thanks for your time.
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
Hi!
Naive question 101: what is the easier method (not necesarily the most performant) to blit a System.Drawing.Image into a DirectDraw.Surface?
Thanks in advance,
--
Ralf
|
|
|
|
|
Wouldn't something like this work?
(assuming surface is 'mySurface' and Image is 'myImage')
System.IntPtr pDC = mySurface.GetDC();
Graphics g = Graphics.FromHdc( pDC );
g.DrawImage( myImage, ..... );
g.ReleaseHdc( pDC );
The key is to remember to release the Device Context, or else you'll leak resources.
Let me know if this works (not in front of Studio at the moment)
Jeremy Kimball
|
|
|
|
|
Thanks, I'm going to try this approach too.
In the meantime, I found out that a DirectDraw.Surface can be created directly out of a Bitmap:
SurfaceDescription desc = new SurfaceDescription();
desc.SurfaceCaps.OffScreenPlain = true;
desc.Width = width;
desc.Height = height;
Surface surf = new Surface(bitmap, desc, localDevice);
It's then easy to use Surface.Draw to blit the surface into another.
Your method would let me reuse the same surface always though, so it seems better.
Regards
--
Ralf
|
|
|
|
|
hi,
i want my richtextbox scroll down to show the bottom text after i appended a new text in it automatically.
i did sth similar in VC++ ListBox with SetTopIndex().
would anyone give me some idea how to do it in C# 's RichTextBox control?
thanks,
jim
|
|
|
|
|
i had the same problem before to jim..but i was able to overcome it with something like...
<br />
<br />
public void AppendText(string Message)<br />
{<br />
if(this.TextArea.Text!=null)<br />
this.TextArea.Text +=Message+System.Environment.NewLine;<br />
else<br />
this.TextArea.Text = Message+System.Environment.NewLine;<br />
this.TextArea.Select();<br />
this.TextArea.Select(TextArea.Text.Length-1,TextArea.Text.Length);<br />
this.TextArea.ScrollToCaret();<br />
}<br />
that should fix it.....as always..im sure there might be a better way..but it seemed to work for me.
The Code Project Is Your Friend...
|
|
|
|
|
Set the caret position to the end of the text, and use the ScrollToCaret() method to scroll to the caret position. Be sure to have HideSelection set to false, or it won't work. (I don't know how many times people have asked about why ScrollToCaret doesn't work, when they have HideSelection on! )
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
|
I am a newbie at design, and I've been studying design patterns but I can't figure what to do in this case.
I have a security object that has properties for a list of fields that also happen to be the properties of another object.
class security {
//"true" value for each property means yes, user has permission to access these fields in client
bool ssNumber;
bool hourlyRate;
bool dateOfBirth;
//getters and setters, functions to pull data from database, etc.
}
class empInfo {
string ssNumber;
decimal hourlyRate;
DateTime dateOfBirth;
//getters and setters, functions to pull data from database, etc.
}
I need empInfo to be aware as to which of its properties are considered permissible for access by a particular user.
What would be the best way to tell if a particular property in empInfo is allowed access by the user?
Should empInfo be extended to include security class and then when empInfo is instantiated and populated, grab security data then?
Since each field represents a datacolumn on the web, I would like to keep as much data manipulation in the middle tier as possible.
Thanks in advance!
|
|
|
|
|
What do you think of this (pseudocode)?:
class empInfo {
string ssNumber;
decimal hourlyRate;
DateTime dateOfBirth;
securitySetter(empInfo) {
securityCollection = security.getSecurity(empInfo);
foreach (property prop in empInfo)
{
foreach {securityItem sItem in securityCollection)
{
if (sItem.access(prop))
{
set.prop = "Not accessible";
}
}
}
return empInfo
}
}
----
I'm concerned about handling the database calls, since building the securityCollection requires a trip to the database, then building the empInfo object requires a trip to the database. Or maybe this cannot be avoided. Cacheing security information for objects would also be memory intensive?
Oh, and important...how can I do this so that ALL empInfo objects in a collection are taken care of for a particular session at one time, without having to re-set for each instantiation?
Any advice is appreciated.
|
|
|
|
|
How do you do that? In C, I would have done something like:
FileAttributes &= ~ReadOnly;
How do I do that in C#?
|
|
|
|
|
|
I want to retain all its previous attributes. Will calling SetAttributes() append this new flag or will it clear all the old ones and set this one?
|
|
|
|
|
This will preserve the old attributes
File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.ReadOnly);
|
|
|
|
|
|
I have a window form that contains a textbox. I've hooked into the Validating event of the text box to check that the text is valid and prevent the textbox from lossing focus until valid text is typed. The problem is that if the user clicks a button on the toolbar it completely avoids this validation and this allows the user to get away with invalid input. Is there anyway to prevent this from happening?
|
|
|
|
|
yeah, when user click the button it will generate the required event. so you need to do error checking(validation) in the click event method of the button too.
|
|
|
|
|
So I have to repeat the validation of ALL the controls on my forms when somebody clicks on the toolbar? I'm starting to think the toolbar might not be worth the effort!
|
|
|
|