|
I don't understand your whole server side and client side breakdown. All you need is the WCF service, once instantiated the client has a proxy, an instance of the class, no need for a client copy also. What are you using with the WCF service?
only two letters away from being an asset
|
|
|
|
|
Sorry, I fix my question and ask again in the form.
I wrote class library (dll) and this library contains one singleton class. Like this;
public class MyList : List<string>
{
private static readonly MyList m_Instance = new MyList();
private MyList()
{
}
public static MyList Instance
{
get { return m_Instance; }
}
}
Client --- WCF --> Server; add item to MyList class, its properly work.
Another Client --- WCF --> Server; add item to MyList class, its properly work.
But;
I have a thread in server side. If this thread add to item to MyList, clients items not contain in the MyList. Actually main problem is I can't see MyList items which are aded by clients in server thread.
I think this problem related about AppDomain. How can I solve it?
Best Regards...
|
|
|
|
|
You still haven't answered the question. How have you constructed the WCF service? What InstanceMode are you using? What persistance mechanism are you using? How much do you really understand about WCF and using it?
only two letters away from being an asset
|
|
|
|
|
My WCF Service use TcpBinding and host on windows service. I am not use ServiceBehavior InstanceContextMode... Problem not related about WCF.
I wrote class which is MyClass1, this class in server side. This class have a Start() function.
public void Start()
{
Thread thread = new Thread(new ThreadStart(CheckTablesAreChanged));
thread.IsBackground = true;
thread.Start();
}
private void CheckTablesAreChanged()
{
while (true)
{
... ADD ITEM TO MyLIST CLASS ...
}
}
Start() function call when WCF is hoting like this;
host.Open();
MyClass1.Start();
So this side not related about WCF.
In Client side;
Client --> WCF --> Server --> ADD ITEM TO MyLIST CLASS
For example client add 3 ITEM TO MyLIST CLASS, after that I check MyLIST CLASS count property in "CheckTablesAreChanged()" function, MyLIST CLASS count is 0.
|
|
|
|
|
As Pete said in the prevous posts, each AppDomain is in its own memory space and is therefore isolated, marshalling objects between domains is not a facile task. In any case I think the architecture you describe is unsound:
- It breaks the principles of client / server architecture. If you want to access a common object you should only do this on the server via method calls. There are several ways of persisting the common object between calls / clients
- By attempting to call methods/set properties on an object instanced on the server from the client, you are opening up a security hole
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
|
What is the easiest way to activate a specific excel worksheet within a workbook. I am using MS visual C#
|
|
|
|
|
Youre description is a bit vauge, but I'm guessing it would be something like Worksheets("someSheetName").Active ??
|
|
|
|
|
-David
I tried this method and it says
Error 2
The name 'Worksheets' does not exist in the current context
|
|
|
|
|
How about supplying the name you're using for the Excel Application object?
myExcelAppObject.Worksheets...
|
|
|
|
|
Actually.... Im not clear on excel worksheet within a workbook? Could you clarify on this?
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Example you can have one Excel workbook with multiple tabs I am trying to figure out how to make the 3rd tab the active tab to manipulate the data.
|
|
|
|
|
antsims wrote: What is the easiest way to activate a specific excel worksheet within a workbook.
The easiest way is to search the MSDN documentation & samples[^].
|
|
|
|
|
Hi,
I have an application used to print certain product info sheets. It is normally launched as a conventional application and works exactly as intended. The associated database editor can also launch it (using Process.Start()) to print any changed product sheets; in that case the application prints correctly but remains open after completing its work. If I call this.Close() explicitly from anyplace other than the Quit menu item handler an exception is thrown; using Application.Exit() or Environment.Exit() has no effect. Looking at the Process documentation on MSDN yields no obvious clues.
How can I have the application quit automatically after being launched by the database editor?
Thanks in advance,
-Frank Alviani
|
|
|
|
|
You really have no control over that. The application that you launch has to supply that kind of functionality, maybe through a command line switch. You'll have to consult with the documentation or the manufacturer of the app you're launching.
|
|
|
|
|
Thanks for the info. I wrote the app myself, and know *when* I should be quitting automatically - I just can't figure out which method to call to do so 
|
|
|
|
|
OK, I read the original post wrong. Application.Exit() is what you should be using. If it's not working, then you've got something else wrong in your app that is preventing your app from closing.
How do you have your app processing command line arguments and printing your document? Are you doing this in the forms Load event? IIRC, calling Application.Exit() in the Load event doesn't do anything.
|
|
|
|
|
Thanks for your hint. During the form constructor, I detect if I have a command line argument listing the sheets to print and immediately proceed to handle it. This occurs before the main window is shown. I now set a flag that is tested during the form_Shown() handler and if I have printed sheets I call Application.Exit() as you recommended. Works like a charm
Again, thanks!
-Frank
|
|
|
|
|
OK - it's kind of the wacky way to go about it, but whatever works.
I'd normally create my own Main method, do whatever command line stuff I need to there and if I need to start the Windows Form app, branch off to the Application.Run(new MyMainForm). Other than that, let the Main method die normally.
|
|
|
|
|
i am completely new here, pls what is RedFive labs?
|
|
|
|
|
Enobong Adahada wrote: i am completely new here
Congrats
Enobong Adahada wrote: what is RedFive labs?
RedFive Labs[^]
Try Google more often.
[Edit]
Ok, I can tell you are new here.
Please check out the link at the top entitled 'how to get an answer to your question'.
People here will not do work for you based off your vague requirements, and even if you do state requirements properly chances are you still won't receive free work.
Please post specific problems that are part of your project, we won't start or finish it for you but we will help you along the way.
Please buy a book on the topic you wish to learn and begin studying/learning it. You cannot become a developer overnight.
[/Edit]
|
|
|
|
|
Ok, I have a control with custom painting being done. I have a back buffer bitmap that I draw to then OnPaint, I paint the entire bitmap to the control. There are sometimes with certain sections of the bitmap are updated and all I need to do is update those sections on the control. So what I'm doing so far is:
pseudocode
void UpdateArea(Rectangle rect)
{
Invalidate(rect);
}
void OnPaint(object o, PaintEventArgs e)
{
e.Graphics.DrawImage(BackBuffer, e.ClipRectangle, e.ClipRectangle, GraphicsUnit.Pixel);
}
Ok, that's not actual code, but it's close enough. When I call UpdateArea, the area which I changed is successfully reflected on the screen. However, once UpdateArea is called, the control will only redraw that section from there on out. Everything outside of the region becomes garbage. The Bitmap itself is fine because if I call Invalidate(), the entire bitmap draws just fine. What am I missing that would prevent the rest of the bitmap from being draw properly?
|
|
|
|
|
Hi,
I don't see anything wrong.
Are you sure you represented the actual code close enough?
or are you having some Graphics.Transforms you did not show?
tips for debugging:
- add logging (to file or to Console) to both UpdateArea and OnPaint; then check each rect that appears in UpdateArea
- create a second Panel ( or form or whatever) and inside the original OnPaint paint the entire bitmap to the entire second Panel, so you can see real-time whether your BackBuffer is still intact.
BTW: simplifying code shown may be a bad idea: something does not work the way you expect, what makes you think you can simplify your code reliably without hiding the problem?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Actually I just found my problem! When I go to call LockBits, I initially lock the entire bitmap, which apparently does something to the data. if I lock just the portion of the bitmap that I'm updating, all is fine and well.
|
|
|
|
|
Hi.
I'm using LINQ to SQL. I wanna create a database with LINQ but the following exception has occurred :
Illegal characters in path.
This is my code :
using (RezaRestaurant.SQL.DataClasses1DataContext dbc = new RezaRestaurant.SQL.DataClasses1DataContext())
if (!dbc.DatabaseExists())
dbc.CreateDatabase();
BTW : I was using UFT8 characters in database's tables, like this : اقلام_فروخته_شده
Could you please guide me ?
Thanks.
|
|
|
|