|
If that's all I'm doing I use the second, but with more line breaks.
I wouldn't be concerned about the relative efficiency of those particular statements; particularly when dealing with a GUI.
But that's just me.
|
|
|
|
|
I had written code to create excel chart sometime back. Thanks to poor documentation I had done, I cant recall significance of "-4167". Can anyone help? Here is the code block:
objClassType = Type.GetTypeFromProgID("Excel.Application");
oExcelApp = Activator.CreateInstance(objClassType);
oProcess = System.Diagnostics.Process.GetProcessesByName("EXCEL");
oWorkBooks = oExcelApp.GetType().InvokeMember(
"Workbooks", BindingFlags.GetProperty, null, oExcelApp, null);
oArgs = new object[1];
oArgs[0] = -4167; <--- this one right here
oExcelWbk = oWorkBooks.GetType().InvokeMember(
"Add", BindingFlags.InvokeMethod, null, oWorkBooks, oArgs);
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
|
|
|
|
|
Tut tut - a google search for 'excel 4167' only returns 191000 results! It looks like -4167 refers to the type of a worksheet object.
It definitely isn't definatley
|
|
|
|
|
I have tried and still trying to search it. Still no success.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
|
|
|
|
|
This search[^] worked fine for me - note that I didn't search for '-4167' as excel would then search for pages that didn't contain 4167. The first link has the detail I mentioned.
It definitely isn't definatley
|
|
|
|
|
Hunted[^]
I recommend this[^] article to myself.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
|
|
|
|
|
I only pass 1 argument to the workbooks.add method, and it's a path string to the template file.
addMethodInfo = workbookType.GetMethod("Add");
addMethodInfo.Invoke(_workbooksObject, new Object[] { template })
Perhaps the -4167 is just there to confuse you.
Simon
|
|
|
|
|
I had written it hence was wondering why. Found it now.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
|
|
|
|
|
lets say i have a dll which relies on nhibernate or log4net. And within this dll there're calls which references these external library (nhibernate/log4net .. etc).
To be specific, and as an example I may have a dll (say it will be referenced by a ASPNET app AND a Winform App) and its app.config file look like this:
<configuration>
<configsections>
<sectiongroup name="spring">
<section name="context">
type ="Spring.Context.Support.ContextHandler, Spring.Core"/>
<section name="objects">
type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</section></section></sectiongroup>
<section name="nhibernate">
type="System.Configuration.NameValueSectionHandler, System,
Version=1.0.5000.0,Culture=neutral,
PublicKeyToken=b77a5c561934e089" />
<section name="log4net">
type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</section></section></configsections>
<spring>
<context><resource uri="config://spring/objects" /></context>
<objects>
</objects>
</spring>
<nhibernate>
... nhibernate config ...
</nhibernate>
<log4net>
... log4net config ...
</log4net>
</configuration>
I want avoid having to copy app.config setting from my DLL when I reference my DLL from a console app this time, then next time to a ASPNET or WebService. Each time having to merge/cut/paste app.config (from Dll) seems like a waste of time.
Thanks
dev
|
|
|
|
|
What you can do is place config sections in a separate config file. Then you can copy the file as a whole rather than copy and paste sections of your app/web.config file.
In your app/web.config file you can refer to the other file like this:
e.g.
<connectionStrings configSource="data.config" />
|
|
|
|
|
|
|
|
|
amardeep deshmukh wrote: I will display all the versions of application installed on the clients machine- By looking in the Registry
How do you find the application from the registry? Do you use HKEY_CLASSES_ROOT?
|
|
|
|
|
|
Now we are a bit off from my area, but if you know either CLSID or ProgId, there are functions for COM like ProgIDFromCLSID and CLSIDFromProgID. However, I don't know if they work for the guid in Uninstall-path. I've understood that for example Microsoft Office is just one entry in Uninstall but it has several com components for all products (word, excel etc).
AFAIK installer keeps it's own inventory under HKEY_CLASSES_ROOT\Installer\Products. Also all CLSID's are under HKEY_CLASSES_ROOT\ClSID. In products folder most products have Transforms entry and the guid in that seem to reference to the installation folder in SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.
That's about all I could come up with.
|
|
|
|
|
|
amardeep deshmukh wrote: I got the workaround to this problem
Very good
|
|
|
|
|
Hi
I am having a problem with the order of the columns in my data grid. I have set the order I want in the data grid property Edit Columns. When I run the project 2 columns are way out of position. I tried to move the out of position column using column order but it is ignored. I then tried coding the position using event private void GridDisplayOrder(). I listed all rows in order from left to right. I get the message object reference not set to an instance of an object. Not sure how to get around this error. Here is the event I use
private void GridDisplayOrder()
{
Grid_Property.Columns["pContract_NO"].DisplayIndex = 0;
Grid_Property.Columns["pProperty_ID"].DisplayIndex = 1;
Grid_Property.Columns["pVersion"].DisplayIndex = 2;
etc
etc
any assistance would be appreciated
modified on Thursday, January 8, 2009 10:55 AM
|
|
|
|
|
Hi
Currently i am doing the SVN commit and SVN update of TortoiseSVN in directory folder alone. Instead of doing this. how to do same thing in VS2005 IDE.
Please help
Gopal
|
|
|
|
|
Gopal_Kanchana wrote: how to do same thing in VS2005 IDE.
You need VisualSVN[^] which is a plug in for Visual Studio.
|
|
|
|
|
I am going to create a custom control and want to add an ability. When it get focused then It appearance should change through GDI.
for example I am creating custom label.
Then how will i get my target.
Problem is that I am only able to change the object at Paint event, here I can make changes to my object through GDI but I want When my object get focus or it is being clicked then I want to make changes via GDI.
Any hint will be appreciated.
|
|
|
|
|
can you not just invalidate the control when you handle other events such as click?
userControl1.Invalidate();
this will cause the control to repaint itself, in which it will call the Paint event
|
|
|
|
|
is it C# support macro like c++? if not Why ? is it any standard they are following.
In C++ we can do MUL(X,Y) X*Y like this.
|
|
|
|