LizR 171 Posting Virtuoso

If you want html, the easiest way is to just write it to html in the first place, rather than try and format it to a rich text box, load it in something else, etc.

Long as you have a basic understanding of html, saving the reports should be fairly straight forward

LizR 171 Posting Virtuoso

HTMl is only text, so, my advice is to devise a layout, and then use that as a template and fill it in with a routine you pass information to.

LizR 171 Posting Virtuoso

if it only then applies to the mainform, check the dpr file on how its created

LizR 171 Posting Virtuoso

Im still concerned that the record size is different. Are you able to measure the length of the records from the file in delphi 1? to check you have the same size?

LizR 171 Posting Virtuoso

Thats because he has 1 switch statement, you have 2.

As I said, when your code comes along a return statement no further code is processed

so, picture the following pseudo code.

x = 3
y = 4

if x < 5 return "small x"
if y < 5 return "small y"

so..
in this case, the second if never runs because you have already returned "small x"

you can only come out once for each time you go in.

Im guessing your thoughts for N+S you think its right because the value you assign is 0 to one of them.. eg the second one..

LizR 171 Posting Virtuoso

Well question:

How are you opening the other forms?

LizR 171 Posting Virtuoso

Or some code that you thought should work but doesnt.. (as long as you post errors, and or expected vs actual outcome)

LizR 171 Posting Virtuoso

Microsoft have enough white papers to sink a ship. Try there.

LizR 171 Posting Virtuoso

thats what debugging is for, step through see what values each thing has..

LizR 171 Posting Virtuoso

Then are you sure that the checkbox you see is actually one from your form? it would strike me its not found it for some reason, but because you forced it into checkbox type it says its a valid checkbox.

LizR 171 Posting Virtuoso

Does it do the same if you remove the Checked="false" part?

LizR 171 Posting Virtuoso

Firstly you shouldnt have had to change the size of your record, if your record was defined in delphi 1 without sizes, you should have been ok with "string" now.. the record alightment is most likely the parts thats wrong.

LizR 171 Posting Virtuoso

You can use move, but you shouldnt need to, theres no reason to move the memory, just have the pointer reference, and add the new one so if (and this is totally ficticious) you had 3 items at 1000 and 2000 and 3000 and you added a 4th between the first and second, as long as the pointer knows the memory chunk is at 4000 for the next record you dont need to move it, and in doing so you waste cycles and create potential for bugs for no reason.

LizR 171 Posting Virtuoso

there have been a huge number of changes.. since then.. when you say it shows behind the other forms, is it forms within the app, or forms within your desktop?

While it would be a hack you could tell it to bringtofront, but, Im thinking theres some form props or something that has changed its not picking up correctly.

LizR 171 Posting Virtuoso

when you debug it does PhotoID have the right integer in it? does the sql return any errors?

LizR 171 Posting Virtuoso

Then it sounds like you have a port conflict

LizR 171 Posting Virtuoso

it seems you couldnt answer the question.

Debug your code, watch where it goes, what what it does, it will help you find why its wrong

if entering breaks in your switch statements tell you code isnt reachable, then you've done something wrong.

Do remember, when you say "return" it will do just that, no code after is processed.. so, if you have to run both switch statements, thats your issue..

LizR 171 Posting Virtuoso

possibly the line feed isnt being sent correctly

LizR 171 Posting Virtuoso

Im surrpised it doesnt whine about drop throughs .. as there are no breaks in your switch statements.

Ok, give us an example of the input values you have, and the output you expected, and what you actually got.

LizR 171 Posting Virtuoso

Normal classes, you just need a LOT of imagination on how you and the intended would hide the message without making it detectable by the rest of us. If you can do it by hand, work out what you'd do and put that logic into a program

LizR 171 Posting Virtuoso

Then your add needs to have the record to which its going to be added after, otherwise, how will you know where in the list it is?

LizR 171 Posting Virtuoso

Well. For a linked list you'd need to know where you're adding the item, so, you'd need to make a class so that add is applied to an item, so its added between the 2 items, and then you can handle deletion as well as moving, etc.

Well firstly Id recommend googling, delphi is not a new language, most of what you want will have been written at some point, as well as its often worth checking some of the units that come with delphi as sometimes you're inventing something you already have..

Try also looking at http://www.ibrtses.com/delphi/dllist.html which has the answer already done

LizR 171 Posting Virtuoso

Well, what have you googled, and read on the "similar threads" at the bottom of this page?

LizR 171 Posting Virtuoso

Well then, we'd need some code, we need the full error..

LizR 171 Posting Virtuoso

There are issues potentially with the way you chose to do it, but, it does work (and was the ugly method I said earlier) the clean and proper method is better, and allows you to have multiple recipients that may need to know of changes, and is an OO answer to an OO problem

LizR 171 Posting Virtuoso

it will, and it would be the best and proper way to deal with your issue.. As whatever form calls the wizard it could set itself to be a recipient of a heres your data event and work from there, thus removing all your issues of which instance/form etc asked for the wizard.. thats the whole beauty of it.

LizR 171 Posting Virtuoso

Oh. well in the sending function where you point it at a server, you'd point it at your exchange server.

LizR 171 Posting Virtuoso

like vckicks, I do think that its not uncommon for it to error in someways, as if you think about it, it has expectations if you type in rubbish, how can you expect it to feel thats the same?

For passwords however using a decryptable method is unusual, normally you encrypt using a non decryptable method and then compare the encrypted versions, not the real passwords.

LizR 171 Posting Virtuoso

The thing to memorize is the syntax of things, the basic things, like ifs have to have round brackets, each "sentance" has a ; at the end, its case sensitive, if you want to change from one variable type to another you almost certtainly need to do that yourself..

Then, look at the function names, usually its quite an obvious name like

GetValue, or SetValue, or Length, or Count, List.Items .. then if nothing else even if you dont remember the parameters, a) intellisense will tell you, b) you can press F1 to find out.

If you're unsure, ask the question of google.. For example, someone here asked about returning data from a stored procedure.. if you go to google and type "return data from stored procedure c#" it was I think the second hit that had a full working example from MS.

LizR 171 Posting Virtuoso

Then you would need to work with SMS, and either arrange some deal with a SMS web provider so you get your messages a little like emails, or, you get a modem and mobile and send them .. I havent done this direct but it gets very expensive if you do.

LizR 171 Posting Virtuoso

You said your app was working, when the exchange server is made just change the destination of the smtp mails you send to be to the exchange server

LizR 171 Posting Virtuoso

Its basically a limited http

LizR 171 Posting Virtuoso

Isnt that what they invented wap for?

LizR 171 Posting Virtuoso

Id have thought you would have to have followed the reverse route of the encryption more when decrypting, it doesnt seem to be in the same order...

LizR 171 Posting Virtuoso

I did mention it would have to map its own :) but it should also have code in case that drive disconnects (such as something goes wrong)..

If your app runs as a service, and is set to autostart, it would run on startup.

LizR 171 Posting Virtuoso

How did you define the MyEvent type?

the UpdateText method looks reasonable, it would seem more likely it didnt get called.

LizR 171 Posting Virtuoso

No, you can have a large number of threads running at any time, although actual activity is limited and timeshared over the available CPU power of your box.

eg, if you have a single CPU with HT - thus pretending to be 2 CPUs directly technically it does only 2 things at a time, however with fancy timesharing by windows it will appear more than 2 threads run (for example take a look in task manager and see how many processes there are, let alone if you use something like sysinternals process explorer and see how many threads per process)

OK, as a rule a service should not make windows or write to consoles - as a lot of the server versions of windows are either set not to, or dont by default allow it

Other things to remember when making a service is that if you as a user map a drive, the service cant see it, even if it runs "as you" .. it has its own instance, and wont see any mapped drives, it should do its own.

As you're making some form of net monitoring system, a text file is possibly not a good place to keep things, as the more servers you get the more likely you are to run into file locking issues.

The key facts are however, for all the threads you start you must terminate them.. and handle any issues within them.

LizR 171 Posting Virtuoso

OK, so now Ive eaten my dinner - and I got 30 mins before I go out:

Picture this.

You have a routine on your first form, which you assign to an event on your second form - such as a routine like:

public UpdateText(String msg)
{
  this.textBox1.Text=msg;
}

If your event is programed to receive such a thing, you could easily on creation of your second form do

form2.MyEvent += new MyEvent(UpdateText);

then within form2, on clicking of button you can test

if (MyEvent!=null) { MyEvent("testme"); }

and you just triggered your event..

another way to do it is to have

void DoMyevent(String msg)
{
if (MyEvent!=null) { MyEvent("testme"); }
}

and then when you potentially need to call your event do

doMyEvent("sometext");

and your code is easier to read


Just read up on delegates and events.

LizR 171 Posting Virtuoso

have you considered setting a property on form2 to be the value of form1? so you have a reference?

LizR 171 Posting Virtuoso

instead of getvalue - which returns a single value and as you specified no default option, if not found, it would return null..

Do you not mean getsubkeynames?

LizR 171 Posting Virtuoso

OK, no point getting ranty, firstly you have google, just like the rest of us do when we want to look something up, given you know the name of it, reading more about it should be possible and a lot of the reading will have examples.

OK, you dont say why you cant get stdid from the database, why not? what happens? debugging more often than not will show you why something doesnt work.

Once you have stdid, Im guessing the second part will be part resolved too

LizR 171 Posting Virtuoso

Kinda hard but, where?

other than not obviously reusing the connection you make to the db only thing I can see would be

MessageBox.Show(exc.ToString());

So, where is the error generated, which line?

only other stab is that it errors on the @@IDENTITY part because you havent added any records to retrieve the @@IDENTITY of the last record added.

LizR 171 Posting Virtuoso

You can either make an event on your main form which you tie into the button on your second form (messier)

or

You can create a method which you send the data from your second form, to your first form. So the first form handles all its updates.

LizR 171 Posting Virtuoso

You said it wasnt working - it cant be good enough if it doesnt work, can it?

So, your new code, how about letting us have the error code you get, rather than trying constantly to recreate half an application to duplicate the need for the code you have?

LizR 171 Posting Virtuoso

I think your stored procedure needs more tweaking - the info can be found at .. http://msdn.microsoft.com/en-us/library/bb546186.aspx

LizR 171 Posting Virtuoso

The problem would seem to be

return ((int)(result.ReturnValue));

In old days thats probably a pointer to the result, but in .net youve told it to be an int, so an int it is.

Try changing it to

return ((IEnumerable<Order>)(result.ReturnValue));
LizR 171 Posting Virtuoso

If you just wish to update the visible rows, then well I explained how id expect to work out whats visible, so you could just do a query that retrieves those rows

LizR 171 Posting Virtuoso

If your exchange server supports SMTP mail connections (which most likely it will) you would just change your app to point to your exchange server

LizR 171 Posting Virtuoso

.bak files can be *ANYTHING*, however, if you just wish to rename them and or move them, then you are free to do so as a general rule.

LizR 171 Posting Virtuoso

I guess you ended up with a loop etc? Still worth taking a look at join, its a very very very very very very useful function.