|
Argghhhhh. This is driving me nuts. I can only get a one way relationship between my dll's due to the circular reference problem. I have Library A which contain most of the object types but Library B is an abstract DB layer. I want to pass the structures from A to B, but because B is referenced by A, I cannot get B to see A.
Does that make any sense? I guess I've got to refactor but have no idea how to get round this problem. I tried creating a seperate DLL called ProjectDataTypes.dll but we fall into the same problem.
All Ideas greatfully recieved
Library A<br />
StructureA1<br />
StructureA2<br />
<br />
Library B<br />
.PopulateWhatever() as StructureA1
Definitely a PEBCAK! (Problem Exists Between Keyboard And Chair) My First ASP.Net site is now up RedRavenRPG
|
|
|
|
|
I assume that your architecture is such that items in Lib A are inherting from items in Lib B? So therefore, A must reference B? You need to change the design such that the only items 'passed back' from A to B are items that are likewise defined in B. If you are trying to achieve a truly generic design, and do not want B to see objects specific to derived implementations, than you need to change from structs to classes where the classes are derived from interfaces (or abstract classes,but preferably interfaces, because you should always program to the interface and not to the implementation in any case). These interfaces would be defined in B, and would be 'passed back' to be used polymorphically as objects of that interface type.
or ...
in B
interface IBData
{
blah,blah, blah....
}
in A
class AData : IBData
{
blah,blah, blah...
}
|
|
|
|
|
I am writing a windows service in C#.NET which will manage image capturing devices, when client connects to the service, at some point the service need to expose a device dialog to the client. According to MSDN docs, classes within the Windows Forms namespace are not supported for use within a Windows service. So How can I do that?
Thanks!
Hang
|
|
|
|
|
hi there ,
i have a C# Form in VS.Net and i am working whit Sql DB now i have datagrid on my Form
i want to see all the orders From date 1 to date 2
Sample :
show me all the orders from : 01/09/05 to 09/09/05
and i all geeting the date and everything is fine.
whan i want to print this report iall get all of the orders beetwen the 2 dates .
i want to see also the dates that i typed in the Form how can i do it ?
in the opper report i want to see it like that
this is the orders beetween 01/09/05 to 09/09/05
how can i pass this dates from the Form to the report ?
thanks aloot....
|
|
|
|
|
My web site is running on Windows 2003 and IIS 6 and I'm facing some problem. In the task manager console, it indicated that w3wp.exe consume the memory approximately 100 MB, this is too high for the web server with 512 MB of RAM. Also, when I query from the database with large amount of records, the memeory usage goes very high and cause other application hang up.I've tried to search from google website but no article directly concern this issue.
Does anyone know how to fix this problem? Does .NET Framework 2.0 fixed this issue and can I disable this process?
|
|
|
|
|
If you load entire database to memory it will consume a lot of memory. Try accsess and search databese without loading into memory
|
|
|
|
|
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++
|
|
|
|
|
|