|
C# cannot compile down to native, that would defeat the object of the .NET Framework. Thus, yes, if you want to run a C# program on a PC other than the one you compiled on, you have to install the .NET Framework.
Paul
Why don't you take a good look at yourself and describe what you see - Led Zeppelin, Misty Mountain Hop
|
|
|
|
|
If you try to run a .NET app on a computer with no .NET run-time installed, then you get a dirty message box saying "missing mscoree.dll". This DLL is launched from the PE and hosts the CLR.
If the computer has a .NET run-time, but in a wrong version (it will happen as soon as .NET 1.1 is RC), then you'll get an explicit message box "cannot find C:\WINNT\Microsoft .NET\Framework\v1.1.0.3800".
( in this scenario, the user may try to launch the app with his .NET run-time thanks to either the creation or modification of an associated .config file in the same directory. Of course, if the app was compiled against .NET 1.1, there is no strict guarantee is works against a .NET 1.0 run-time just because you would change a config file).
And about native generation, the JIT produces native code. Use ngen.exe. With .NET 1.0, you must explicitely use ngen.exe in a separate cmdline, because there is no direct support of this in the IDE. ngen myapp.exe will generate a native image of the managed code in myapp.exe, and put it in the GAC (c:\winnt\assembly) ready for use.
How low can you go ? (MS retrofuck)
|
|
|
|
|
I was afraid about that...Thanks Paul and Stephane. Java can be compiled in class or native code..I hope C# will be able of the same thing later...
|
|
|
|
|
I'm trying to get a form to pop-up when the user presses a hotkey. So far the form pops up OK, (I'm registering the hotkey, and issueing a form.Show(); from within a WndProc method that ). But the form that I show doesn't get keyboard focus...
Dave
|
|
|
|
|
Have you tried Form.ShowDialog(this); ?
Paul
Why don't you take a good look at yourself and describe what you see - Led Zeppelin, Misty Mountain Hop
|
|
|
|
|
Yes, it still doesn't get the keyboard focus.
|
|
|
|
|
Well that's odd. What does get focus? If the new Dialog is owned by the old one then the old one surely can't retain focus... can it?
Paul
Why don't you take a good look at yourself and describe what you see - Led Zeppelin, Misty Mountain Hop
|
|
|
|
|
I've spent some time experimenting with this, and unfortunately don't have a solution, but maybe a better characterization of the problem...
What I do is register a hotkey then minimize and hide my main application window after a few seconds. This causes whatever application had focus prior to starting my main application to regain focus.
When I press the registered hotkey, I'm able to pop up a form, but it doesn't get focus.
In general what I'm trying to do is create a hotkey that will pop-up a form that is activated no matter what application had focus previously.
This might not be relevant, but there is a strange situation when there is no active application on the desktop. In that case, my applcation seems to have focus, but I need to press Tab to have the first control get keyboard focus.
|
|
|
|
|
Aha! Now I understand the problem. You're giving focus to another App by minimizing but expecting to get it back automatically when you open a new dialog. Of course if you have nothing to give focus to, it will go to the desktop and when you start up a new window the desktop will give it back.
I think the answer to your problem is this.Focus() , probably in your pop-up app's Form_Load() event.
Paul
Why don't you take a good look at yourself and describe what you see - Led Zeppelin, Misty Mountain Hop
|
|
|
|
|
Thanks, unfortunately I've tried that... and this.Activate() as well... It seems to be a problem related to some other application having the keyboard focus.
|
|
|
|
|
FWIW I've gotten this working. I did a "zero based" example to try to demonstrate the problem in the simplest way possible. I discovered that the loss of focus was caused by a custom control that was on the pop-up form. It was a very simple control that extends TextBox so that it will capture and process enter and escape keys. Still don't know why THAT is failing...
Thanks much for your help!
Dave
|
|
|
|
|
Dave,
I've only just noticed your last reply, I don't know how I missed that. However, I'm glad you figured it out and thanks for letting me know how, for future reference.
Paul
Why don't you take a good look at yourself and describe what you see - Led Zeppelin, Misty Mountain Hop
|
|
|
|
|
Hi,
I seem to have a problem with a debug version of a DLL that i am calling. It enteres the function OK and goes to the end but when the function returns it tries to store the return value of the functoin in the register ESI from EDX. Visual C# then throws an access violation error. It works fine in release mode and uses the same registers.
Has anybody seen this before and know how to resolve the issue.
Thanks
Ceri
|
|
|
|
|
Ceri wrote:
Has anybody seen this before and know how to resolve the issue.
Not exactly but I have had similar problems before, there are often vast differences between debug and release versions that you don't see.
For example, I've written DLLs for Windows Installer using VC++ which work fine in debug mode and not in release mode. When I switched the release mode optimisation off, it worked fine.
If possible, it's worth looking at the differences in the commandline options for the DLL in release and debug mode and adjusting them until they both act the same way. Then at least you'll know what is causing the problem.
Paul
Why don't you take a good look at yourself and describe what you see - Led Zeppelin, Misty Mountain Hop
|
|
|
|
|
Don't see the relation with C#, appart the fact C# is hosting your client.
Try compiling the DLL by changing the signature of methods (__cdecl, __fastcall, ...) : Project settings / C/C++ tab / code generation / calling convention.
From what I remember, the return value is always stored in EAX.
How low can you go ? (MS retrofuck)
|
|
|
|
|
Hello,
I'm currently playing a lot with the WebBrowser control and C#. I made several programs interacting with the DOM of pages I use for testing.
One of my programs traverse the DOM tree of a page, find all the images tags and click on them. Nothing really fancy .
My point is sometimes when I click on an image a JavaScript is called in the page and this JavaScript opens a messagebox using window.alert.
The problem is that I want to execute the scripts but disable those modal messageboxes who freeze my program.
My question is: how to disable the window.alert function ? Or how to intercept a window.alert call ?
I explored the window object and I think you can't not change the window.alert default behaviour.
Thanks,
R. L.
|
|
|
|
|
A very crude method would be to read in the script before clicking the image and then remove, or comment out any calls to window.alert
What do u think?...too much work maybe
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
Hello,
Thank you for your idea but it is note very nice.
I would prefer a solution:
- to redefine the window.alert behaviour and cancel the opening.
- or to catch all the modal messageboxes opening from IE and close them.
Any idea ?
R. L.
|
|
|
|
|
html filter proxy
How low can you go ? (MS retrofuck)
|
|
|
|
|
Hello Stephane,
Thanks for answering me again.
Your solution sounds good but what is the technical meaning of this term ?
I apologize for my lack of knowledge .
I'm starting to search about html filter.
R. L.
|
|
|
|
|
html filter proxy[^]
No need to tell me that's exactly what you are looking for. I know.;P
How low can you go ? (MS retrofuck)
|
|
|
|
|
Overkill i think
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
My value-object, one like:
[SerializableAttribute]
class sealed class TableNameAsTheClassName
{
private int FieldNameAsTheNumberName_id;
Private string FieldNameAsTheNumberName_name;
public int ID
{
get { return FieldNameAsTheNumberName_id; }
set { FieldNameAsTheNumberName_id = value; }
}
public string Name
{
get { return FieldNameAsTheNumberName_name; }
set { FieldNameAsTheNumberName_name = value; }
}
}
I will transfer this object between data-access layer and business layer from both side. Need it to support strongly named assembly and ApplicationName assemply?
I know if it needs ApplicationName assemply, it has to support stronly named assemply first. Thanks ahead!
|
|
|
|
|
I am trying to figure out how to detect when a popup menu is "showing" and when it is not. I know that the context menu has the popup callback, so I can tell when it is poppuped up, but I can't figure out how to tell if the user gets rid of it w/o clicking on one of the buttons in the menu.
Any thoughts?
Darryl Borden
Principal IT Analyst
darryl.borden@elpaso.com
|
|
|
|
|
Context menus also respond to the disposed event. I'm not sure when exactly this is called, but if it is called when the menu disappears couldn't you set a flag on the popup event and clear it on the dispose event? Then you could use it tell if the menu is currently open?
Just a guess since I've never had cause to do this.
|
|
|
|