Jump to content
Xtreme .Net Talk

Legend

Members
  • Posts

    11
  • Joined

  • Last visited

Legend's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I have a C# program that opens an application object via a type library. I have managed to set up my own event handlers which fire when the application events trigger, but I would actually like to override those events, rather than just know that they have occurred. Anyone know whether this is possible (and how to do it?) Found this code which suggests it is possible, but I am looking for a tutorial or similar. The code actually looks relatively simple - appears you only need to know the GUID for the application (which I guess I can find), and the DispID - not sure where that is found?
  2. n/m. Apparently this is as per design, and it requires me to design and implement an interface.
  3. Hi, Want to create a COM library and access it using Office VBA. Created a COM typelibrary, compiled it to register with Interop, and it 'works'. However, all I can see in the object browser is the Class name. I can't see the name of any of the functions in that class. The functions can be called etc, and they work, but I can't see them and can't use intellisense. Any thoughts? Created in C# express edition. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace TestDLL { [ComVisible(true)] public class TestFunctions { [ComVisible(true)] public double AddValues(double value1, double value2) { return (value1 + value2); } } } Apparently ComVisible defaults to true, but I put that in anyway.
  4. Well, I still appreciate the input - and it helps me learn when I have to actually work out for myself what's going wrong!
  5. Yeah - finally realised that! System.Array result = System.Array.CreateInstance(Array1.GetValue(0).GetType(), Array1.Length + Array2.Length); (and a check that there is actually and element(0) in the array....
  6. Hmm. For some reason, that's creating an instance of {byte[][]} type array, when passed a {byte[]} array. Not sure why - the debugger is quite clearly showing that Array1 type is {byte[]}. Maybe I should bo it explicitly and overload the JoinArray function for the different types that I might be using?
  7. Fantastic - thanks. I haven't tried the second method, but I'll give it a go tonight. The 'CopyTo' method is the sort of thing I was looking for - I was thinking that I was going to have to enumerate the array elements and copy them individually (or work with some horrendous copymemory hack like I used to do for VBA :()
  8. Does the .Net framework have any built-in support for joining arrays? I couldn't find anything useful, and the things I tried didn't work. Is the only way to do it by adding each individual element? byte[] bFirstArray = new byte[6] { 1, 2, 3, 4, 5, 6 }; byte[] bSecondArray = new byte[6] { 7, 8, 9, 10, 11, 12 }; byte[] bThirdArray = null; //bThirdArray = (byte[])(bFirstArray.ToString() + bSecondArray.ToString()); //Doesn't work. //bThirdArray = new byte[] { bFirstArray, bSecondArray }; //Doesn't work.
  9. Its just tidier. One of the buttons is for looking at archived files - not all users will have access to the archive, so why even show them the button? That's not really the point though - buttons that are visible all the time don't have the captions showing up.
  10. Excel also has a WorkSheets.UsedRange property that is useful if you're only interested in cells with data in them.
  11. We produced a utility program, and got this feedback from someone who installed it on their PC. I can't for the life of me work out what could cause this... Now - these buttons are just standard windows forms. The button captions are defined at design-time, and the only issue with them is that a couple get hidden then unhidden. I really have no idea about this - any thoughts? :confused:
×
×
  • Create New...