|
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
Hi , Roger - Compona here.
We draw the caret via code , we dont use the system caret.
the primary reason is that we want to keep the editor itself as clean as possible from win32 api calls , so that it will be as easy as possible to port it to other platforms in the future.
(it uses gdi32 to draw , but the painterclass is replacable so one can easily exchange it to a gdi+ painter or whatever)
regadring decompilation:
our editor is obfuscated so hopfully it will not expose too much of its internals :P
(otherwise we have source licenses for 255 usd per developer that is going to use it.. *grin*)
//Roger
|
|
|
|
|
Sharp develop[^] is a whole IDE written in C# and I believe you can download its source code as well.
"We will thrive in the new environment, leaping across space and time, everywhere and nowhere, like air or radiation, redundant, self-replicating, and always evolving." -unspecified individual
|
|
|
|
|
I need a simple way to get short file name for display. For example, I have full file name C:\Dir1\Samples\Files\Doc\Figures.doc and maximum length 30, and result should be like this: C:\Dir1\...\Doc\Figures.doc.
string s = ShortFileName("C:\\Dir1\\Samples\\Files\\Doc\\Figures.doc");
// s = "C:\Dir1\...\Doc\Figures.doc"
string ShortFileName(string fullName, int maxLen)
{
// ???
}
|
|
|
|
|
Try this:
using System;
using System.Text;
using System.Runtime.InteropServices;
public class PathUtils
{
public const int MAX_PATH = 260;
[DllImport("shlwapi.dll", CharSet = CharSet.Auto)]
private static extern bool PathCompactPathEx(
StringBuilder pszOut, string pszPath,
int cchMax, int reserved);
public static string CompactPath(string path, int maxLen)
{
StringBuilder pszOut = new StringBuilder(MAX_PATH);
if (PathCompactPathEx(pszOut, path, maxLen, 0))
{
return pszOut.ToString();
}
else
{
return path;
}
}
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Thank you very much, works great.
|
|
|
|
|
The problem I have is as follows:
I have a large number of classes (each having different data members, over 300) which I wish to store the member data within a data blob in a SQL DB (Just one data table). The DB table has the class type and a data blob. Upon retriving the data from the table, the class type is viewed to determine which class to address, and then call the class to extract the data blob. In C++ I would have used a memcpy(), is there a good way of creating and extracting the data blobs, or equiverant to memcpy without having to use unmanaged code.
|
|
|
|
|
Are you referring to something like you would get if your classes were [Serializable]? If so, a memory stream might get you where you want to go.
John :D
|
|
|
|
|
Hi!
i want to build custom open dialog (which have extra funtionality of preview of selected file) and should also provide same functionality as standard OpenDialog..but we cant inherit FileOpenDialog.. what should i do? rebuild all that ??
sorry for my bad English.
|
|
|
|
|
i think you will have to rebuild it....or i can give you my old open file dialog..thank you can rebuild/remake.. i never finished it...you will have to do alot of work...but the tree view stuff is done. let me know what if you want it. if so its all yours
The Code Project Is Your Friend...
|
|
|
|
|
if u could send it...i'll be really gratefull..Thanx in advance
|
|
|
|
|
whats your email and ill send it asap
jesse M
The Code Project Is Your Friend...
|
|
|
|
|
I'd like to take a peek at it if I could..
furty74@yahoo.com
|
|
|
|
|
I wanted to find out the total bytes sent out by IIS virtual website. there are performance counter support in c#
like System.Diagnostics.PerformanceCounter
which works fine. But the problem is, if that site is restarted (directly of by iisreset or a machine reboot) the counters are reset to zero. Is there a way to cacth an event that the counter is reset to zero and read the value just before it was reset to zero?
Swarup Das
|
|
|
|
|
Couldn't you just remember the last value you got? Then when the counter comes back as zero, you can substitute the last value which you have stored already.
John :D
|
|
|
|
|
Yess, but its not a perfect solution. lemme explain why
say the counter was 200 when I sampled the value and stored it. Then the counter was increased to 250 and suddenly reset to zero. and then it grew to 100 before the next sampling happens. So I have lost 250-200 = 50 bytes.
Unless its event driven, I have to sample it at regular interval. And all the ups and downs withing my sampling window are not trapped. WMI is a resource consuming thing and not advisible to run it frequently.
Probably I can do away with the missing values withing the sampling window but is there a perfect solution? Instead of sampling If I am notified when the counter is reset to zero with the value it had just before it was reset, that will be the best possible solution. What do u think ?
Swarup Das
|
|
|
|
|
I'm not sure what exactly you're trying to do. You can use a performance counter at a relatively small interval (every 1 or 2 seconds), which will likely avoid your missing bytes problem. In fact, that's exactly what the performance monitor app which comes with Windows will do. Yes, these are related to WMI, but I don't see any significant resources being used with a single performance counter.
I don't know of an event that will give you what you want, but if the neither the WMI docs nor the IIS docs describe such an item, it's probably not there.
John :D
|
|
|
|
|
May I ask if anyone got the experience on creating skinable or non-regular form with C#?
|
|
|
|
|
I have ...
im creating a form skinner right now.
it works quite good , im overriding the wm_ncpaint (and other related messages) to draw the form border and caption.
currently im using gdi+ but will upgrade it to old gdi32 since gdi+ is horribly slow..
the stuff i have left to do is:
make it work 100% with mdi forms...
make it use layered windows for transparency instead of regions.
make it draw the attatched menu (the menu is otherwise drawn at the default location ,which might be inside the caption if using a larger caption than normal)
//Roger
|
|
|
|
|
Paste the code!
Thanks,
Orlanda
|
|
|
|
|
is it possible to get the name of each Component created in my form and intialized from a System.ComponentModel.Container. I created a console app for my program that runs through command line args...i want to dump the names of each component on the form (the code name for the component) to this console. possible via a foreach statement. Please write me back in reguards. i can always go through and just write the names manually but it would be easyer if i could do it with a foreach statement... thanks alot
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
It sounds like all you need is to do something like this:
foreach(object o in container)
{
string itemTypeName = o.GetType().ToString();
}
John :D
|
|
|
|
|
i just recently got a loan finally for school and im starting some MCSD classes here in washington for a hopefull good start in C# and programming. after im done with this schooling they set you up with a job and such. but my question is what do i do after i get my MCSD ? where else do i go for schooling.. how can i be competive in the Software Development field.. i know alot of people in this class are all from C++ backgrounds...not me though i never wrote more then a Hello world app in C++ but in C# i have reflection and just about everything i can think of i can do (if i cant... leppie is here too help me ).....can i still be competive in this field even without knowing much about C++ ? thanks for your time
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
jtmtv18 wrote:
my question is what do i do after i get my MCSD ?
Learn to program ? MCSD classes are likely to be somewhat of a waste of money IMO. You should buy some books, lock yourself in your room, and learn.
jtmtv18 wrote:
how can i be competive in the Software Development field..
I started teaching myself C++ at home and had a job in six months, three years ago. So I'm all for teaching yourself and working hard.
jtmtv18 wrote:
can i still be competive in this field even without knowing much about C++ ?
It seems obvious to say this, but unless the job is C++, why would you need to know C++ ? For all that, I'm teaching myself J2EE at the moment, you can't know too many languages/frameworks. I do all ASP.NET at work.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
yeah i started teaching myself C# about 6 months ago when i got in my motorcycle accident..(ouch) i love it. but im only 19 so i figured....having a MCSD would help me out more..and let me be taken more seriously... i mean hell i was a cook before my accident...i new macromedia and javascript lol.... but my passion is programing. and when i look at C++ it seems to look easyer to me now after C#. As far as books...my first book was Sams Teach yorself C# in 21 days... it was a awesome book and i totally recommend it to anyone. it was 1300 pages of C# goodness from forms to reflection too xml...but it was nice cause it went at a slow pace....(good for the begining programmer) anyways why do you feel mcsd is a waste of time? what other routes can a 19 year old do to be taken seriously in this lion eat lion field
The Code Project Is Your Friend...
|
|
|
|