You've got OLE components with progids such like Excel.Sheet and Excel.Chart (you probably already know the Excel.Application progid, which in turn launches Excel).
These are OLE components, not ActiveX controls. That's why they don't appear in the IDE (customize toolbox for instance).
But they are here and ready. For instance, They appear when you are in Word, Insert \ Object, then select either Microsoft Excel Sheet, or Microsoft Excel Chart. That's exactly the entry point for that.
There is a design pattern called a singleton, which is a class designed in such a way that only one instance of it can ever be created. I've never created a singleton in a dll that is called from multiple windows applications, but you may find that the pattern applies to your situation.
There is a site I came accross a few months ago, The Pattern Digest, http://patterndigest.com/. It covers most well known design patterns, including the singleton. I beleive it also has links to other resources. It may help you create the kind of singleton object you need.
I'm developing a firewall log monitoring application in C#
with the .NET framework, and I can't figure out something.
I'm trying to do a reverse lookup on an IP address. I
don't mean reverse lookup to a DNS entry. I'm looking to
find out the computer-name behind the IP address.
The only thing I can find that's remotely related is:
Dns.GetHostByName() and Dns.GetHostByAddress().
However,these methods deal with IPHost objects, which only
contain DNS or IP information -- nothing about computer-
Does anyone have any idea how to get a computer-name from
an IP address in my C#/.NET application? Is there anything
in .NET that will accomplish this? If so, what is it? If
not, what can I call outside of .NET that I can
incorporate into my application?
This is on a windows network? There is the WNet api in the PlatformSDK. You might be able to import functions from the windows networking DLL's to access windows networking information like computer names (wouldn't that be NetBIOS?).
If it's "across the wire" all you're going to get is the DNS reverse lookup. Machine names are not necessarily the same as the DNS name, and all TCP/IP w/DNS will give you is just that: The DNS name, which may or not be the machine name.
NetWkstaGetInfo() will only work on Windows machines (Pre Windows 2000 or Pre Windows 2000 compatible) where Anonymous access is allowed (a reeeeely reeeeeely reeely bad practice!)
Why do you need to know the actual machine name anyway? If there's suspicious behavior, you can trace the IP back. If it's illegal behavior, you can go deeper and give the authorities your firewall logs for the offense.
I'm trying to move colors for index 27 and beyond from the Colors enumeration to a new string array. The following moves them fine into the new array, and writes them out, but when the Databind occurs, it give me the following error.
Object reference not set to an instance of an object.
KnownColor enumColor = new KnownColor();
Array Colors = Enum.GetValues(enumColor.GetType());
string WebColors = new string;
for (int i=27; i< Colors.Length;i++)
WebColors[i-27] = Color.FromName(Colors.GetValue(i).ToString()).Name.ToString();
foreach (string s in WebColors)
Response.Write(s + " ");
cboColor.DataSource = WebColors; cboColor.DataBind(); ERROR IS HAPPENING ON THIS LINE
I'm a CS student, and i need to write a console application which basically writes data packages read with a sniffer to a logfile and then sends data from a different logfile to a remote machine using TNS protocol over TCP. My app also has to communicate with a third party through another unique protocol over TCP.
As i never programmed with C# before, my question is if C# is suited for this kind of project or am i better off with C++ ?
You would be amazed how simple it is. See the System.Net.Sockets namespace, you have TcpClient and TcpServer class stuff waiting for you. As far as I can remember, there are articles on CP about this as well.
How low can you go ? (MS rant)
Last Visit: 31-Dec-99 19:00 Last Update: 1-Feb-23 22:08