|
Hi everyone,
Although being a great fan of this site it's only the first time that I write to one of its forums.
The problem I am facing and forced me to do so, is that I cannot understand (find a reference or sth) how I can replicate what "E&xport to Microsoft Excel" is doing. This is an extension of the right-click menu of Internet Explorer, which is set by inserting a new key under [HKCU]->Software->Microsoft->Internet Explorer->MenuExt, and is used to call the Excel's resource 3000 to export html data to an excelsheet. Is it simply a resource in the executable (e.g. a windows form declared as a resource)? How does it take the argument? Is there anywhere any sample code doing the same thing? I would like to do the same with an executable of mine.
I've tried searching around, but I was unable to find sth in relation
Could you please assist me?
Kind Regards,
G.
|
|
|
|
|
I have a collection class that I've derived from List<MyClass>. I've added no extra functionality to this class except a constructor that clears the list. My problem is this: I'm using the collection in MyClass (the same class that the list is typed for) and I'm doing this
col.Add (this);
No problem there it adds the class just fine. The problem arises when I run the code again (it's in a loop), what's happening is that the previous values in the list are changed to the new values that the class has taken on. In effect, if I run the loop, let's say, 5 times the List<> has 5 items in it, but they all have the exact same values.
Does anyone have any ideas as to how I can defeat this? I'm thinking there's something better I could be passing into the Add function, but I'm not sure what it would be. I was also thinking I could override the Add function in my derived collection class and create a deep copy of the this parmeter that I passed in, but I'm not sure if that's the right idea.
Any ideas and/or help is very appreciated. Thanks.
- Aaron
|
|
|
|
|
Can you make MyClass a struct? That way, it'll behave exactly as you want it to. The only other way is to clone the object, using MemberwiseClone or your custom deep cloning code.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi,
yeah I need to know how to create an instance of a control programatically. I know one can do soemthing like "TextBox tb = new TextBox();" but this has to be done in the initialization section fo the class, and if it's written within a method, it's only available for within that method. But this isn't the main problem, the main thing is that I don't necessarily know how many of a certain control will be needed, so how do I create new control on demand with a name either generated, or taken from user input via a textbox or something?
Thanks,
Stephen
|
|
|
|
|
MSDN[^] has a good article.
|
|
|
|
|
This article doesn't work. I think something between vs '03 and vs '05 has changed. It wants me to create a ButtonArray, which does not exist. Here is what they have in the example:
ButtonArray MyControlArray;<br />
MyControlArray = new ButtonArray(this);<br />
MyControlArray.AddNewButton();<br />
Well seeing how the ButtonArray thing doesn't exist, I can't really do anything with this. How do I go about creating control collections in visual studio 2005?
|
|
|
|
|
Hi all!
I did do a application with Visual C#.My aim is start this application at each beginning windows.
For of this,i am writing value to "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" registry key.
My codes is those:
/*line-1:*/if(Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run",true).GetValue("clnv1")==null)
{ Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run",true).SetValue("clnv1",@"C:\WINDOWS\system32\clnv1.exe");
}
My application is starting at beginning windows.But right now shows warning!!!(on line-1)
Warning is that:
An unhandled exception of type'System.IO.FileNotFoundException' occurred in mscorlib.dll
Additional information: Could not find file "clnv1.exe".
Please help me!!!
-- modified at 20:36 Saturday 24th December, 2005
|
|
|
|
|
Friends,please help me!!!
|
|
|
|
|
I don't get it, does your app run fine if you start it normally? I find it strange that you get a FileNotFoundException on the exact file that you're currently executing. Are you trying to launch it again from within the executable?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
hi my name is zubair i am making an application for IP telephony
so i want to get input from MIC so how i can accomplish it in C#
thanks
Zubair Asghar
|
|
|
|
|
i'm using MIL-parser libarary which i get this libarary from code project site
i'm trying to select data from the axWebBrowser and trying to find in the parsed tree but some data found and another not found
f any one can help ???
|
|
|
|
|
Is it possible to get .NET types using some C# code? For example:
<br />
private void InitializeTypes()<br />
{<br />
cmbBlah.Items.Clear();<br />
<br />
foreach (NetType nt in GetNetTypes())<br />
cmbBlah.Items.Add(nt.ToString()); <br />
}<br />
?
tnx in advance
|
|
|
|
|
The NetType you're talking about is actually System.Type[^] . You can get it using Object.GetType[^], Assembly.GetTypes[^] etc. For example, if you want to fill a combobox with all public types in your assembly, you can do:
using System.Reflection;
private void InitializeTypes(){
cmbBlah.Items.Clear();
Assembly currentAss = Assembly.GetCurrentAssembly();
Type[] publicTypes = currentAss.GetExportedTypes();
foreach (Type type in publicTypes){
cmbBlah.Items.Add(type.ToString());
}
}
Welcome to the wonderful world of reflection!
Merry Christmas!
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
After a bunch of ASync socket calls, I get the exception below. Google-ing it came up with only 4 hits, 2 from the same person, none with answers.
This is happing in a server application, so if no one has a solution, is there another way to run a TCP server (average of 500 simultaneous, sustained connections. Max possible connections is about 5000, but VERY unlikely) without having a thread for each client, that would be great.
-------------------------------------------------------
"The Undo operation encountered a context that is different from what was applied in the corresponding Set operation. The possible cause is that a context was Set on the thread and not reverted(undone).".
at System.Threading.SynchronizationContextSwitcher.Undo()
at System.Threading.ExecutionContextSwitcher.Undo()
at System.Threading.ExecutionContext.runFinallyCode(Object userData, Boolean exceptionThrown)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteBackoutCodeHelper(Object backoutCode, Object userData, Boolean exceptionThrown)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
|
|
|
|
|
Update:
You can see my socket connection class code Here.
The exception occurs while executing a method in another class called from inside "OnDataRecieve".
-- modified at 5:35 Friday 30th December, 2005
|
|
|
|
|
My DataGrid is serviced by a DataTable. Suppose I would like to make a red background for rows 3 and 5 in this DG. How to make it?
|
|
|
|
|
hi all,
iam able to sending mails using SMTP sever..
but now,how can i send my inbox mails to my database?
can any one know it?
thanks in advance...
byeeeeeeeeeee
sree
|
|
|
|
|
How can i send file from computer A to computer B
|
|
|
|
|
Windows Sockets...
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
You must learn network programming for this.
TcpListener,TcpClient,Socket,NetworkStream Classes defined for network programming in Visual C#
This classes in System.Net.Sockets namespace.
|
|
|
|
|
I'm writing a program that does a lot of heavy computing. I eventually want this program to run as a screen saver. But because of all the heavy computer the program does, after a few minutes of running, the fan turns on - wasting energy and making noise, two things a screen saver shouldn't do.
So far I've tried various ways of putting the current thread to sleep for some time, to give the computer a rest, but I haven't had very much succes. Is there a better way to slow down my program or as least (safely) manage it so the fan doesn't come on?
Thanks,
Drausin
|
|
|
|
|
Fan? Which Fan?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
I think he means the fan on his processor - you know, the thing that cools it down and stops it from overheating.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
|
|
|
|
|
You could try modifying your process priority. I don't know if this will reduce the absolute processor load or if it's just relative to other processes...
Regards,
mav
|
|
|
|
|
You can try System.Threading.Thread.CurrentThread.Sleep(somemillisecondsvalue); in your working loop...
Merry Christmas!
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|