|
I think, that you've forgot to dispose some GDI+ objects. For example, Graphics
Best regards, Alexey.
|
|
|
|
|
I think, that you've forgot to dispose some COM objects. Try to set them null value.
To see this error, try to set Thread.Sleep(time); after Application.Run(...) with time in milliseconds.
Best regards, Alexey.
|
|
|
|
|
but shouldn't they be disposed when the applciation quits? what is the GC for then? In any case I think I do set them to null and even call ReleaseComObject - no help

|
|
|
|
|
i want to create a tipical bar that appear when i try to move a separetor for example.
It appear with the oppost color of the image above.
How?
|
|
|
|
|
|
tnx but i don't know how delete the line i've drawed...
|
|
|
|
|
As mentioned in the page to which I posted the link, you call the DrawReversibleFrame method a second time (passing in the same Rectangle as the first call) to erase the frame.
Josh
|
|
|
|
|
Hi and THANKS a lot in advance.
I'm getting this error in a different scenario, and I'm in a big urge to get this done, so please MS people and guys of the forum, any help is greatly appreciated.
I'll use a simplified scenario of my case, but the error happens the same. I'm creating a new User Control, I add a DataGridView to it, that's the only control in it. I then create a public property called "Columns" to expose the DataGridView Columns property so I can access the property to the Designer Editor. I do that this way:
namespace WindowsApplication3
{
public partial class myUC : UserControl
{
public myUC()
{
InitializeComponent();
}
[Editor("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
[MergableProperty(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public DataGridViewColumnCollection Columns
{
get { return this.dataGridView1.Columns; }
}
}
}
I took all that Attributes code from the System.Windows.Forms.DataGridView metadata, just as the Columns property appears in it.
Then, I add a Windows Forms item to my application and drag&drop one MyUC control from the toolbox into it. Then I click the MyUC and go to its properties page to modify the Columns properties just as with an ordinary DataGridView. The property is there but when clicking on its "..." button to open de Edit Columns Dialog I get the mentioned error. Something like this:
"Unable to cast object of type 'WindowsApplication3.myUC" to type "System.Windows.Forms.DataGridView".
I really really need the Columns property to be accesible in Design Time this way. I don't know how to work this out.
As I said, I get this error with an almost blank project. Just add a User Control Item, put a DataGridView into it. Ade the code above to make the Columns property visible and then try to access the property in the Property page.
Thank you so much in advance.
F.
PD: I'm using the shipped VS.NET 2005.
-- modified at 12:47 Monday 24th April, 2006
|
|
|
|
|
It seems that the DataGridViewColumnCollectionEditor is receiving an argument which it expects to be a DataGridView, but is instead receiving an instance of your UserControl. You have two options:
1) Expose the DataGridView as a property of your UserControl, instead of the Columns property. Through that property you can access the columns in the grid.
2) Derive from DataGridViewColumnCollectionEditor and make your sub-class work properly with your UserControl. You can use Lutz Roeder's Reflector tool to investigate how the DataGridViewColumnCollectionEditor works, and tweak your code so that it plays nice with the UserControl. Then modify the EditorAttribute on the Columns property so that it references your UITypeEditor, instead of the MS version.
Josh
|
|
|
|
|
Hey Josh, thanks for your quick response.
I had tried your suggestion 1 before, and I did it again with this simplified scenario. I get the "Object not set to an instance of an objet" error when clicking on the Columns Property of the exposed DataGridView property in my User Control.
Should I do something somewhere so it's initialized for Design access?
As for your suggestion 2, where do I find that Lutz Roeder's tool?
Thanks again.
|
|
|
|
|
I'm not sure what the problem is with the UITypeEditor. That sounds like something which requires detailed investigation to see what's wrong.
Reflector can be found here: http://www.aisto.com/roeder/dotnet/[^]
Josh
|
|
|
|
|
Thanks Josh again.
I really need this to work, I'm on a urge.
Sorry if I'm abusing you but could you please, try my scenario, it's quite simple and quick to set up (see my first post), and try the two paths that are leading me to this 2 different errors?. Maybe you can figure something out.
The 2nd suggestion you made sounds like a lot of work to have something that should be quite simple since all I'm trying to use is a built-in editor: the DataGridView Columns Editor.
I really appreciate your help so far, and I understand if you can go any further.
thank you and than anyone else who can give some light.
F.
|
|
|
|
|
I looked into this issue and discovered that you need to use attribute redirection to accomplish your goal (well, partly at least).
[AttributeProvider( "System.Windows.Forms.Design.DataGridView", "Columns" )]
public DataGridViewColumnCollection Columns
{
get { return this.dataGridView1.Columns; }
}
In case you're curious where to find out more about this topic, check out this[^]
Unfortunately, it still does not work correctly. When you try to add a column, it throws another error message. But, at least the dialog is showing now...
Good luck,
Josh
-- modified at 21:05 Monday 24th April, 2006
|
|
|
|
|
Hey Josh, thanks a lot.
I've just tried your code and it works just like you said, as long as I remove the
[Editor("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
that I had in my code (taken from the DataGridView metadata). If not, the error persists.
At least with your suggestion the Columns can be edited in Design time. It's weird what's happening, maybe it's a bug in the IDE, I don't know. But I need this to work. Hopefully somebody will come out with a final solution, meanwhile you made my day man. Thank you a lot.
Hey MS guys overthere! Any idea about this?
Thanks Josh.
F.
|
|
|
|
|
Oh Man! This is FRUSTRATING!!!!
My smile was gone with a wink of my eye!!!
Damn it!
Your suggestion works since it makes the Edit Columns dialog appears, but, NOTHING is saved, any changes made to the columns (e.g. Header text) is gone as soon as you build the project!
Nothing is being persisted.
So, there's no point in having the dialog to make any change.
Gee, is really frustrating that something so simple is being such a pain in the "neck"!!!
What the heck is going on here? Please MS Guys, say something about this. It's quite simple and common what I'm trying to achieve here, and the thing is not working. Please.
Thanks Josh for all your help, I really appreciate it. Don't hesitate to go further if you have the time, this is war now
F.
|
|
|
|
|
Hi everybuddy,
I wana ask in your opinion how a 'Middleware' relates to or differs from an 'Application Server' such as ASP.NET?
Can we say one of these concepts contains the other? or they are different tools that help achieveing a similar goal?
Thank you,
- Den2Fly
---
"Art happens when you least expect it."
|
|
|
|
|
My understanding is that the term "Middleware" is some technology that sits between a front-end GUI and a back-end Database. Most notibly, this term used to be applied to MM Flash applications, where the swf would be the GUI, and a database used (eg/ MySQL or MSSQL) - as flash has no native ability to connect to a DB, "middleware" (eg/ asp, php, perl) was used to translate HTTP requests from flash to database calls & vice-versa.
ASP.NET can be used as this middleware, although these days flash has much more ability, such as Remoting which negates the use for such "middleware" solutions.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Yes, useful comment. Thank you for your note.
---
"Art happens when you least expect it."
|
|
|
|
|
Has found one library which allows to send without Outlook Security.
But here the problem Who used to it, help me...
I try to send together with MAPI
<br />
oSession = new MAPI.Session();<br />
oSession.Logon(Missing.Value, Missing.Value, true, true, Missing.Value, Missing.Value, Missing.Value);<br />
<br />
MAPI.Folder oFolder = (MAPI.Folder)oSession.Outbox;<br />
MAPI.Messages oMessages = (MAPI.Messages)oFolder.Messages;<br />
MAPI.Message oMsg = (MAPI.Message)oMessages.Add(Missing.Value, Missing.Value, Missing.Value, Missing.Value);<br />
<br />
SafeMailItem SafeItem = new SafeMailItemClass();<br />
<br />
oMsg.Subject = "Hello!";<br />
oMsg.Text = "Hello!";<br />
<br />
SafeItem.Item = oMsg;<br />
SafeItem.Recipients.Add("xxx@xxx.xxx");<br />
SafeItem.Recipients.ResolveAll();<br />
SafeItem.Send();<br />
<br />
oSession.Logoff();<br />
there Was one question: How to make what letters automatically sent, and that they are kept in folder Outbox and do not send yet will not start itself Outlook?
|
|
|
|
|
Im not really understanding exactly what you are needing... but if you are asking if Outlook has to be running for redemption to work, then I would say yes. It has been my experience that the mail will never go through if outlook is not running. I suggest checking for Outlook, and if it is not running, starting the process. When all mail has been sent, then kill the process, or simply leave it open, whichever you prefer. Also, on some versions of Outlook, the mail will stay in the Drafts folder and will not send until the next Send/Receive, despite the solution that the Redemption people give you (SendNow()). Hope that helped
Aaron
|
|
|
|
|
Hello Aaron.
I send the letter by means of CDO. It's impossible to use Outlook COM Library for me.. (restriction in a technical project)
What i do:
<br />
MAPI.Session oSession = new MAPI.Session();<br />
oSession.Logon(Missing.Value, Missing.Value, true, true, Missing.Value, Missing.Value, Missing.Value);<br />
<br />
MAPI.Folder oFolder = (MAPI.Folder)oSession.Outbox;<br />
MAPI.Messages oMessages = (MAPI.Messages)oFolder.Messages;<br />
MAPI.Message oMsg = (MAPI.Message)oMessages.Add(Missing.Value, Missing.Value, Missing.Value, Missing.Value);<br />
<br />
SafeMailItem SafeItem = new SafeMailItemClass();<br />
<br />
oMsg.Subject = "Hello!";<br />
oMsg.Text = "Hello!";<br />
<br />
SafeItem.Item = oMsg;<br />
SafeItem.Recipients.Add("xxx@xxx.xxx");<br />
SafeItem.Recipients.ResolveAll();<br />
<br />
oSession.DeliverNow();<br />
<br />
MAPIUtils ut = new MAPIUtilsClass();<br />
ut.DeliverNow((int)rdoFlagIcon.olRedFlagIcon, (int)this.Handle);<br />
<br />
SafeItem.Send();<br />
<br />
oSession.Logoff();<br />
Letters remain in a folder Proceeding...
And how to make that they have automatically gone and have got in folder Sent?
I can not understand in what a problem.
!!! - this code don't help...
|
|
|
|
|
Hello there to all:
I m new to C#. I have a question that what's the difference between a variable scope and a variable life time?
Plz give me a detailed answer to clear my concept.
Hope to hear!
|
|
|
|
|
Pretty much the same thing. The variable's lifetime is from when it is created (strictly I believe its when the block containing the variable definition is opened) to when it goes 'out of scope'. When this happens, the stack is unwound and all the variables and references get wiped out. The scope is usually the area within the innermost set of braces { } which contain the variable.
Regards,
Rob Philpott.
|
|
|
|
|
For value types the lifetime is the entire method where it's declared, but the scope might be smaller, for instance inside a loop. Outside the scope, the room allocated on the stack for the variable is simply unused.
For reference types the lifetime is from when the object is created until it's garbage collected. When all references to the object go out of scope (or rather the lifetime ends, I believe), it can be garbage collected.
---
b { font-weight: normal; }
|
|
|
|
|
I have a MDI parent form with a main menu. I need to catch the click event in the child form and depending on the checked state of the menu Item in the main menu do some actions.
How can i do this?
Denis
|
|
|
|
|