|
I would like to try and write my own obfuscator,
anyone know where can i find some articles and
technical documentation?
|
|
|
|
|
Here's how I draw it:
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
Graphics g=e.Graphics;
g.SmoothingMode=SmoothingMode.AntiAlias;
GraphicsPath gp=new GraphicsPath();
int border=5;
int x=0;
int y=0;
int w=this.Width;
int h=this.Height;
int r=10;
int d=r*2;
Point lp1= new Point(x+r,y);
Point lp2= new Point(x+w-r,y);
Point lp3= new Point(x+w,y+r);
Point lp4= new Point(x+w,y+h-r);
Point lp5= new Point(x+w-r,y+h);
Point lp6= new Point(x+r,y+h);
Point lp7= new Point(x,y+h-r);
Point lp8= new Point(x,y+r);
Rectangle ar1= new Rectangle(x,y,d,d);
Rectangle ar2= new Rectangle(x+w-d,y,d,d);
Rectangle ar3= new Rectangle(x+w-d,y+h-d,d,d);
Rectangle ar4= new Rectangle(x,y+h-d,d,d);
Pen p=new Pen(Brushes.Black,border);
SolidBrush b=new SolidBrush(System.Drawing.Color.Wheat);
gp.AddArc(ar1,180,90);
gp.AddLine(lp1,lp2);
gp.AddArc(ar2,270,90);
gp.AddLine(lp3,lp4);
gp.AddArc(ar3,0,90);
gp.AddLine(lp5,lp6);
gp.AddArc(ar4,90,90);
gp.AddLine(lp7,lp8);
g.DrawPath(p,gp);
this.Region=new Region(gp);
x=0;
y=0;
w=this.Width;
h=this.Height;
lp1= new Point(x+r,y);
lp2= new Point(x+w-r,y);
lp3= new Point(x+w,y+r);
lp4= new Point(x+w,y+h-r);
lp5= new Point(x+w-r,y+h);
lp6= new Point(x+r,y+h);
lp7= new Point(x,y+h-r);
lp8= new Point(x,y+r);
ar1= new Rectangle(x,y,d,d);
ar2= new Rectangle(x+w-d,y,d,d);
ar3= new Rectangle(x+w-d,y+h-d,d,d);
ar4= new Rectangle(x,y+h-d,d,d);
g.DrawArc(p,ar1,180,90);
g.DrawLine(p,lp1,lp2);
g.DrawArc(p,ar2,270,90);
g.DrawLine(p,lp3,lp4);
g.DrawArc(p,ar3,0,90);
g.DrawLine(p,lp5,lp6);
g.DrawArc(p,ar4,90,90);
g.DrawLine(p,lp7,lp8);
this.BackColor=Color.Wheat;
g.Dispose();
}
And here's what problems I stumbled upon:
1. can't antialias button edges
2. border contour is shifted in bottom-right direction... and looks like it not being fully displayed (most visible on thin borders (~1-2px)
well... that's it by now, I guess
Many thanks in advance for any help!
|
|
|
|
|
Want to know if any one can help me to how can I start building my .speech enabled apps with NET Framework using VB.NET or C#.NET.
Code Paras
|
|
|
|
|
contact me on soft_shivmangal@yahoo.co.in
xyz
|
|
|
|
|
I have a question thats been puzzling me for quite a while... * deep breath *
I understand that the operating system (windows) detects when a 'core' event happens etc.. the user clicks a mouse button, what i was wondering is how the framework translates this into a .net framework event.. such as Click. Ive reflected System.Windows.Forms but furthest i can get to (that seem relavent are the declarations 'private static readonly object EventClick;' and 'internal const int STATE_MOUSEPRESSED = 0x8000000;' and thats it.. what happens in the gap betwee windows detecting a click and this event coming to life
Thanks,
Matt
-- modified at 18:11 Tuesday 6th September, 2005
|
|
|
|
|
ANy framework, be it MFC or .NET, at the end of the day, HAS to come down to a message pump that recieves and redirects events. That's how windows works. You've gone as far as you can with reflection, which means you've gone down as far as is written in .NET. The core is probably written in Win32 ( because why use a framework to build a framework ? )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am having problems running a C# application which uses mschart 6.0 on
machines with just .NET Framework installed.
If I run this application on a machine with the full Visual Studio .NET 7.0
installed then it runs just fine.
My application is very simple, I have a form and added the mschart 6.0 (an
activeX control) onto the form without
any code changes. I then compiled the project and copied the following
files to a machine with just .NET Framework installed:
- the generated exectuable
- AxInterop.MSChart20Lib.dll
- Interop.MSChart20Lib.dll
Once I run the generated executable I am getting the following error:
"Application has generated an exception that could not be handled.
Process id=0x960(2400), Thread id=0x504(1284)"
I even went as far as creating a dialog application in Visual C++ 6.0 and
added the same mschart object on the dialog.
This app runs just fine on the same machine with just .NET Framework
installed which proves that the ActiveX control
was registered correctly.
I have also confirmed that this problem exists only for the mschart activeX
control. I created another
C# form and added other ActiveX Control such as DateTimePicker and it worked
just fine on the machine with just
.NET Framework installed.
Any help is greatly appreciated.
|
|
|
|
|
|
I've configured several COM components to support transactions, and they are called by my C# serviced component, which is configured to require a new transaction.
However my component fails on the first COM call, with an error saying that the new transaction could not enlist in the specified transaction coordinator.
I'm new to this, any help would be appreciated.
The DJ's took pills to stay awakwe and play for seven days. - Jim Morrison, Black Polished Chrome.
|
|
|
|
|
|
Yes.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
How can I add a column dynamically to a datagrid in Winforms.
Thanks,
RP
|
|
|
|
|
|
I'm starting to seriously consider the possibility that you wrote this book and are trying to promote it with this non-question day after day.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I have attempted to connect via remote registry (RegistryKey.OpenRemoteBaseKey) to ~400 computers in our organization's intranet. Although I am doing my best to free resources (even call GC.Collect manually), I notice a Thread & System resources handles leak which hangs my system after ~350 computers.
Is anyone aware of such a problem / known issue in .NET (v1.1) ?
Thanks in advance,
I. Chen
|
|
|
|
|
There is no known leak like that. It's common to miss Disposing various objects though.
You should also not be calling GC.Collect yourself unless you know precisely why your doing it and what the consequences are. Since the GC is self tuning, forcing it to run can cause the GC to not maintain managed resources efficiently and actually slow down your app.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i.chen wrote:
even call GC.Collect manually
This is almost certainly hurting performance. Make sure you make use of the using keyword in C#, or if you're in VB.NET, just make sure you dispose of all your objects, like Dave said.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
hey people do you have developed ASPNET Online TV & Radio Example?
My Finding language:Visual Basic.NET & C#.net ASPNET & .NET Framework & Windows Application
I need Your Help Quickly
Ahmed Erarslan
MCAD,MCDBA,MCP
MCSD.NET
|
|
|
|
|
Well, after 19 years working with the various generations of FoxPro, and watching it languish under Gates' "stewardship", I decided I should get with it and begin developing with the .Net tools. So I ponied up my hundreds and eagerly sat down, expecting to be thrilled with the latest technologies.
Within the first week, I found that the so-called Data Adapter "Wizard" not only fails but corrupts my forms so badly that I need an intermediate level of knowledge to repair them.
Then, I find that a simple hot-key combination for on onscreen "Save" button causes a loss of the latest edited row.
Then, it turns out that putting a combobox in a grid requires creating a special (and for me, sophisticated) object. VFP has supported this for nearly 10 years now.
Now, I am unable to find any easy way to have SQL Server's default field values written to new records added on my grids.
And so, with a disappointment bordering on disgust, I find myself again wondering why all Bill's Billions cannot create a development environment with rudimentary functionality.
My question is:
Is .Net really a step up from other IDEs, or am I going to find myself having to rig up countless unforseen kludges to create a streamlined, user-friendly app?
Take Care,
Karl
Take Care,
Karl Kaiser
|
|
|
|
|
It depends on what the IDE is designed to achieve. The VFP IDE obviously had to achieve more on the data binding front, while Visual Studio and the .NET Framework are more generic as they have to work with a more diverse set of intended applications.
I'm sure that .NET is capable of doing everything that you want, it just takes a bit more effort in some areas. For my self, coming from a C++ background .NET and C# are a leap forward, but then I was following through from previous versions of Visual Studio, not crossing from a different product.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
KaiserKarl wrote:
Is .Net really a step up from other IDEs, or am I going to find myself having to rig up countless unforseen kludges to create a streamlined, user-friendly app?
The latest versions of Visual Studio are a big step-up from previous versions. Where as FoxPro provided a data-centric interface as it was always a data-based tool. Visual Studio has a far larger remit and so doesn't currently have the tools that we take for granted in FoxPro. We still have to write code or use 3rd party tools.
Visual Studio 2005 is a big improvment over 2003 (IMO) and the next version after that promises to address some of the database issues.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
KaiserKarl wrote:
after 19 years working with the various generations of FoxPro,
It sounds to me like you've locked yourself into a product that, right or wrong, was bought by Microsoft for the express purpose of killing it. I'm sure that there are issues like the ones you describe which would frustrate me in Foxpro, but which you take for granted because you've learned them over time.
KaiserKarl wrote:
Within the first week, I found that the so-called Data Adapter "Wizard" not only fails but corrupts my forms so badly that I need an intermediate level of knowledge to repair them.
Personally, I avoid all wizards, and take the time to learn how to write my own code.
KaiserKarl wrote:
Then, I find that a simple hot-key combination for on onscreen "Save" button causes a loss of the latest edited row.
Edited row ? Are you using SQL Server, or VS.NET ? You shouldn't use VS.NET to edit your database, no matter what tools it seems to provide. That's what Enterprise Manager and Query Analyser are for.
KaiserKarl wrote:
Then, it turns out that putting a combobox in a grid requires creating a special (and for me, sophisticated) object. VFP has supported this for nearly 10 years now.
I'm sure Access does to. In fact, I know it does. However, the .NET framework is relatively young, and grids don't exist at all in the underlying Windows control library. You're just experiencing initial learning curve, it's not really that complex. In any case, this website has a lot of example code you could download for this sort of thing.
KaiserKarl wrote:
Now, I am unable to find any easy way to have SQL Server's default field values written to new records added on my grids.
You have an app with a datagrid, and you want to see the default values appear when you create a new record ? Just create a new record and redatabind, they should appear, no problems.
KaiserKarl wrote:
Is .Net really a step up from other IDEs, or am I going to find myself having to rig up countless unforseen kludges to create a streamlined, user-friendly app?
VS.NEt 2003 is a small step from 2002, which was itself a major step at the time. I'd say VS2005 is another major step forward in many ways. The only thing is, you're experiencing an initial learning curve, after 19 years in the one comfort zone. Stick with it, you'll be fine.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks for taking the time to write, Christian (and y'others). I didn't expect specific answers, but just an overall sense of how much work I am getting into here. Frankly, in my pompous opinion, over 20 years after the PC revolution, that a developer would have to hand-code basic UI processes for a data maintenance app (including combo-boxes in grids) points to a glaring failure of craftsmanship at MicroSoft (maybe they don't have the funds?!).
Here are some specific responses to Christian, with one question at the end.
It sounds to me like you've locked yourself into a product that, right or wrong, was bought by Microsoft for the express purpose of killing it.
It seems to me in recent years that MS did not want to extend or even adapt VFP, but to let it slowly starve and hope the developers would stick with MS anyway. While I may be "locked in" as you say, it wasn't me who did the locking!
FWIW, I once entered my product in an MS-sponsered competition and, while the judges thought it to be potentially the best app in its class, the word was they would not (could not?) award a VFP-based product.
Personally, I avoid all wizards, and take the time to learn how to write my own code.
Well, if you've got the time to take, then good for you. In any case, one would hope that any so-called Wizards would actually be useful and at the least, not destructive, that is, "Wizards" in the Gandalf vein, not the Saruman vein.
Then, I find that a simple hot-key combination for on onscreen "Save" button causes a loss of the latest edited row.
...Edited row ?
Very simple: create a basic windows app with a DataConnector-DataAdapter-DataSet cx to SQL server (as described in the documentation) and a datagrid. Put in a "Save" button to call the Adapter's "Update" method. Run the app and create a record and press the button. Everything works fine.
Now, change the button text to implement a hotkey (ala "&Save"). Now, go edit a record, and, without leaving the record, press the hotkey sequence. The Update method is triggered but no data is written over and no error returned.
I don't want to get too dramatic, but to me this is a ghastly failure in such a presumably sophisticated product.
You have an app with a datagrid, and you want to see the default values appear when you create a new record ? Just create a new record and redatabind, they should appear, no problems.
I'm not sure what you mean here. Are you suggesting that I first insert the record at the database and then select it out to the client in order to populate the defaults (I hope not!).
Otherwise, it does seem that the upcoming VS .Net 2005 has some useful features, like native support for a combobox in a grid, that will help get me over the hump.
Thanks,
Karl
Take Care,
Karl Kaiser
|
|
|
|
|