|
Hi all,
Normally the application config file name is app.config, but in my application have many application config file so I want to change it to xxxx_en.config or xxxx_fr.config for each module(DLL file), for each language
thanks,
cuong
|
|
|
|
|
|
Hi!
I created a "thin client" for a web service -- basically a simple C# Windows Form that connects to the web service and let the user interact with it.
Now I'd like to deploy that, but to make it easy for the client, I would prefer if they could simply download and execute the exec from a web page instead of having to install it using a Windows Installer (I used to create one using VS7 before).
Basically I'd like to have an ActiveX-like or Java applet-like deployment style for my windows form.
Does anybody think that is possible at all?
R/
|
|
|
|
|
|
Thanks, exactly what I needed!
I love MSDN, there's a lot of material there, yet I fear it because there's too much interesting stuff to read
|
|
|
|
|
Once upon a time (VS 6) I used to be able to copy a dialog resource from another project into my current project. As I get my feet wet with VS.NET 2002 I'm lost trying to figure out how to do it.
From what I gather, I can "Add Existing Item" from the project menu, but this ends up incorporating the whole RC file from my other project including any other dialogs, bmps, icons etc.
What I now have is a xyzDlg.cpp a xyzDlg.h and the dialog resource itself located in a .rc file. How on earth can I make a COPY of this dialog item so I can use it for my .NET app?
Note, I need to copy this resource not incorporate anything from the other project. I can't risk damaging the other VS6 project and it's (the other VS6.0 project) going to be archived off-line as soon as I have a copy so I don't somehow currupt it.
I feel awfully stupid, this should be easy. Help?
PAC
|
|
|
|
|
Under VS6, I simply used to open both RC files (the current project and the one to import from), then simply Control-C the dialog template and Control-V it into the new RC. Then copyied the .cpp/.h manually and inserted in the project manually.
I believe that may work with VS7 too but I haven't tried in a while.
|
|
|
|
|
Actually, it kind of works and it kind of doesn't.
I've been playing all day and have got the dialog resource in, but it's different.
With VC6 you could open the other rc file, hit copy then paste directly into the resource tab in class wizard.
With the new VC.NET all I've been able to figure out so far is open both old and new rc file in the editor and do a copy/paste.
The bad part is I still haven't been able to figure out how to link the cpp and h files with that dialog resource. If you run their wizard and tell it to use the old cpp and h files it just tacks on a new class at the bottom of each file resulting in two sets of implementations and declarations. <sigh>
Obviously there has to be a way to do it, but it sure is kicking my behind
PAC
|
|
|
|
|
Hi
We would like to know how many CPU resources a running
process is using.
The problem is that we would like to know the resource use
without the CPU resources used on associated I/O
operations.
Does any of you know of a performance counter that will
allow us to gather data about CPU resource use excluding
associated I/O operations?
Thanks for your help,
Mads Jensen
Mads Jensen
|
|
|
|
|
You could write your own preformance counter to count only the information that you need within your product.
|
|
|
|
|
I'm working on the basis for a CodeProject article, but stuck on a couple of issues. The current problem is as follows: I have to dynamically create a method that can be used as an event handler for a particular event, given only the EventInfo object that represents the event. This includes a reference to the type (subclassed from Delegate and accessed through the EventInfo.EventHandlerType property) that is created to represent the method in delegate form. However, there doesn't seem to be an obvious way to read out the desired method form (parameters & parameters' types, return type, etc.). Does anyone know how to get this method semi-signature out of the <vode>EventInfo, the event handler Type , or anything else that's dynamically accessible through the framework (almost certainly through Reflection)?
Thanks!
Eric Astor
|
|
|
|
|
This might get you on the right track:
Assembly assembly.LoadFrom("my_assembly.dll");
Type type=assembly.GetType("my_class");
MethodInfo mi=type.GetMethod("my_method");
Using MethodInfo, you can inspect the security, return type, parameters, etc. Lots of fun.
[edit]Oops--LoadFrom, not GetType[/edit]
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
|
|
|
|
|
I already understand this much of Reflection, but that doesn't help me... I need to dynamically create a method without ever actually seeing any method, only an EventInfo object or something that it publicly exposes a reference to.
|
|
|
|
|
I'm not really sure if this will help, but I use this to dynamically create a delegate:
public delegate object InterfacePoint(EventData eventData);
...
void RegisterInterfacePointByReflection(object instance, string fncName)
{
Type ipType=typeof(InterfacePoint);
InterfacePoint ip=null;
ip=Delegate.CreateDelegate(ipType, instance, fncName) as InterfacePoint;
}
You have to have an instance of the object containing the event sink though. If you don't have an instance, you have to pass CreateDelegate a MethodInfo instead.
Is THIS anything closer to what you need? If not, can you give me an example of what you have and where you want to go with it? (Gee, that sounds a lot like a Microsoft tag line).
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
|
|
|
|
|
Alright... What I'm working on involves the dynamic creation of a wrapper class (through use of the Emit namespace) around a provided class that I see only as its Type object representation. As part of building the wrapper class, I need to emit methods for each event of the original class such that each method fits the requirements to be used in the delegate type used for the targeted event. Unfortunately, I can't seem to find any way to pull out anything that I could use to dynamically discover the required method signature for the creation of a method that can be used in the initialization of a provided delegate. The primary thing available to me with respect to the event is the EventInfo object, but the only thing that that exposes as to the event handler required for it is the Type object representing the class that inherits the System.Delegate class. This is a Type object like any other, and I can't find any way to pull the method signature out of it that it wants for its instantiation.
|
|
|
|
|
I think this is what you are looking for
public delegate void SymEventHandler(Symantic type, ParserContext context)
{
public SymEventHandler(object object, IntPtr method);
public virtual IAsyncResult BeginInvoke(Symantic type, ParserContext context, AsyncCallback callback, object object);
public virtual void EndInvoke(IAsyncResult result);
public override void Invoke(Symantic type, ParserContext context);
}
Lookup the Invoke method with Reflection.
<a TITLE="See my user info" href=http:
|
|
|
|
|
Looking up the Invoke method with Reflection is exactly what I needed... I really appreciate your help.
|
|
|
|
|
Hi!
I'm creating a WinForm to display data from an XML Web Service. Typically in the WinForm constructor, after the call to the VS designer's InitializeComponent(), I initialize the controls of my form. Problem is, that takes quite a while and because the form is not yet visible when the constructor is called, the end-user feels like the app is not working.
So instead, I'd like to delay my initialization till after the form has been fully displayed, but I have yet to find an event for that in the Form class. OnLoad explicitly says it is generated befor the form is displayed. OnActivate doesn't seem to go thru...
As a last resort, I could have the form post itself an event, and hope the app gets it once the window is finished displaying.
Any better non-hack solution?
TIA
R/
|
|
|
|
|
Have you tried putting in a "Show()" prior to the InitalizeComponent()? In a simple test it seems to work here in that I can set a breakpoint at InitalizeComponent and it has the window already shown.
public MyForm()<br />
{<br />
Show();<br />
InitalizeComponent();<br />
}
You might want to make sure to set the window size prior to showing it with the:
ClientSize = new System.Drawing.Size(x,y);
Rocky Moore <><
|
|
|
|
|
But then won't the form show first without any controls on it?
I wonder what the redrawing will do to performance.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
I think so too.
I ended up placing the initialization call in the Activated event of the form. Experience shows that the form starts displaying, some items are partially visible and some are not (sounds like the message pump not having time to finish redrawing everything).
It's not ideal but it's a better user experience -- the classical Windows Application not refreshing because of some heavy computation is of course not the desirable effect but something end-users can understand
R/
|
|
|
|
|
I misunderstood what you were asking for. I thought it was the fact that the form did not appear at all on the screen so they saw nothing happening.
To have your form come up and display prior to your own initalization code, try this in your constructor:
public MyForm()<br />
{<br />
InitializeComponent();<br />
Show();<br />
foreach(Control control in this.Controls)<br />
control.Refresh();<br />
<br />
}
Rocky Moore <><
|
|
|
|
|
Interesting approach but 2 questions come to mind:
- Isn't Show() suppose to display the dialog modeless? What's the impact of the caller using ShowModal() later on?
- I naively assumed this.Refresh() would do the equivalent of the foreach(Controls)...Refresh() loop, doesn't it?
Definitely worth trying anyway, thanks!
R/
|
|
|
|
|
Yes, if you are using ShowDialog, before you call that you would have to either call Hide() or visible=false which will cause a little flicker.
I did not bother trying the member refresh since I thought it might delay the refresh of the controls but it does the same.
If you initialization code is very long you could also just have one control that you refresh (only one that would show) that would have a message like "one moment please", which would inform your using that something is happening so that even if they do see your form they will not try to access it until your initalization is over. Once your initailization is over, you can hide that one control and do your Hide and ShowDialog.
Rocky Moore <><
|
|
|
|
|
Use CreateHandle() instead of Show(), but is still feels like a hack to me too.
--
-Blake (com/bcdev/blake)
|
|
|
|