|
Hello All,
Is that possible to acquire a thread by specifying thread ID. Eg. I want to use thread ID 15 (or some number) only for my process, is this possible?
Thanks
|
|
|
|
|
No. You can't steal a thread from another process. If you did, how would you know what to do with it ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
My plan is to get hold of thread waiting for Async IO to complete and make it sleep. so that process will choose different thread to process call back.
E.g. Thread 15 is waiting for IO to complete. I want to make thread 15 to sleep. So, when call back comes after IO completion, that should get processed on different thread than 15. Am Trying to reproduce thread switching scenario.
I guess its difficult to reproduce.
Thanks.
|
|
|
|
|
Member 2324483 wrote: My plan is to get hold of thread waiting for Async IO to complete and make it sleep
The main advantage of async operation is non-blocking fashioned execution. It uses less resources and won't keep any threads in blocking.
Member 2324483 wrote: Thread 15 is waiting for IO to complete. I want to make thread 15 to sleep. So, when call back comes after IO completion, that should get processed on different thread than 15
You said Thread15 is doing IO operation. So if you put it in sleep, how come that operation will end? Also there is no way to put a thread in sleep from another thread. Please explain why you need this.
|
|
|
|
|
Hello gentlemen,
I would like to write a service and an form appl.I need to obtain data from service to my form application(some information). Is it possible? If yes, could you give me a hint?
Thank you very much.
|
|
|
|
|
daavena wrote: Is it possible?
Yes.
daavena wrote: If yes, could you give me a hint?
It can be done via Inter-Process communication. Possible solutions are:
Pipes and .Net Remoting/WCF
|
|
|
|
|
Thank you. I will check it.
|
|
|
|
|
Glad to help you
|
|
|
|
|
I have the Service write an XML file, then many users of the application can read the file.
You could also use a database.
|
|
|
|
|
I`m trying to embed Excel in Windows forms. I`m following the example in
http://www.codeproject.com/KB/office/Embedding_Excel.aspx
Everything seems to work fine, but I want the Tool Bar for Excel [Very Important] . I can`t seem to enable the Toolbar in windows forms. Can anyone please go through the code in demo and see what needs to be done. I`m completely lost and frustrated. Also, I want to save the excel file, what is the way to go about that, since its already open.
|
|
|
|
|
|
Cool App! Not what I`m looking for. I need to use windows forms and excel embedded in it.
|
|
|
|
|
sharat567 wrote: I need to use windows forms and excel embedded in it.
Why not just host it?
|
|
|
|
|
Can you please elaborate. What exactly do you mean by hosting? Like in a web browser? I already do that.
|
|
|
|
|
No, like it is done by Window Tabifier. Start Excel and set parent of excel form to your form.
|
|
|
|
|
Hi
i don't know why the "Create GUID" tool is disable in my Visual Studio 2005 IDE.
also i could not found guidgen.exe in this path :
D:\Program Files\Microsoft Visual Studio 8\Common7\Tools
Can anybody help me about this issue ?
i'm using Microsoft Vidual Studio 2005 Professional Edition
Thanks
|
|
|
|
|
|
hdv212 wrote: also i could not found guidgen.exe in this path :
D:\Program Files\Microsoft Visual Studio 8\Common7\Tools
I think guidgen.exe is installed as part of the SDK.
Is there a copy here? D:\Program Files\Microsoft SDKs\Windows\...<version>...\bin
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
|
Hello everyone,
I'm building my own library. But I'm kind of stuck and it is really tough to explain, but I will try:
I have a class, let's call this X. X has an interface and a base class. X also inherets another class (called Y).
Now I call some base functions and give X as a parameter.
But I would like to know if it is possible in another baseclass?
To sketch it up in code, it looks like this now:
class X : Y, InterfaceX
{
public X()
{
}
bool function1(String txt)
{
return base.function1(this, txt);
}
}
class Y
{
bool function1(InterfaceX x, String txt)
{
return true/false;
}
}
And what I would like to have is something like this:
class X : Y (& Z), InterfaceX
{
public X()
{
}
}
class Y
{
bool function1(InterfaceX x, String txt)
{
return true/false;
}
}
class Z
{
bool function1(String txt)
{
return base.function1(this.getParent(), txt);
}
}
Is this possible, and if it is, how can I implement this?
Thank you very much.
|
|
|
|
|
Class X can't inherit from Y and Z because C# only supports single inheritance (unfortunately). You could have X inherit from Y, and Y inherit from Z. Or you could have X implement multiple interfaces.
Also you need the keyword "virtual" on the virtual methods in your base classes, and the keyword "override" on your overridden methods in the derived classes.
Another possibility is the Decorator design pattern, which lets you define inheritance (single or multiple) at runtime.
|
|
|
|
|
Thank you.
But the problem I have is that if I want to add a function to my Interface class and it is as simple as calling the base function with as parameter itself, shouldn't it be possible to do that in some kind of global class. Something like this:
class Main
{
public Main()
{
X x = new X();
x.function1("myText"); -> false
X2 x2 = new X2();
x2.function1("myText"); -> true
}
}
interface InterfaceX
{
int number { get; };
bool function1(String txt);
}
class X : Z, InterfaceX
{
public int number
{
get { return 5;}
}
public X(){}
}
class X2 : Z, InterfaceX
{
public int number
{
get { return 2;}
}
public X2() {}
}
class Z : Y,
{
public bool function1(String txt)
{
return base.function2(this.getParent(), txt);
}
}
class Y
{
public bool function2(InterfaceX x, String txt)
{
if(x.number < 3)
return true;
else
return false;
}
}
It's all about the this.getParent(), this doesn't work, but how can I get this working?
|
|
|
|
|
I'm not sure what you're trying to do, but this.getParent () will only work if:
1. Class Z (or an ancestor of Z) defines a getParent () method, and
2. This getParent () method returns InterfaceX (or a descendant of InterfaceX).
|
|
|
|
|
With the this.getParent() I would like to get the 'parent' of Z.
So if I make an X : Z I would like to get X.
And if I make an BlahBlah : Z I would like to get BlahBlah.
I'm trying to get some work of my back.
In stead of implementing all the functions (of the interface) inside of every class, I would like to make a base class which implements these functions.
|
|
|
|