|
|
nicknotyet wrote: I'm just surprised there isn't obvious stack corruption.
Why would there be? Isn't that passed "by value". If the function parameter is only 32 bit then only a 32bit space is pushed onto the stack correct?
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
I'm not familiar with the physical layout of the stack, but yes as long as the construction of the callee's (unmanaged DLL) stack only pulls a 32-bit value from an allocated 64-bit space, then it should be ok.
Either way I still have re-write my code to explicitly use Int32 in place of long because of the truncation issues.
Thanks for the feedback.
|
|
|
|
|
nicknotyet wrote: Either way I still have re-write my code to explicitly use Int32 in place of long because of the truncation issues.
Do you need a 64-bit integer? Will you ever encounter numbers in your managed app that will be too big to fit in a 32-bit int?
Matt Newman
Even the very best tools in the hands of an idiot will produce something of little or no value. - Chris Meech on Idiots
|
|
|
|
|
Fortunately no, not for this assembly. The truncation will probably never be an issue, its just a matter of correctness at this point.
Nice quote, I'll try not to take it personally, and I will remind my boss of it if he ever tries to hire on the cheap.
Thanks for the response.
NIK
|
|
|
|
|
nicknotyet wrote: I would expect to hose the stack, but nothing adverse happens across hundreds of calls like this. Hard to believe I am just getting lucky, is the runtime protecting me somehow.
You could just be lucky with stack alignment, maybe there is some padded space. Why not step with the debugger , and look at the memory of the stack with proper and the wrong values?
|
|
|
|
|
1) Can't drill down from the managed side, maybe I need some education on this.
2) Tried debugging from the unmanaged side, but VS barfed.
Haven't had time to resolve either debugging issue. I wrote some code on the unmanaged side to show me what I needed to know and moved on.
Thanks for the response
NIK
|
|
|
|
|
Hi All,
Wondering if anyone has a good recommendation for a c# grid control? Looking for something that allows for "virtual grid" type of thing. I've tried ComponentOne, and wasn't crazy about theirs (too hard to customize). Anybody used one that they have been happy with?
|
|
|
|
|
SourceGrid[^] is a nice one, but be carefull, download it from the devage website (mentioned in the CP article) cause there is a new version already, but the CP articel gives a good shot what you can do with it.
|
|
|
|
|
Hey,
Thanks for the tip. This looks a heck of a lot better than the one we paid $500 to use. I suppose it's OK to use this in commercial software?
|
|
|
|
|
Yeah you can use it for commercial use, but I think you need some license information to put somewhere on it to then. You should look to the licensing information on the website. But it's completely free, no additional payments either.
We use it in a Windows form project and we copied the licensing information in the about screen on an extra tab.
|
|
|
|
|
Yes it is. And its really good. You will have to invest some time at first but after that its more flexible than any other grid I have seen (and I made a full week of evaluations before choosing the grid for my last project).
Unless you have the need to display hierarchical data go for it.
|
|
|
|
|
So far it looks really nice. I have no need for heirarchical data, but I do need some flexibility as far as the types of controls, styles in the grid, etc. SO far, I've been pretty disappointed in the commercial offerings and the lack of flexibility. I can see there's a little bit of a learning curve with it, but can tell the developers went to a lot of trouble to build in a great amount of extensibility.
|
|
|
|
|
hi all,
first: i want to show notifyicon's contextmenustrip if user clicks both right and left button of mouse ? (double <left> clicks will restore but single <left> click only shows the contextmenu)
second: if user clicks one of Minimize, Resize or Close buttons ( at right-up corner of form) i want to hide the form. only Exit button on contextmenustrip should close the the application.
how can i do the aboves ?
help please ...
|
|
|
|
|
first: search the event for mouse-click, and open a method for that, inside just write:
if ((e.Button == MouseButtons.Left) || (e.Button == MouseButtons.Right))<br />
contextMenuStrip1.Show(MousePosition);
this will check if some-one has pressed the right or left button, and will show the contextmenustrip at mouseposition.
second: again, search the events you want in the events (i.e formclosing for clicking close (X)), and open their methods, and write (this is for formclosing):
if (e.CloseReason == CloseReason.UserClosing)
{
e.Cancel = true;
this.Hide();
}
|
|
|
|
|
I am making a search engine and i want the control to shift from the query box to search button automatically i.e if user presses enter after writing the query the search button automatically get pressed.. currently user has to use mouse to press the search button...
Looking farward to your help
Regards,
|
|
|
|
|
see the AcceptButton property of your form...
|
|
|
|
|
|
I have an app that logs data and serialises a CTime to an archive
ie
<br />
CTime time<br />
<br />
achive << time<br />
I cannot for the life of me get .NET to read it from the file.
I can get the same value from the file , its just that the code below
produces a date somewhere in the 1600's
DateTime time=DataTime.FromBinary(theFileValue);
I can load the value in a C++ MFC program and get the correct result
HELP!!!! Thanks
.Netter
|
|
|
|
|
did you try to provide an IFormatProvider? This is an option which you can define how it's formatted.
|
|
|
|
|
its not the format , the date is totally incorrect, infact the date it reports is 12:01:53 AM on 1/1/0001.
Ive tried all the .From options, none work.
|
|
|
|
|
and Convert.ToDateTime() you can provide as good as everything, maybe that will help
|
|
|
|
|
in fact it just throws and invalid cast exception (as the documentation says)
|
|
|
|
|
Then i think you can use the same solution as i've just given down here:
string strDate = "20060502";
DateTime dtDate = DateTime.ParseExact( strDate, "yyyyMMdd", CultureInfo.InvariantCulture );
strDate = dtDate.ToString();
Where y stands vor years
M for months
d for days
h for hours
m for minutes
s for seconds
Should this work?
|
|
|
|
|
The value is saved in the file as an int32, not a string, the problem is that the .net datetime doesnt interpret this value the same way MFC does with CTime.
|
|
|
|