|
Doesn't work. The SendKey.Send receive a string parameter not a Keys
|
|
|
|
|
In that case, how about SendKeys.Send(" "); ?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
My bad. Tack a ToString() to the end of that
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Doesn't work.
If I put SendKey.Send(" ") it put me more than one space and the application freeze for few moments.
If I put SendKey.Send(Keys.Space.ToString()) it put me many SpaceSpaceSapce and the program will not stop
|
|
|
|
|
try SendKeys.Send("{SPACE}");
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
mihksoft wrote: If I put SendKey.Send(Keys.Space.ToString()) it put me many SpaceSpaceSapce and the program will not stop
It's pretty clear you doing it 3 times then! So use SendKey.Send(" ") and make sure it happens only once (which it is not doing).
|
|
|
|
|
I have created a COM server in which a collection of vectors need to be exposed to C# sharp client .
Each vector contains a array of structures and this vector need to be embedded inside a container, say another vector or list.
Code:
typedef struct
{
std::string name;
std::string type;
} STAGE_INFO;
std::vector<stage_info> m_stages;
m_stages.push_back(current_stage)
Since STL classes are not accessible in C#, I used a SAFEARRAY and VARIANT for exposing them. But I am not successful because of the following reason .
1) I am not able to create a VARIANT array of structures.
2) I created a SAFEARRAY of structures and included it in a VARIANT, but when accessed in C# as Object, I am not able to get the structure. Though I am able to typecast it into a Object array , but if accessed in separte gives exception.
3) I am able to access the members of the structure as they are string but not a STRUCTURE as a whole.
4) I tried containing a VARIANT of SAFEARRAY'S in another VARIANT, but it gives a casting error.
5) CComVariant cannot have USD's and VARIANT if used has some problem of Memory Leaks.
Please let me know if you have expertise in COM and C#.Net Interoperability.
or
Even if you have some alternate solution for this problem?
Thanks In Advance .. expecting your earliest reply.
_________________
Life Rocks,
$dhanu's$
|
|
|
|
|
This is going to be very difficult because C# has no knowledge of std::vector, your STAGE_INFO struct, and to worsen things, your struct has std:string objects in it, which C# also has no knowledge of.
Instead of trying to make C# see all this stuff, could you instead expose functions that get data from the vector and return it in a C# friendly way? This could be done either using standard exported C functions or by using a C++/CLI wrapper which is then available to the managed world.
|
|
|
|
|
Hello,
Recently I came up with seeing a class some thing like this
public class Stack<T> : IEnumerable<T>, ICollection, IEnumerable
{
}
Could any one tell me what is <T> means ? Why it has to be given like this ? Any ideas ?
-- modified at 6:50 Tuesday 2nd October, 2007
HTML tag next to class was not visible
|
|
|
|
|
The reason I despair for the future of this industry, is the large number of people who are scared of google.
The Stack class impliments three interfaces. It does this so that differing objects can share a common interface, when used for the same purpose.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I think what Navaneeth tried to ask is, why is the Stack class implementing the IEnumerable Interface twice?!? Honestly I dont know either...
|
|
|
|
|
It probably didn't, it probably implemented
IEnumerable
and
IEnumerable<T>
|
|
|
|
|
Christian Graus wrote: The Stack class impliments three interfaces. It does this so that differing objects can share a common interface, when used for the same purpose.
You are mistaken me, I am not asking anything related to stack class. I was asking why <T> is used after class name ?
|
|
|
|
|
Because you can use it with a generic. It's one of those new fangled .NET 2 things that's only been around since 2005 - I'm not surprised you haven't heard of it.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: Because you can use it with a generic
Thanks, But I am not clear on this ? What do you mean ? And what will be difference like giving normal class declaration ?
|
|
|
|
|
It means that you can use the Stack class with a generic and it will use the generic IEnumerable interface. In other words, you can create a class as Stack<MyClass> and then rely on the fact that you have the IEnumerable<T> implementation to use.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
The <T> means you can put whatever type you want in it. The T is short for Type. For example:
Stack<int> myStackOfIntegers = new Stack<int>();
Stack<string> stackOfStrings = new Stack<string();
Stack<MyFooType> stackOfFoos = new Stack<MyFooType>();
myStackOfIntegers.Push(5);
myStackOfIntegers.Push("hello");
|
|
|
|
|
Clearer now. You are missing <T> at the first IEnumerable. Google for Generics, its "new" feature in C# 2.0
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
dnh wrote: Google for Generics, its "new" feature in C# 2.0
Thanks. Now it's becoming clearer
|
|
|
|
|
Hey
I have recently started C# programming
and was wondering, when i create a button i can make it display a message box however i want to know how this same button can also open a website URL.
Thanks in advance
Benjamin Dodd
|
|
|
|
|
Benjamin Dodd wrote: how this same button can also open a website URL.
Create a new website url shortcut file. Open that file using Process.Start() method
|
|
|
|
|
Thanks for your help.
N a v a n e e t h wrote: Open that file using Process.Start() method
so, example - Process.Start(C:\Documents and Settings\stc12191\My Documents)
is that right :s
i saved a webpage in my documents, so if i use the code:
Process.Start(C:\Documents and Settings\stc12191\My Documents)
will that open the web page
thanks
Benjamin Dodd
|
|
|
|
|
You could look here[^] to get started with this.
|
|
|
|
|
Benjamin Dodd wrote: i saved a webpage in my documents, so if i use the code:
Process.Start(C:\Documents and Settings\stc12191\My Documents)
will that open the web page
No.
1 - you didn't put the string in quotes
2 - if you have 20 web pages in this folder, how would you expect windows to just pick one, or even know you wanted to open a web page ? Process.Start starts a program, and if you give it a file, it tries to open it with the default program. So, if you put the name of the htm file at the end of that path, that will work.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: if you have 20 web pages in this folder, how would you expect windows to just pick one, or even know you wanted to open a web page ?
ooops i forgot that bit
thanks for your help
is this right then
("C:\Documents and Settings\stc12191\My Documents\google")
ps. i cannot check the code now as i am not on my laptop which has c# installed
Benjamin Dodd
|
|
|
|