Basic on Sinclair ZX-81 in 1982 (it was released a year late). IK of Ram. Later bought a 16K dongle that kept falling off and losing my work.
quilkin
Posts
-
Your First Development Machine? -
enum problems with C++I've been using C# for the last few years but now I have to work with an embedded C++ compiler and am having problems with enum types, since they can't apparently be used in a different class.
class Message { public: enum Index { Length,ID1,ID2,ID3,Type,From,To,SourceX,SourceY,Var,Routing,MaxIndex=255 }; .... .... .... } ... ... ... bool Sensor::SendMessage(Message msg) { char message[Message.MaxIndex]; message[Message.ID1] = 'X'; ... ... }
This sort of thing works fine in C# but the C++ compiler gives an error when 'Message.MaxIndex' etc is used - it says 'type names cannot be used' (or similar depending on the compiler). Do I really have to make all my enum's global (e.g. 'Message_MaxIndex') or is there a better way? -
finding an SQL serverMany thanks Luis. This looks perfect. And it seems I need to keep up with the times, Google is getting good for this sort of thing.
-
finding an SQL serverDoes anyone know of a programmatic way of finding which server(s) may be running, so a new client installation can be provided with a drop-down list of where the data may be held? There will be a defined instance in each case, so all servers to be found will be of the form "machinename\myinstance" - I just need to find possible values for 'machinename'. (pretty much like the facility in Enterprise Manager for finding a new server registration). We are using C# (.NET 2003) but I can translate from other methods if required.
-
Graphics - removing a lineControlPaint.DrawReversibleLine works fine. A whole new class I didn't know about. Thanks to all.:)
-
Graphics - removing a lineDavid, Is double buffering relevant? In MFC, I used CDC::SetROP2 to get a whole range of options about combining pixels. I'm trying to find the equivalent in .NET. Thanks for replying.
-
Graphics - removing a lineCan anyone explain how I can draw a line over an existing image, then later remove it (by redrawing it in some clever way) without having to invalidate and redraw the original image?
-
DateTimeWe use
time.ToString("G", DateTimeFormatInfo.InvariantInfo);
and you should also consider usingtime.ToUniversalTime();
before storing times in the database, to avoid problems with daylight saving. -
TcpClient - waiting for connectionStefan, Thanks but I think this will only be OK if there is a domain name server to provide a name. This system needs to work on LANs where there may not be one. I guess I'll need to use the asynch StartConnect() method but I need a decent sample to see how to use it.
-
TcpClient - waiting for connectionJeff, I have set both SendTimeout and ReceiveTimeout (to 6000 ms) but they have no effect on starting the connection, only presumably on send/receive data.
-
TcpClient - waiting for connectionI am using TcpClient.Connect(ipaddress, portnumber) but the app must 'scan' a few possible IPs before finding the 'active' one. However if 'ipaddress' does not respond, the Connect() function hangs for nearly 60 seconds before raising an exception. Is there any way I can test for an IP quickly (e.g. a 'ping() command) before calling 'Connect()? I don't really want to get into starting separate threads for each possible IP address to search.
-
TabPage OnClickThis must have a really easy answer. I have created a tabcontrol and added five pages to it. I added an 'click' event handler to each page. But the event only fires when I click on the main part of the page, not on the tabs (labels) themselves! (The graphical representation of the tabs changes with each click, but my Click handler is never called). Since most of each page is covered with other controls this makes it almost impossible to use. What am I doing wrong? Is there a different click event for the labels?
-
Request a new loginThanks, OK, but is there a way to force the screensaver to come up immediately? I just want to ensure that, when someone presses a 'save' button that changes a database, they immediately get a request for credentials. I don't want to create a new form to capture credentials since there is no way to check the Windows NT password.
-
Request a new loginI need to programatically bring up the Windows logon dialog. I don't want to find any usernames or passwords, just force the user to re-enter his credentials - this is to prevent unauthorised users from changing settings in the application if the authorised user has walked away from his desk for a few minutes. There must be a simple c# method that does this!
-
Icon designWhat am I doing wrong in creating icons for my app? When a 16x16 icon apppears in the icon tray it appears corrupted (lots of grey splodges) yet the same icon is fine when it appears in a form (or dialog). Are there any tools available for icon design that are better than the Visual Studio tools?
-
Updating text in a form while other tasks are happeningThanks 'Condor', this is a bit top-heavy in terms of code size (compared with what I was expecting!) but I have to admit the result is very nice. I'll use it.
-
Updating text in a form while other tasks are happeningWhen my app starts up it needs to spend a few seconds getting data from a database, and structuring tables etc. The user needs to know something is going on while this happens so I made a simple form that gives some feedback e.g."xxx is now loading". Trouble is, the app is so busy loading the data that it never gets the chance to write the text in the form. The title is there, but little else (until the data has finished loading, when the form is not required any more anyway!) - just empty 'holes' which let the underlying screen show through. There must be a simple solution to this but it eludes me.
-
Vertical text in a DataGrid column headerIs it possible to use a vertical font in the header of a data grid? When the column titles ae longer than the contents of the cells, it seems such a waste of screen space to have wide columns (and not user-friendly to hide most of the titles by having narrow columns). Any ideas welcome!
-
serial portI agree with Dave, what you're trying to do is pretty impossible. Better to get hold of a development kit for a simple microcontroller (e.g. a Arizona Micro PIC device) that has an on-baord UART and talk to that via your PC serial port. The PIC can be programmed to generate your pulses, etc, depending on the instructions it gets via the serial port.
-
Help with Windows services:doh: Of course, I need to 'OpenSubKey()' with write permission. Anyway, could you confirn that the 'CurrentControlSet' is the correct key, and not 'ControlSet001' or 'ControlSet003'. What are these? Having got the service working as I want it, I now cannot stop it programatically.
System.ServiceProcess.ServiceController sc = new System.ServiceProcess.ServiceController("SpyFive");
try
{
sc.Stop();
}
catch
{
....there is nothing caught, the service goes into 'stopping' mode and then nothing can be done with it (even from MMC). Any ideas?