|
I had actually found source similiar to the one you posted about giving full control and have implemented that. I'm guessing that my years object that my remote server object is returning needs the marshalbyrefobj... I plan on modifying it. I will try it tonight and post back if I have problems.
Thanks for the post!
|
|
|
|
|
I don't remember much about what I studied about remoting but here's something to start with. Are you serializing the class? Like:
[Serializable]
public class myClass
{
...
}
|
|
|
|
|
What do you mean "bombs out"? Any object being passed around remoting must be derived from MarshalByRefObject because it must cross application boundries.
If you can actually give an exception object or the exception method that would be helpful.
Also a pitfall almost everyone new to .Net Remoting (as well as any other remote procedure framework) is that since objects live in two different application domains they aren't exactly equal. It is even warned in the MSDN documentatino:
<br />
Types must inherit from MarshalByRefObject when the type is used across application domain boundaries, and the state of the object must not be copied because the members of the object are not usable outside the application domain where they were created.<br />
So if your server twiddles the value of the object passed to it, those values are lost to the client upon leaving the method.
|
|
|
|
|
Heres an update...
I made all my data objects use MarshalByRefObject. What I meant by "bombs out" was that my application was causing an error that wasn't an exception in .net... it was generating a windows error... but I fixed that.
I now have this up and running and it works good. Heres a small example of what I'm doing. I'm building a race management software suite ( backend, web admin, public web, admin winform ). I wanted all to be able to use the same backend so I thought I would use .Net Remoting to provide a service for the other three to use to access the data from the db.
Thanks for the help.
Bryan
|
|
|
|
|
Dear, Sir and Madam
When I set SelectedObject property of PropertyGrid to DataTable and click ellipses button to modify Coloumns property of DataTable
the "DataColumn Collection Editor" appear. But Add and Remove button of this dialog is disabled Is it possible to Enabled them to allow user add and remove via this dialog
Sorry for bad English.
Thank You.
|
|
|
|
|
I assume you're doing this at runtime. There are a number of designer interfaces - like IWindowsFormsEditorService - that you need to provide by the container (whatever is hosting the DataGrid ), as well as implement ISite and set that on the child controls.
The design-time environment is much different from the runtime environment, and in the design environment the IDE (VS.NET, #develop, whatever) provides these services to make TypeConverter s and UITypeEditor s (among other things) possible.
Read-up on the design-time model in the .NET Framework SDK. There's a lot you need to know and understand.
Besides, another reason - most likely the problem - is that the Add and Remove buttons are disabled because the designer cannot serialize to source - there is no source since you're running a compiled executable.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I would like to allow my users the opportunity to update changes on a control in a particular tab when they try to leave. To do this I use the user control thats loaded into the tab's Validating event (Catching the event in the tabbedcontrol itself will not find the changes). The event is caught and a dialog box is fired off to ask whether or not theyd like to leave.
Problem 1: the Validating event is fired twice when a user tries to leave the tab.
Problem 2: the call to e.cancel = true gets enforced not on the two times when its leaving, but rather when the tab is getting the focus once again, ie the cancel call doesnt do anything until you leave the tab and then try and come back.
Any suggetions?
Thank You
Robert
|
|
|
|
|
yeah so this absolutely does not work
// In C#
private void tabPage1_Validating(object sender, System.ComponentModel.CancelEventArgs e)
{
e.Cancel = true;
}
And it will get called twice before the focus actually leaves the tab, which its allowed to do. Then attempting to return to that tab, it will cancel.
Any ideas?
|
|
|
|
|
I thought I would post this just in case anyone was wondering how to go about doing Role based security with windows forms
Now most of the applications that I have written have been on the web so Role based security was ease
if (User.IsInRole("Power Users"))
{
.. code here
}
Now I am doing a windows application that requires Role based security..
So here is what I did..
public System.Security.Principal.WindowsPrincipal User;
this.User = new System.Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent() );
if (User.IsInRole("Power Users"))
{
.. code here
}
thats it!! easy stuff..
well like I said, I just wanted to post this for anyone who may need it.
Will
|
|
|
|
|
Anyone tried launching a copy of Word 2003 using Process.Start. You may be interested to find that Word for some reason, spaws a seperate copy of itself in another process, and the handle that you have in the code immediately exits. Hmmm. Not the case for Excel. Just wondering what MS's logic was with that one.
"Je pense, donc je mange." - Rene Descartes 1689 - Just before his mother put his tea on the table.
Shameless Plug - Distributed Database Transactions in .NET using COM+
|
|
|
|
|
I'm trying to find out the printable area of my printer.
The first try was this:
void OnPrintPageBoard(object obj, PrintPageEventArgs ppea)
{
Graphics grfx = ppea.Graphics;
grfx.PageUnit = GraphicsUnit.Millimeter;
RectangleF rectf = new RectangleF(
ppea.MarginBounds.Left -
(ppea.PageBounds.Width - grfx.VisibleClipBounds.Width) / 2,
ppea.MarginBounds.Top -
(ppea.PageBounds.Height - grfx.VisibleClipBounds.Height) / 2,
ppea.MarginBounds.Width,
ppea.MarginBounds.Height);
Pen myPen = new Pen(Color.Black,1);
grfx.DrawRectangle(myPen,rectf.X, rectf.Y,rectf.Width,rectf.Height);
}
But this didn't work at all.
Second try was this:
void OnPrintPageBoard(object obj, PrintPageEventArgs ppea)
{
Graphics grfx = ppea.Graphics;
RectangleF rectf = new RectangleF(
ppea.MarginBounds.Left -
(ppea.PageBounds.Width - grfx.VisibleClipBounds.Width) / 2,
ppea.MarginBounds.Top -
(ppea.PageBounds.Height - grfx.VisibleClipBounds.Height) / 2,
ppea.MarginBounds.Width,
ppea.MarginBounds.Height);
double dPrintableAreaX = PrinterUnitConvert.Convert(rectf.X, PrinterUnit.Display, PrinterUnit.TenthsOfAMillimeter)/10;
double dPrintableAreaY = PrinterUnitConvert.Convert(rectf.Y, PrinterUnit.Display, PrinterUnit.TenthsOfAMillimeter)/10;
double dPrintableAreaWidth = PrinterUnitConvert.Convert(rectf.Width, PrinterUnit.Display, PrinterUnit.TenthsOfAMillimeter)/10;
double dPrintableAreaHeight = PrinterUnitConvert.Convert(rectf.Height, PrinterUnit.Display, PrinterUnit.TenthsOfAMillimeter)/10;
grfx.PageUnit = GraphicsUnit.Millimeter;
Pen myPen = new Pen(Color.Black,1);
grfx.DrawRectangle(myPen, (float)dPrintableAreaX, (float)dPrintableAreaY, (float)dPrintableAreaWidth, (float)dPrintableAreaHeight);
}
This worked, but the rectangle is way smaller than I expected! If I draw for example like grfx.DrawRectangle(myPen, 0, 0, 100, 100), the rectangle is more at the border of the page.
I also don't understand, why the values of the rectf of my first example don't have the same value as dPrintableAreaX,dPrintableAreaY,dPrintableAreaWidth,dPrintableAreaHeight of my second example. Should be millimeters either way, shouldn't it?
Best Regards
Bernd R.
The light at the end of the tunnel has been switched off temporarily due to budget problems...
|
|
|
|
|
Now I got it:
void OnPrintPageBoard(object obj, PrintPageEventArgs ppea)
{
Graphics grfx = ppea.Graphics;
double dPrintableWidth = PrinterUnitConvert.Convert(grfx.VisibleClipBounds.Width, PrinterUnit.Display, PrinterUnit.TenthsOfAMillimeter)/10;
double dPrintableHeight = PrinterUnitConvert.Convert(grfx.VisibleClipBounds.Height, PrinterUnit.Display, PrinterUnit.TenthsOfAMillimeter)/10;
grfx.PageUnit = GraphicsUnit.Millimeter;
Pen myPen = new Pen(Color.Black,1);
grfx.DrawRectangle(myPen, 0, 0, (float)dPrintableWidth, (float)dPrintableHeight);
}
Printing is hard!
----------------------------
The light at the end of the tunnel has been switched off temporarily due to budget problems...
|
|
|
|
|
you also might wanna check this out:
http://www.codeproject.com/csharp/DotNetprinterbounds.asp
it's about finding the true printer margins of a printer, since these vary from printer to printer and (from what I know of)
can't be found through the .NET framework.
|
|
|
|
|
I have to transfer a data base from old to new one in batch.
I am working with the Data transformation services at the sql server.
How can i run/excute a dts package from a stored procedure or from the query analyzer? .
Is it possible?, I know i can do it from the command prompt but it does't help me
Thanks in advance
Be Good...
Dudi
|
|
|
|
|
|
I've recently started a new job, where they have purchased pocket pc devices with the intent of communicating with their unixware server over GPRS. This is fine and lends itself well to their intended application. The problem is they want to do this via Telnet! To me this sounds crazy but they insist on doing it this way. How is it possible using C# on Pocket PC for me to communicate via Telnet in a controlled fashion so that I may handle dropped GPRS to their server!
I'd really love to hear ideas on the subject ans possible sugestions!
Schkin
|
|
|
|
|
Telnet is Evil. Your major problem is that there's no way to pick up a dropped session - the session is tied intimately to the state of the TCP connection: lose the connection, lose the session.
This probably isn't the answer you want to hear, but I recommend implementing the Telnet client as a server process on a server somewhere, then implementing some reconnectable protocol, that allows you to specify a session to reconnect to, between the handheld and the front-end server.
I assume that the point of connecting to the Unixware server over Telnet is to scrape data from the screen? Implementing the screen-scraping in the server would be more sensible, IMO; you could implement the handheld-to-server interface using a Web service. You could probably convince your admins that exposing a web service over HTTP/HTTPS is more secure than exposing direct access to Telnet over the internet (even if you're going to use a VPN).
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hello big guys,
I remember using a FlexGrid in VB6, I want to use a component like that in C#.
I know there is that component for sale... I can't buy that in my MP.
All I need to do is to have rows to enter text.. like in Exel.
I cannot use a multiline textbox.
HELP!
_____________________________________________________
Believe! Every thing has a purpose
|
|
|
|
|
|
yes I went through that last night, but I can find only the database connectivity & property modification. All I want is a row-ised text box.!
_____________________________________________________
Believe! Every thing has a purpose
|
|
|
|
|
Ok thanx..
I found an article on the net to make a datagrid to a flexigrid.. (like I wanted)
but I have to add data to it, & this can be done only through an ArrayList . http://www.c-sharpcorner.com/Code/2004/June/ObjectDataGridBinding.asp[^], gives a way to do it.. but I cannot get an Idea of wats happening..
the code is
ArrayList list = new ArrayList();
list.Add(new BindingObject(1, "One", null));
list.Add(new BindingObject(2, "Two", null));
list.Add(new BindingObject(3, "Three", "NULL"));
dataGrid1.DataSource = list;
public class BindingObject
{
private int intMember;
private string stringMember;
private string nullMember;
public BindingObject(int i, string str1, string str2)
{
intMember = i;
stringMember = str1;
nullMember = str2;
}
public int IntMember
{
get { return intMember; }
}
public string StringMember
{
get { return stringMember; }
}
public string NullMember
{
get { return nullMember; }
}
}
What's happening here!!
Help!!
_____________________________________________________
Believe! Every thing has a purpose
|
|
|
|
|
Hi gurus,
I would like to know if there is an event BEFORE the Resize event?
I would like to get the window location (this.Location ) just before the window state (this.WindowState ) changes from FormWindowState.Normal to FormWindowState.Maximized or FormWindowState.Minimized .
When the Resize event is raised, the this.Location has already changed to the new one. I would like to get this value (this.Location ) before it is changed.
Thanks.
Best regards.
There is no spoon.
|
|
|
|
|
You have to override WndProc , handle the WM_SIZING (0x0214) notification message, and set Message.Result to new IntPtr(1) (TRUE ) in order to cancel it.
If all you want to do is prevent resizing, set the FormBorderStyle to FormBorderStyle.FixedDialog and set the MaximizeBox and MinimizeBox properties to false . These are all properties on the Form .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Heath,
I don't want to cancel the Resize event, I want to save the Location of the window before the Resize event is raised.
I'm going to try to handle the WndProc method as you said.
Thanks.
There is no spoon.
|
|
|
|
|
WEll, the problem with using the WM_SIZING message is that it is fired continuously as the window is being resized. So now you have to set a flag when the first WM_SIZING message hits you so you don't coninuously save the Location of the window as it's being resized. I can't remember off the top of my head, but I think after the user let's go of the mouse, you'll get a WM_SIZE (not WM_SIZING) message with the final dimensions of the client area of the window. You might be able to use that message to reset the flag you set under WM_SIZING... I THINK!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|