|
Hi Nitin,
Thanks for your reply.
I am trying to create remoting objects that can be referenced on a server when in a particular, if you like 'chatty', role but also the same objects having the capability of being serialized onto the client is in another role where they are connected to heavy weight data processing.
An example: Supposing you have a Person object that is connected to security logon - Person in this role would not need to be serialize and Marshal-By-Reference would suffice. However, the same Person object could also be associated with a Product, Order, Patient and Medical information later in a process and involved with longer and heavier processing where the lifetime of the object on the client may even span several sessions - here Marshal-By-Value is probably best. However the Person object is the same - I was hoping to find a way to initially use a Person object reference on the server and transfer/serialise that same Person object to the client without having to construct a new Person and copy data across.
Bearing in mind that there will be many such objects, one of the main reasons therefore is to try and reduce server processing of these objects, and also could be useful to be able to cache state and behaviour on clients for cross session reasons.
I hope that makes sense?
Andy
-- modified at 12:15 Friday 29th June, 2007
|
|
|
|
|
Andy,
From what I follow, you need a mix of MBR, MRV. For this, I can only think of creating a MBR descendant object which implements ISerializable (or mark as Serializable). This way, you start with an MBR object on the server and when the client requests for the instance (perhaps identified with an Guid?), the server serializes the object and returns it.
But, do note that MBV is usually recommended only for light weight objects.. since the whole object is being passed across.
Thanks,
Nitin
|
|
|
|
|
Yes thanks Nitin. I am also looking at customised serialisation too - I've got some learning to do in this area.
I will try what you suggest and I am aware of the size limitation for MBV - the idea is to serialize pieces of the object model to and from the client and not the whole thing in one go, but do this only where necessary and only for writeable objects.
I know there are a whole load of data integrity issues too but that another story.
Andy
|
|
|
|
|
Once i convert the Winhelp to Html Help i am able to get only the .htm and .hhk files. I am not able to get the .hhc(contents file).Does the file size matter while converting or could there be any other problem??????
ASHA
-- modified at 4:45 Wednesday 27th June, 2007
ASHA
|
|
|
|
|
We store our source code in MS SourceSafe. For common classes and functions we are not sure where to store the .dll for access by other applications etc. For example we have a database class that connects to any of the corporate DBs...
Any one have any architechture ideas
|
|
|
|
|
tri595 wrote: For common classes and functions we are not sure where to store the .dll for access by other applications etc.
Keep those DLLs in GAC.
|
|
|
|
|
Thanks... we keep the source code in MS SourceSafe and we wanted to put the Dlls in a secure location for access by another application.. they will be in the GAC when we deploy the application anyhow.. what benefit does this give?
|
|
|
|
|
|
I have Created A ListBox Control Whose Handle is Desktop.
My code for ListBox:
#using <mscorlib.dll>
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:ata;
using namespace System:rawing;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;
namespace DeskTopTest
{
///
/// Summary for MyListBox
///
// Requires unmanaged code
[assembly: SecurityPermissionAttribute (SecurityAction::RequestMinimum, UnmanagedCode=true)];
// Requires ability to create any window type
[assembly:UIPermissionAttribute(SecurityAction::RequestMinimum, Window=UIPermissionWindow::AllWindows)];
public ref class MyListBox : public ListBox
{
public:
MyListBox(void)
{
}
protected: virtual property System::Windows::Forms::CreateParams^ CreateParams
{
virtual System::Windows::Forms::CreateParams^ get() override
{
const int WS_EX_TOOLWINDOW = 0x00000080;
const int WS_EX_NOACTIVATE = 0x08000000;
const int WS_EX_TOPMOST = 0x00000008;
try
{
System::Windows::Forms::CreateParams ^p =ListBox::CreateParams;
p->ExStyle |= (WS_EX_NOACTIVATE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST);
p->Parent = IntPtr::Zero;
return p;
}
catch (Exception^ e)
{
return nullptr;
}
}
}
public:[DllImport("user32.dll")] static int SetParent( IntPtr hWndChild, IntPtr hWndNewParent);
[DllImport("user32.dll")] static int ShowWindow( IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll")] static IntPtr GetDesktopWindow(void);
public: void ShowFloating()
{
if (this->Handle == IntPtr::Zero)
{
ListBox::CreateControl();
}
//IntPtr s=GetDesktopWindow();
int x=SetParent(ListBox::Handle, IntPtr::Zero);
x=ShowWindow(ListBox::Handle,1);
}
protected:
virtual void WndProc(Message% m)override
{
ListBox::WndProc(m);
}
};
}
but when i Added this listbox to my form like:
MyListBox ^lst=gcnew MyListBox();
lst->Location=System:rawing::Point(264, 166);
lst->Name = L"comboBox1";
lst->TabIndex = 1;
lst->Visible=false;
lst->Size = System:rawing::Size(171, 200);
for (UInt16 i=1;i<100;i++)
{
lst->Items->Add("Item"+i.ToString());
}
lst->ShowFloating();
and calling the function ShowFloating();
It is working fine.
But I cant unable to focus On my Listbox & cant able to use my mouse events.
I want to focus on listbox.
Plz Suggest me .........
Thanks in advance
Nagaraju
|
|
|
|
|
Hi,
I'm writing a C# windows application program that needs to connect to the SQL server 2000 or SQL 2005. What i want to do is when the user selects to connect to the server, a pop-up window appears that opens the data connection wizard where the can go through the wizard and connect to the sql servers are any other servers. Is this possible? If so, can someone please tell me how to do this?
|
|
|
|
|
Prompt the user for the server,Database,username, password. Prepare the connection string internally, connect using SqlConnection.
For enumerating the list of database, servers, use DMO or the new variant SMO
|
|
|
|
|
Hello,
Do you know a good resource which would describe possible situations that can leed to memory leaks? such as eventhandlers to objects that are no more needed and forms that aren't disposed after closing. Any article that would describe such situations and how to prevent them? Thanks
|
|
|
|
|
The only resource I know of is experience, or the tried and true technique of "trial and error".
|
|
|
|
|
Dave Kreskowiak wrote: The only resource I know of is experience, or the tried and true technique of "trial and error".
Know that feeling :->
|
|
|
|
|
Dave Kreskowiak wrote: The only resource I know of is experience, or the tried and true technique of "trial and error".
So you say that there is not any article in the internet on that subject?
|
|
|
|
|
|
originSH wrote: He's saying he doesn't know of one.
Thank you!
|
|
|
|
|
np
|
|
|
|
|
Hello,
How can I build a IP lan scanner in .net(vb.net/c#)?
It should give the list of all computers/devices in the network, and their relative IPs and (eventually) MAC Address and device/computer name.
Thanks in advance,
Carmine,
Webmaster of: www.thetotalsite.it
My web blog: blog.thetotalsite.it
|
|
|
|
|
|
Mhm but that program displays only PCs based on Windows.
Is there a way to display all network devices? (network printers, routers, PCs with Linux/MAC etc.)?
Carmine,
Webmaster of: www.thetotalsite.it
My web blog: blog.thetotalsite.it
|
|
|
|
|
|
I have a slightly different problem, I have a generic function that handles populating all the properties of a class and all it's inhreited class objecs. Such as this:
public static List<iperson> TGeneratePersonList(IDataReader oDR, ePersonType PersonType)
{
ArrayList oCols = Field.GetColumnNames(oDR);
oCols = Utilities.Field.GetColumnNames(oDR);
iPerson oP = null;
List<iperson> oPList = new List<iperson>();
while (oDR.Read())
{
switch (PersonType)
{
case ePersonType.Basic:
oP = new Person();
break;
case ePersonType.Contract_Person:
oP = new Contract_Person();
((Contract_Person)oP).Contract_Person_ID = Field.GetInt(oDR, "Contact_ID");
break;
case ePersonType.Vendor_Person:
oP = new Vendor_Person();
break;
}
oPList.add(oP);
}
return oPList;
}
THe problem is when I try to assign this result to a property of an object deined as :
public List<vendor_person> Personnel_List
{
get
{
if (this._Personnel_List == null)
this._Personnel_List = new List<vendor_person>();
return this._Personnel_List;
}
set
{
this._Personnel_List = value;
}
}
I get this at compile time:
Error 4 Cannot implicitly convert type 'System.Collections.Generic.List<projectcentral.contacts.iperson>' to 'System.Collections.Generic.List<projectcentral.contacts.vendor_person>' C:\Projects\ProjectCentral\ProjectCentral.Vendors\GenericVendor.cs 281 39 ProjectCentral.Vendors
Any ideas? It's rather urgent since I've been fighting with this for days and my job is on the line.
THanls;
|
|
|
|
|
You need to pre-define the type for the generic List class to the type of the object that will be populating it i.e. iPerson so assuming classes Person, Contract_Person and Vendor_Person are all derived from iPerson your code needs to change to the following:
public static List<iPerson> TGeneratePersonList(IDataReader oDR, ePersonType PersonType)
{
...
iPerson oP = null;
List<iPerson> oPList = new List<iPerson>();
...
}
and your property to:
public List<iPerson> Personnel_List
{
...
}
and the field _Personnel_List to:
private List<iPerson> _Personnel_List;
Incidentally, the TGeneratePersonList() is not a generic method - it is an ordinary method that returns a generic List of type iPerson.
This is a generic method:
public void GenericMethod<T>() // Where type T is defined when the method is called
{
// Do something with T in here
}
example calls
GenericMethod<int>();
GenericMethod<string>();
GenericMethod<MyClass>();
|
|
|
|
|