|
Let's say you have:
Location: WebService: COM+ component:
___________________________________________
ServerRoot WebServiceRoot COMPlusRoot
ServerA WebServiceA COMPlusA
ServerB WebServiceB COMPlusB
In WebSericeRoot (residing on ServerRoot):
[Transaction(TransactionOption.Required)]
[AutoComplete(true)]
[WebMethod(...)]
public void PlaceOrder(..)
{
WebServiceA service_a = new WebServiceA();
service_a.UpdateInventory(); //This will call COMPlusA residing on ServerA --> This will launch a new transaction!
WebServiceB service_b = new WebServiceB();
service_b.UpdateShipping(); //This will call COMPlusB residing on ServerB --> This too, will not participate in PlaceOrder's transaction and launches its own.
}
Even if UpdateInventory() and UpdateShipping() requires transaction, two new transaction will be started. In other words, COMPlusA and COMPlusB will start their own transaction because COMPlusA/COMPlusB and COMPlusRoot objects all resides in different server.
What are my options to implement distributed transaction across machine boundary. Do I need to roll my own transaction? Thanks.
|
|
|
|
|
I am form Taiwan , English not nice.............^^
I have a question..
How the RichTextBox in writing, transforms the picture?
At present wants to use Graphics, but does not know the writing the attribute
Or has other ways to be allowed to achieve
Thanks.........
ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
|
|
|
|
|
http://thecodeproject.com/cs/miscctrl/csexrichtextbox.asp
|
|
|
|
|
But, RichTextBox has not certainly transferred "picture"
|
|
|
|
|
I would like to be able to perform background work in my C# .net Windows Service if no mouse messages or key messages have be received for 10 minutes.
It involves downloading, uploading and processing, I would like to be able to tell if the computer has been idle from the user to a 10 minute period and then I would start these routines/processes.
I see how to do this with Forms with overriding the WinProc method, but I need Windows Messages for a Service, and I think the Forms WinProc method only gets events when the mouse is moved over top of it. I need Messages that occure anywhere within Windows/OS/Desktop.
Is there any Windows API methods to import or any idea how to do this?
Thanks in advance.
|
|
|
|
|
krisp wrote:
I see how to do this with Forms with overriding the WinProc method, but I need Windows Messages for a Service, and I think the Forms WinProc method only gets events when the mouse is moved over top of it. I need Messages that occure anywhere within Windows/OS/Desktop.
You'll need to use a system-wide hook DLL, which cannot be written from C# - you'll probably want to write it in C++. You can then use this from your C# application.
|
|
|
|
|
If you are using Windows 2000 or above, you can use the GetLastInputInfo API call. You get a structure with the tick count when the last input event happened.
|
|
|
|
|
Awesome, thanks alot Jeff, that is exaclty what I needed, i guess I can just call it in a seperate thread every minute or so. Thanks again
The GetLastInputInfo function retrieves the time of the last input event.
Syntax:
BOOL GetLastInputInfo( PLASTINPUTINFO plii );
Parameters:
plii - [out] - Pointer to a LASTINPUTINFO structure that receives the time of the last input event.
Return Value:
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Remarks:
This is useful for input idle detection.
Function Information:
Header Declared in Winuser.h, include Windows.h
Import library User32.lib
Minimum operating systems Windows 2000
See Also:
Keyboard Input, LASTINPUTINFO
|
|
|
|
|
I've a similar question. I'm being with a project which can create shortcuts for windows. Is it possible to get a signal if for example the "P" button is pressed
Jonathan Slenders
|
|
|
|
|
If I have a base class A and class B implments class A, how can I get access to class B from class A.
I want to use reflection to loop through the properties of class B in class A, but I need a reference to the object in order to do this.
Thanks for your help.
|
|
|
|
|
not sure if this is what you want...
within class A if you think it is a type of class B then
// c#
if( this is ClassB )
{
( ( ClassB )this ).ClassBMethodCall();
}
// or
ClassB b = this as ClassB;
if( b != null )
{
b.ClassBMethodCall();
}
Not sure what you mean by using reflection, if all you want to do is call a ClassB method from its parent class, then I dont htink you need reflection. Unless im mistaken by what you mean/want.
|
|
|
|
|
Thanks for your reply.
The problem with this is that the base class (class A) does not know what class B is, as any class can implement class A. Therefore, you cannot explicitly reference ClassB.
This is why I have resorted to sending class B through to the base class (class A) when I need to reference its properties. But of course I don't think this could be the best way.
Any other thoughts?
|
|
|
|
|
So you are not making specific derived classes that your parent class would know about at compile time of the parent class?
Is there a certain propery you want to call of the derived/child class (class B) or you just want to iterate through them all. Because you can make properies virtual or abstract as well so that your child class would have the property you are looking for.
As far as iterating through them, you should be able to use reflection and call the this.GetType().GetProperties(); and then iterate throught the returned PropertyInfo[] which has a Name and PropertyType property.
this.GetType() will return the type of the lowest child class not the type of the class that it is called within.
That help any?
|
|
|
|
|
If all the Class Bs have the same set of properties you could create an interface and inherit from the interface as well as Class A. Then when you are iterating through all the objects via the reference to class A you can cast to the interface.
class B : A, IMyCommonProperties
{
}
foreach(A myObject in myObjectCollection)
{
IMyCommonProperties mcp = (IMyCommonProperties)myObject;
mcp.MyProperty1;
}
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
in the document on .Net Framework you can find some information about cachedbitmab and its finction drawcahcedbitmap but if you search all the classes of .Net Framework for c# you could not found any thing about it, any body know's about this class ??
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
CachedBitmaps are created from normal bitmaps, to store them optimized for a display device.
The contructor is
CachedBitmap( Bitmap*, Graphics* )
Graphics (GDI+, not System.Drawing!) is associated with a display device. CachedBitmap formats the bitmap for this device.
CachedBitmap belongs to GDI+, is derived from GdiPlusBase and declared in Gdiplusheaders.h, Gdiplus.h.
|
|
|
|
|
Dear Corinna,
I am asking about cached bitmap in c# so if you know how to create an instance of that class could you send me a code smaple for that cuz i could not find the class constructor......
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
Unfortunately, in .NET, CachedBitmap is an internal class - you can't use it yourself. I really hope that this will change in future versions of the .NET Framework.
|
|
|
|
|
I hoop so but do you know any way to stor the bitmap in the display card memory for improve the appliaction performance ???
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
mhmoud rawas wrote:
do you know any way to stor the bitmap in the display card memory
There might be some way, but it won't be easy, you won't be able to do it from C#, and there's no need to do that. The CachedBitmap doesn't do this - it just creates a bitmap that's optimized for the current display settings.
|
|
|
|
|
So in your oppenion what is the way to accelerate the drawing method in C# if you have an application which draw a large bitmap on mouse movement (Some thing like paning in the graphics application) and so we have to be carefull while dealing with large bitmaps cuz some times it takes'a large space in the memory espesialy while redrawing it
do you have a way to do that
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
in my windows application,i embeded a web browser,by this method we can show web component.But i want control this component such as draw to a new position.How can i do this.Help
|
|
|
|
|
I think you can create a solution consist's of web service project and control project which reference the web service project and get's the information you need from it every period of time try it ....
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
If you're hosting the IWebBrowser2 interface, you can use the MSHTML hosting interfaces like IDocHostUIHandler (see the PSDK for more details). This and several other hosting interfaces give you control over context menus, object placement and drawing, and much more functionality.
To implement IDocHostUIHandler (which pretty much sets everything else up), you must either redefine the interface in .NET (making sure to use the right GUID...or another technique which I'll link to later) and implement that on your class. You can QI (or cast in .NET) the WebBrowser control (or an IHTMLDocument* interface) to ICustomDoc and call SetUIHandler , passing a reference to your implementation of IDocHostUIHandler (but that only lets you use UI customization methods), or implement IOleClientSite . The WebBrowser control will QI for this interface on the host (you) and make calls to the IDocHostUIHandler for all methods.
You can read more about hosting the WebBrowser control and MSHTML by looking at http://msdn.microsoft.com/workshop/browser/prog_browser_node_entry.asp[^].
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath Stewart wrote:
You can QI (or cast in .NET) the WebBrowser control (or an IHTMLDocument* interface) to ICustomDoc and call SetUIHandler, passing a reference to your implementation of IDocHostUIHandler (but that only lets you use UI customization methods)
Just to give a quick example:
ICustomDoc cDoc = (ICustomDoc)webBrowser.Document;
cDoc.SetUIHandler((IDocHostUIHandler)this);
There's something I'd like to warn people about with the WebBrowser control. I replaced the default context menu for the WebBrowser, but whenever my context menu closed (after an item was clicked), the next item on the default context menu was executed, even though it never appeared. I was just about at my wit's end when I realized that the context menu must be sending something back to the window it was shown on behalf of - the WebBrowser control - and it was executing the default menu's commands. Changing the window passed into the context menu to the form instead of the WebBrowser solved the problem.
|
|
|
|