|
|
Yes, unfortunately with the security changes in .NET 1.1 this is no longer allowed since the following error occurs...
Because of security restrictions, the type System.Runtime.Remoting.ObjRef cannot be accessed
|
|
|
|
|
Sure, but that's easy to come by.
Here's an article by Ingo Rammer[^] about the changes in .NET 1.1.
One more thing, you'll have to override InitializeLifetimeService() to return null on the class being published for remoting or its lifetime lease will run out after approx. 2 minutes, meaning that you'll get an error when you start a second instance of your app after >2 minutes.
I've already contacted Chris Anderson, but he doesn't plan to update his article
Regards,
mav
|
|
|
|
|
Hi,
I want to develop/use expense management tool similar to Microsoft's PocketPC Expense. I would like to create categories on the fly and data to be stored in xml for easy porting? Does any one has source code or ideas to do this?
Can any one point me to a open source for this?
|
|
|
|
|
If you're going to develop such a product, then you shouldn't need source. If you want to find source, I recommend that you do a search. The CodeProject C# forum is here to provide help with questions specific to the C# language and related .NET/CLI questions, not provide specifications and general help on product decisions.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
I'm working on a control that I'd like to have enabled in both XP themes and conventional windows style.
One of the things I am baffled by is the gradiant color in the header bars of normal windows. These are done using two seperate colours, now I can only see a way to get the first colour from the system Active/InactiveCaption. How would I go about getting the second color?
Cheers
Cata
|
|
|
|
|
SystemColors.ActiveCaption and SystemColors.InactiveCaption give you your gradient colors, but the gradient in XP's themes are not set by Display/Appearance properties; it is from a theme comprised of bitmap resources that currently does not have a public authoring release. There are cracks to enable your own, but in order to use XP themes (either legit or from a cracked uxtheme.dll) in a custom control, you need to read the Visual Styles Reference[^] and P/Invoke the necessary APIs.
There are articles detailing this here on CodeProject. Try searching.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Sorry mate, i think i was a bit unclear.
I've got the XP styles working perfectly. My problem is with making non XP style conrols look.. well.. like non XP controls.
One of the things i found was at work today, looking through the display settings for NT, was that the header bars of the windows go from one customisable color, to another.
I'm not sure where I could find these two variables, as i'd like my control to conform to the enviroment standards. Does what you said still stand? Or do i need to call some GDI+ or some other system DLL to find out these two values?
I was under the impression that inactive caption was some other color entirely. I'll have a closer look at NT tommorow.
Thanks for the input anyhow.
Cata
|
|
|
|
|
SystemColors.ActiveCaption and SystemColors.InactiveCaption give you the 1st colors for the gradients. To get the other colors, you need to P/Invoke GetSysColor like the other reply mentioned.
To convert the DWORD return value use ColorTranslator.FromWin32 or Color.FromArgb .
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
You have to use the API Function:
<br />
[DllImport("User32.dll", EntryPoint="GetSysColor")]<br />
public static extern int GetSysColor(long nIndex);<br />
The Integer you get is in the Form (hexadecimal)
<br />
0x00bbggrr<br />
(if I remeber right).
For the second color of the Title Bar gradient you need the color with the index 27. More info should be in the API description.
Greets
Roland
|
|
|
|
|
Does anyone know if the refresh version has any new featured/bug fixes? On the website it says its the same beta, plus Team Systems. I don't want to download 3.5GB just to get team systems.
|
|
|
|
|
Hi there,
I'm writing a C# application and using a C#Express Beta2 and SQLExpress Beta2:
I've created an object (say 'Human') which I persist to a SQL DB table. Human has a DateOfBirth property of the (.Net) type DateTime. The apropriate field in the table is of SQL type DateTime. Now I create an instance of my Human and set the DateOfBirth to yesterday using the following code:
Human Human1 = new Human();
Human1.DateOfBirth = new DateTime.Now.Substract(new TimeSpan(1, 0, 0, 0));
Then that I persist my you Human to the database. After that I create a new instance of my Human (Human2) and read it's property-values from the database, like:
if(Human1.DateOfBirth == Human2.DateOfBirth) {
}
Comparing Human1's DateOfBirth with Human2's I do not get the expected result as the two DateTime objects return the same Date and Time, but looking at the DateTime.Tick property I see some fractional differences .
How do you handle this? Thanks in advance.
Matthias
If eell I ,nust draw to your atenttion to het fakt that I can splel perfrectly well - i;ts my typeying that sukcs.
(Lounge/David Wulff)
www.emvoid.de
|
|
|
|
|
The dates are probably not the same because the Time is included in it as well. So if one Human was saved 1 o clock and the other at 3 o clock, the datesTIME's wouldn't match. so match only the Date parts:
if(Human1.DateOfBirth.Date == Human2.DateOfBirth.Date) {
// this code is never reached
}
|
|
|
|
|
Human1.DateOfBirth = DateTime.Now.Date; // init with only the date portion.
Gary
"A fellow with the inventiveness of Albert Einstein but with the attention span of Daffy Duck."
Tom Shales talking about Robin Williams
|
|
|
|
|
I'm pretty sure this has a simple answer, but nothing I've found so far (of course, the tight deadline has nothing to do with that!).
I need something with CStringList-like capabilities -- I want to keep up with between 2 and 500 (or more) strings and quickly iterate through them. What is the C# equivalent that allows me to do this?
Thanks,
Glenn
|
|
|
|
|
I'm not sure how CStringList works, but System.Collections.Specialized.StringCollection allows you to store list of strings and iterate thru them using foreach statement.
|
|
|
|
|
You beat me to it!
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
That's it exactly. Thanks.
|
|
|
|
|
|
Thanks for the clicky bits.
Ever notice that MSDN code samples don't display in FireFox as they do in IE (all the linebreaks seem removed in FF). Just a peeve directed as MS.
Thanks again for the correct and fast reply.
--G
|
|
|
|
|
Glenn E. Lanier II wrote:
Ever notice that MSDN code samples don't display in FireFox as they do in IE
Nope, I always use IE.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi all,
I'm having a bit of a problem. The company i am working for run some scheduling software on WINNT which runs programmes at specific times. We are about to start rolling out upgraded back office PC's to our shops and we are going to be using XP for the OS.
The problem is, as if you can't see this one coming , the scheduling software isn't working on XP!
I've been looking into staring external programmes from within a C# app which i could install to run as a service. When i'm trying to run EXE's there is no problem
System.Diagnostics.Process.Start("c:\\MyExe.exe");
but, one of the applications is a Dos application and it's ran via a batch file
Set IRISDATA=j:
XM IRIS7
Simply using the command System.Diagnostics.Process.Start("j:\\iris7.exe"); doesn't work.
The question is, how can i run the batch file from a c# app?
Kev Pearman MCAD
P.S. The J drive is already mapped correctly!
|
|
|
|
|
Hi Kev!
Batch files are run by the shell, so you could write:
<br />
System.Diagnostics.Process.Start("cmd.exe", "/k startiris.bat");<br />
Regards,
mav
|
|
|
|
|
Cheers Mav.
It didn't quite work but with some modifications to the batch files i wanted to run i got there in the end.
One more question though, the program can be made full screen by pressing Alt + Enter, anyway of running the batch file full screen at start up?
Kev Pearman MCAD
|
|
|
|
|
To determine how an external program is run you'll have to resort to a different Process.Start() overload using a ProcessStartInfo argument.
There you can specify the WindowStyle to use (Hidden, Maximized, Minimized, Normal).
mav
|
|
|
|