|
Hello,
That's right, reference to your executing assembly is not possible.
In this case you should better create for examle an Interface Library, where you define an interface which the mainform implements.
This interface has to have, all the important Props and Methods you need in the FormoftheLibrary.
Your FormoftheLibrary constructor can than use this Interface class.
Hope I helped you a bit.
All the best,
Martin
|
|
|
|
|
Thx for your help.
Isn´t there any other way to get acces to the variables of the executable form? Maybe to get the Form via System.Reflection?
I mean, other Programs use dlls as well and I can´t believe that´s only unidirectional.
For example if you write a plugin for a programm and have to access variables of the mainprogramm.
There should be a more elegant way, at least I hope so.
Suggestions are welcome.
|
|
|
|
|
Hello,
Yes you could use reflection to get the type infos.
ezazazel wrote: There should be a more elegant way, at least I hope so.
But I think it's not more elegant than using interfaces.
All the best,
Martin
|
|
|
|
|
I have an existing C# application, and I'd like to add the ability to automate several web sites. I would be automating them in the background (not by automating a visible IE window) - filling out forms on the sites and posting them and navigating through the results by automating button presses on the pages - then extracting the HTML for display in my app. I'm trying to be brief here - let me know if you need more specifics on what I'm doing...
I searched CodeProject and found several controls for doing this - some new, some old. The most promising looked like the ExplorerManager object, but there was also the MSHTML object, DHTMLDocument, and the .Net 2.0 WebBrowser object. Not having used any of these, I'm not sure what the pros and cons would be for using each in my application.
Can someone please advise?
Thanks!
- Dave
|
|
|
|
|
AFAIK the .NET 2 browser is the most capable of the lot although there are one or two peculiarities which it has which MSHTML & DHTML DOMs don't.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
|
Dave T wrote: Ok, thanks. Can you tell me briefly what the peculiarities are?
I could if I could remember, but they were fairly obscure from what I remember.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
I am currently creating a little C# project which interrogates a webserver (quite alot).
I would like to perform Http-Tunneling in order to have different IPs query the server, but with all the responses sent to me.
Alex Turc has written something which I think is very relevant here:
href="http://www.codeproject.com/internet/httptunneling.asp
The problem is that this is in C++ (and quite frankly, very incomprehendible/followable to me!)
If anyone has a solution / something similar but in C# I'd appreciate the help so much.
Many thanks!!
Gerry
www.thecrazywebsite.com
|
|
|
|
|
I cant disable special key.(ctrl + alt + del , etc.) I use C#.NET 2005. Please tell us about that.
Ps. I can speak english a little.
Please help ME!!!
|
|
|
|
|
MS say that you can't trap this key hence they reason it's more secure to log on using that combination, so I'm afraid you're stumped.
But then again maybe someone does know of a way...
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
See: Lock Windows Desktop[^]
This isn't C# code, but could easily be converted.
Ctrl+Alt+Del
There are several ways to disable this key combination:
1. Disable Task Manager. This doesn't trap the key combination, it simply disables the application (Task Manager) that pops up when this key combination is pressed. See below how to do this.
2. Trap the keys using a keyboard device driver. For this, you need the DDK installed. I will not describe this method here.
3. Write a GINA stub. GINA is the DLL that Winlogon uses to perform user authentication. I'm not going to discuss this method here, but you can find out how to do it here [16].
4. Subclass the SAS window of the Winlogon process. For this, you must inject code into the Winlogon process and then subclass its Window Procedure. Two techniques for doing this are described later.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I Dont have GINA.DLL. Where I can find it.Please tell me. T_T
|
|
|
|
|
Look for msgina.dll
Read this too[^]
But, this method is among the more complex. I hope you realize that Windows is quite often unstable even when left alone. What you are trying to do is only adding fire to the flame. I suggest picking a less obtrusive method.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I Cant convert c++ to C#.Because It is VS6 Source code. Can you convert it? Show me for example,please.
ps Thank you sor much for every one.
-- modified at 0:55 Wednesday 23rd August, 2006
|
|
|
|
|
I don't have time to convert the code, but you could just use Antonio Feijao's WinLockDll.dll.
using System.Runtime.InteropServices;
...
[DllImport("WinLockDll.dll")]
public static extern int CtrlAltDel_Enable_Disable(Boolean bEnableDisable);
...
CtrlAltDel_Enable_Disable(false);
Nice and easy.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Thank you...So muchhhhhhhhhhhhhhh. but I don't know any function about other key. alt +tab, alt + f4, ctrl + shift + esc ,win key etc. tell me for how to use function for that key in c#. Thank you.
-- modified at 12:35 Wednesday 23rd August, 2006
|
|
|
|
|
hi all....
Is there any testing tool available for testing the performance of a Desktop Application or windows Application developed in C#.net2005...
Thanks in Advance...
|
|
|
|
|
You can use the free CLR profiler[^] by Microsoft to profile the memory usage of your application, which affects performance. You can use the NPerf Framework[^] to write some performance tests in an NUnit-like fashion.
For more advanced things, there are some good 3rd party .NET profilers that tell you how long each line of code is taking. The one we use at work is ANTS Profiler[^], which give you per-line timings.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Dumbest. Movie. Title. Evaaar.
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Dear colleagues,
I have a simple question to the following function
void fct<t>( T x) {
is x numeric???
}
How can I determine if a variable x is numeric type ( char, short, decimal, double ...)?
With kind regards ! ! !
|
|
|
|
|
|
|
Knowledge Base
HOW TO: Implement Visual Basic .NET IsNumeric Functionality by Using Visual C# .NET
This step-by-step article describes how to use the Microsoft Visual Basic .NET IsNumeric function in Visual C# .NET. The IsNumeric function returns a Boolean value that indicates whether an expression can be evaluated as a number. The IsNumeric function returns True when the data type of the expression is Short, Integer, Long, Decimal, Single, or Double. It also returns True if the expression is a string that can be successfully converted to a Double.
Create the IsNumeric Function
In Visual C# .NET, you can use the Double.TryParse method to obtain functionality that is similar to IsNumeric. Double.TryParse
converts the string representation of a number in a specified style and culture-specific format to its double-precision floating point number equivalent. To create the IsNumeric function:
Start Visual Studio .NET. On the File, point to New, and then click Project.
In the New Project dialog box, click Visual C# Projects under Project Type.
Under Templates, click Console Application, and then click OK. By default, Class1.cs is created.
At the end of the Class1 class, add the following code for the IsNumeric function:
static bool IsNumeric(object Expression)
{
bool isNum;
double retNum;
isNum = Double.TryParse(Convert.ToString(Expression), System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out retNum );
return isNum;
}
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
With the same table of MS Access Database I can retrieve sucessfully most of the record by comparing records with strings. But when I try to search records comparing with DateTime I always catched errors! Here are my trial SQL's for searching from 1st Jan 2006 to 2nd Jan 2006:
<br />
strSQL = "SELECT * FROM Table1 WHERE DayStart >= '20060101' AND DayEnd < '20060103' ";<br />
or
<br />
strSQL = "SELECT * FROM Table1 WHERE DayStart >= #01/01/2006# AND DayEnd < #03/01/2006# ";<br />
The same later SQL worked perfectly with VB.net (same table)
Many thanks for any help
|
|
|
|
|
I am in the planning phase of developing a 3D feature in a C# gui project. It is supposed to run as a window inside a C# MDI GUI. I was planning on using OpenGL for this as I have some knowledge of it from an earlier C++ project. Is it possible to code OpenGL with C#? I have read a little about the Tao project.
Another thing is to have some sort of scene graph so I thought of OpenSceneGraph.org, but this is written in C++. Is it possible to develop the 3D application with OpenSceneGraph as managed C++ and run it inside the C# MDI GUI?
- Atle
|
|
|
|
|
Atlemann wrote: Is it possible to code OpenGL with C#?
Yes, the Tao project does exactly this.
Atlemann wrote: Is it possible to develop the 3D application with OpenSceneGraph as managed C++ and run it inside the C# MDI GUI?
Sure, you can wrap the native C++ calls with C++/CLI calls that are visible to all other .NET languages.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Dumbest. Movie. Title. Evaaar.
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|