|
The threads work independently, unless you prevent them to. If the threads are waiting for each other, it has nothing to do with the threading. It's either a problem with performance as you are trying to do too much at the same time, or a limitation in some resource that the threads are using, like for instance the SMTP server.
---
Year happy = new Year(2007);
|
|
|
|
|
So can I safely assume that my code is fine and I have to find out the problem elsewhere may be in the server or some other resource.
|
|
|
|
|
Do you mean to say that the threads of the second instance are not even started? OR that the threads of the second instance are started but no mails are sent? If second case is true, then the bottleneck most probably is the SMTP server. Did you check the outbox of the SMTP server if possible?
Alternatively, you can use a timestamp to indicate which users/projects have been sent an email in the last 15 mins or so, and not re send the emails to them. This way, at least 10 instances of your application (1 per minute for 10 mins) will not attempt to send 1000s of emails. IMHO, the user will be very annoyed if he really receives a mail per minute reminding him the same thing!
Shreekar
|
|
|
|
|
Yes, the threads of second instance are not even started.
|
|
|
|
|
How are you starting the application after each minute? The problem might be there.
Shreekar
|
|
|
|
|
I use Windows Scheduling. ie. I have registered the application with Windows Scheduled tasks. It automatically executes after 1 minute.
|
|
|
|
|
OK
Then you need to eliminate the reasons. Write another app that does something for more than a minute - like counting from 1 to 1000000, then enumerating files in a folder , writing to a log file etc.
Then schedule this new app similarly for each minute and study whether this displays the same behaviour, if it does, the problem is the scheduler, and I dont know what can be done about it.
If not, the problem is the mail sending code/SMTP.
Shreekar
|
|
|
|
|
Fine, I will figure out this. But most probably I think the problem is with the Windows Scheduler. I think we should make this a windows service instead of scheduling it at intervals. The windows service would run continously without stopping.
What do you say?
|
|
|
|
|
Yes, it would then run the way I was saying it should, a single queue.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
But the threading will still remain, right?
|
|
|
|
|
Hi
Can I display the page No and page total on DataReport VB6 ,, or not
I try alot without any result ..
I need any one to help ..
jooooo
|
|
|
|
|
I search and found it
in your page footer, add a label, and set the caption property to:
Page %p of %P
jooooo
|
|
|
|
|
Hi,
I'm using crystal report viewer for loading my Crystal Reports in form.When I'm selecting a record from a datagrid,I'll be generating the report for the particular InvoiceNo.Both the Datagrid and Crystal Report Viewer are in same form.
When I'm selecting the record,the report is generated.After that when I refresh,the datagrid is displayed.After Refres,When I select a record,the report is generated,but on click of Crystal Report Viewer,report is being generated for other InvoiceNo instead of the selected one.
Can anyone let me know the cause for this and How could we resolve this?
Thank you,
Regards,
Deepa!
|
|
|
|
|
You need to show some code related to selection of InvoiceNo in grid so that we can help.
Shreekar
|
|
|
|
|
Hi,
For Datagrid Display!
private void ugdDeliveryOrderListLoad(string vCustNo)
{
StringBuilder stbSQLStatement1 = new StringBuilder();
stbSQLStatement1.Append(" select dbo.MARTblInvoice.[InvoiceNo] As [Delivery Note No] ");
stbSQLStatement1.Append(", dbo.MARTblInvoice.CustNo ");
stbSQLStatement1.Append(", dbo.MARTblInvoice.SoldToCustName ");
stbSQLStatement1.Append(", dbo.MARTblInvoice.DeliverToCustName ");
stbSQLStatement1.Append(", dbo.MARTblInvoice.IssuedDate ");
stbSQLStatement1.Append(" from dbo.MARTblInvoice left outer join dbo.MARTblCustomer ");
stbSQLStatement1.Append(" on dbo.MARTblInvoice.CustNo = dbo.MARTblCustomer.CustNo ");
//stbSQLStatement1.Append(" where dbo.MARTblInvoice.[InvoiceNo] = "+ ugDeliveryOrderLlist.ActiveRow["Delivery Note No"] + " ");
stbSQLStatement1.Append(" Where dbo.MARTblInvoice.IsCreateDeliveryOrder = 1 ");
stbSQLStatement1.Append(" and dbo.MARTblInvoice.InvoiceNo not like 'D%' ");
stbSQLStatement1.Append(" and dbo.MARTblInvoice.CustNo like '"+vCustNo+ "%' ");
stbSQLStatement1.Append(" and dbo.MARTblInvoice.DOPrintCounter <= 2 ");
stbSQLStatement1.Append(" and dbo.MARTblInvoice.InvoiceNo in ");
stbSQLStatement1.Append(" ((Select InvoiceNo From MARTblInvoiceDetailProduct) ");
stbSQLStatement1.Append(" UNION ALL ");
stbSQLStatement1.Append(" (Select InvoiceNo From MARTblInvoiceDetailNonProduct)) ");
stbSQLStatement1.Append(" and dbo.MARTblCustomer.GroupKeyID like '"+ GroupKeyID +"%' ");
stbSQLStatement1.Append(" order by [Delivery Note No] Desc ");
DataSet dtsResult1 = new DataSet();
dtsResult1 = QueryData(stbSQLStatement1.ToString());
ugDeliveryOrderLlist.DataSource = dtsResult1;
if(dtsResult1.Tables[0].Rows.Count == 0)
{
MessageBox.Show("No Results Found. ","DuPont MARS",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
ugDeliveryOrderLlist.DataBind();
}
On selecting the record,
Grid_AfterSelectChange event
pnlReport.Visible = true;
DisplayReport();
utmDataMaintenance.Tools["Print"].SharedProps.Enabled = true;
I'm using crv(Crystal Report Viewer)Is that the reason,Everytime when I scroll on the generated report,report is being generated again for other invoice no.
What might be the workaround for this?
Thank you,
Regards,
Deepa.
|
|
|
|
|
Hi all,
I have a vb.net dll that I wrote and when it is launched from a desktop (windows) application it displays a small window down by the clock to tell the user what is going on. This works great. I ported this dll to an asp.net program and of course the local small window won't pop up because the .dll is not on the local machine.
What I would like to know is there anyway to tell if my .dll was called from a windows app or a web app. I would like to do different things.
I already tried system.reflection.assembly.getcallingassembly but it only returns that my dll's location and not (um let's say iexplorer.exe)
Cheers,
Chris
|
|
|
|
|
you could do something "cheap" by setting a flag in the dll from your windows app and not set it from your wep app. then throughout the code, just check the flag to determine what is allowed...
|
|
|
|
|
HI,
thanks for your reply, however I won't be the one calling the dll it will be called from many 3rd party software products. So that no worky.
Cheers,
|
|
|
|
|
Hi all,
I have a vb.net dll that I wrote and when it is launched from a desktop (windows) application it displays a small window down by the clock to tell the user what is going on. This works great. I ported this dll to an asp.net program and of course the local small window won't pop up because the .dll is not on the local machine.
What I would like to know is there anyway to tell if my .dll was called from a windows app or a web app. I would like to do different things.
I already tried system.reflection.assembly.getcallingassembly but it only returns that my dll's location and not (um let's say iexplorer.exe)
Cheers,
Chris
|
|
|
|
|
wrote: I ported this dll to an asp.net program and of course the local small window won't pop up because the .dll is not on the local machine.
On top of that, the little window won't pop up because your .DLL code is not running on the client workstation. An ASP.NET app is a server-side application that generates HTML for a browser. Your code won't run, and won't show an icon, on the clients machine. You're limited to using Java and other Browser-based languages and scripting on the client side. Besides, anything you call in your .DLL will tell you that the process is the IIS ASP.NET process, not IEXPLORER.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi everyone,
In VB6, I used PopUpMenu method on a right-clicked MouseDown event to show a ContextMenu inside the listview and that all that action does, it does not select or de-select any listview items. In .Net, if my mouse is not hovering over a selected item, my current selection is deselected when the contextmenu opens. I'd tried using a array to hold onto the current selections and reselect everything when the menu opens but it's a performance hit when there's a couple hundred items.
I cant seem to stop .Net from changes my selection. I just need the right mouse button to show the ContextMenu and nothing else.
Sorry if I cant elaborate anymore..
|
|
|
|
|
Please dont cross post.
You can store the current selections in a variable, and restore them when a right click event occurs, if the control won't let you stop it from deselecting overall.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thank you for your suggestion Christian.
I was trying to avoid have to constantly reselect all the items.
Thank you anyways.
|
|
|
|
|
I think I solved it. I created my own class that inherits the ListView class. I messed around with overriding the WndProc method. I made a few small changes and it works great as far as I can tell. If you add this class to your project you should be able to use it just like any other control. It will be added to the tools menu automatically (at least it gets added for me). Sometimes I have to run my application once before it gets added. If you have trouble getting it to work let me know. It works exactly as a ListView control except for the fact that it won't change selections if you click off of an item. If you want it to behave slightly differently then let me know and I can help you make the changes. For instance do you want the context menu to appear if a user clicks off of an item? I can stop that too. Or would you like it to not select an item at all when the context menu is displayed? I would recommend leaving that behavior because it seems standard. Well here is that class. Hope it helps.
Public Class ListView_NoRightClickChange
Inherits ListView
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
'Right mouse button message ID
Const WM_RBUTTONDOWN As Integer = &H204
If m.Msg = WM_RBUTTONDOWN Then
'Mouse position relative to me
Dim mousePos As Point = Me.PointToClient(Me.MousePosition)
'If item wasn't selected then change message to prevent
'selection changes
If Me.HitTest(mousePos).Item Is Nothing Then
m.WParam = New IntPtr(-1)
End If
End If
MyBase.WndProc(m)
End Sub
End Class
**EDIT**
I re-read your post and I think that you would like the selection to stay the same even if a user right-clicks a non-selected item. If that's the way you'd like it then it's even less code. Here is the class that will make that happen.
Public Class ListView_NoRightClickChange
Inherits ListView
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
'Right mouse button message ID
Const WM_RBUTTONDOWN As Integer = &H204
If m.Msg = WM_RBUTTONDOWN Then m.WParam = New IntPtr(-1)
MyBase.WndProc(m)
End Sub
End Class
|
|
|
|
|
Hi TwoFaced,
That is exactly what I want to do.
Forgive my ignorance, but I dont have much experience using class.
I'd added a new class with the codes you posted, but am at a lost as to how to use it with my existing listview.
|
|
|
|