|
I set an object to clipboard
then when I get from Clipboard I get null value.
my code is here.
Class1 cls = new Class1();
cls.str = "Test string";
Clipboard.SetDataObject(cls);
IDataObject a;
a = Clipboard.GetDataObject();
Class1 aa=new Class1();
aa = (Class1) a.GetData(cls.GetType());
anyone help me!!!!
thanks in advance.
|
|
|
|
|
the problem here that you cannot set all data to the clipboard. the clipboard cannot handle all types of data. it can only handle data in the formats given in the enum DataFormats.
example:
string str = (String)iData.GetData(DataFormats.Text);
|
|
|
|
|
hello
i need to transfer some information in persian language betwine my client/server program . but when i use the encoding to encode my string to send at the other side i can not resive the true string . Encoding make my string wrong and send it .
i don'thave this problem with english strings.
for sending data i must use an array of bytes and in normal way i can't get the array byte of my string.
thank's for your help :
|
|
|
|
|
hi,i developed mailing software in c# usinf SMTP ,the problem is that when i try to send the mail i receive the exception "Can not access 'CDO.Message' Object", can anyone help me, i will be thankful to you.
|
|
|
|
|
|
thankx 4 sending the link, i think it will help me.
|
|
|
|
|
Is it possible to invoke API function RegisterClass in C#? I need to register a new class, and handle messages for it. How can I do that?
C++ libraries at a give-away price on www.neatcpp.com: TWAIN, DirectShow, Interprocess Communications, etc...
|
|
|
|
|
What exactly do you want to do? If all you want is a message pump, you can call Application.Run() passing the form as a parameter. That'll handle the messages and fire appropriate events in the form for you.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I have an app written in VC++ 6, which sends out some data via WM_COPYDATA to all instances of windows created with a specific class name. In order to be able to receive those data in VS.NET i need to have a window created with exactly the same class name. How can I do that?
C++ libraries at a give-away price on www.neatcpp.com: TWAIN, DirectShow, Interprocess Communications, etc...
|
|
|
|
|
You can try deriving your own class from System.Windows.Forms.Form and override WndProc . That way, you'll be able to see all messages sent to the window. But I've no idea how to set the class name.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I knew I could do that much, but the trick i need to do is with API function RegisterWindow. I can import it in without problem, but it takes WNDCLASS structure for initialization, which has one field - pointer to the function that will receive all windows events. And I don't know how to declare and initialize such field correctly. I know that in VB6 you could do that by using keyword "AddressOf" to get address of a function, but i don't know how this works in C#.
C++ libraries at a give-away price on www.neatcpp.com: TWAIN, DirectShow, Interprocess Communications, etc...
|
|
|
|
|
I can check whether there is a collision for between two objects
eg. Rectangle boxrect = box.Frame()
if(char.Frame().Intersectswith(boxrect)
but i want to know if i can check whether there is a collision with anything in the room at the time.
If so could i do this, then use a switch(*what it intersected with*)
to do different things depending on what the character is intersecting with, instead of doing a check for every single thing in the game
|
|
|
|
|
Hi all,
What is the best method( Keeping performance in mind) to store a list of integer items( Number unknown) in .NET ?
Regards,
Sugandh
|
|
|
|
|
You'll get best performance if you use arrays. But arrays will only work if the container size is known in advance. Otherwise you're better off using ArrayList.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hello
Is there an easy way to find out to if the computer is connected to the internet?
I was thinking at using HttpWebRequest and HttpWebResponse. Than i will check if there is comming an exception or a "page not found".
I want to know if there is a better way to check the internet connection.
Thanks
Roggey
|
|
|
|
|
Try searching this forum and you should find your answer. The same question was answered a couple of weeks ago by a couple of persons.
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Hi,
The setup is as follows: I have a UserControl where the user can enter some data which I want to check using the validating event. The validation code does two things. First it tries to correct as many errors as it can (this involves giving focus to the UserControl if one or more errors are found). If all errors could not be corrected it highlights them in the UserControl and pops up a MessageBox. If no errors are corrected or highlighted during validation everything is fine (Leave -> Validating). If any error is corrected the validating event is fired one (Leave -> Validating -> Enter (Still Validating)) or two times depending on where I click in the Form (other components). If the validation occurs twice the following events are fired in the following order.
Leave -> Validating -> Enter (Still Validating) -> Leave (After First Validation is finished) -> Validating
This problem does not occur if the UserControl is not given the focus when validating. However, for the UserControl to function correctly it is necessary to give it focus when errors are corrected during validation.
If no error is corrected (or focus is not given to the UserControl) but highlighted the validating event may also fire twice depending on where I click in the Form (this always happens when closing the form).
Leave -> Validating -> Enter -> Leave -> Validating -> Enter
Any help explaining what is going on would be greatly appriciated.
|
|
|
|
|
Morrgan wrote:
for the UserControl to function correctly it is necessary to give it focus when errors are corrected during validation.
Why? By doing this, you're breaking an already fragile sequence of events.
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|
I decided to skip the entire error correction phase. It was necessary to give the UserControl focus since it contains a third-party control which crashes when performing certain operations while unfocused.
|
|
|
|
|
Hi all,
How to write a windows service that will display a MessageBox "hello" everytime the OS starup, or display a form, or run Program at the startup.
Cuz i want to write a small program that will run at the startup, but dont know how ^_^. I try the sample in MSDN but it's doesn't work !
|
|
|
|
|
hi,
Easiest way to run a program is add application to the startup directory..
In addition,You can give this option when building setup to the Application exe.
(for example installshield express setup wizard will do it for you)
regards ,
pubudu..
|
|
|
|
|
lol, that not the way i want ! i just want it run at the startup and dont appear on the startup directory, so how ????
|
|
|
|
|
Hello every body,
I know C and a little OOP and C++. What should I do for starting C#? Should I learn OOP or C++ at first? Give me some reference, please.
Best.
|
|
|
|
|
|
A beginner's book for C# would not be a bad idea either
Regards,
Polis
Can you practice what you teach?
|
|
|
|