|
Hi,
Has anyone tried using iButtons on .NET?
I cant seem to make it work.
I tried Creating a Runtime Callable Wrapper out of the COM component, using tlbimp.exe
and then referenced it in the project.
I noticed that all the methods return Object type and not what they are supposed to.
For example:
OneWireAccessProvider provider = new OneWireAccessProvider();
DSPortAdapter adapter = provider.getDefaultAdapter();
getDefaultAdapter() returns an Object and not a DSPortAdapter as it was supposed to.
Casting it doesn’t work.
I also tried referencing OneWireAPI.dll,
everything compiles right but when running :
DSPortAdapter adapter = OneWireAccessProvider.getDefaultAdapter();
I get An unhandled exception of type 'java.lang.UnsatisfiedLinkError' occurred in vjslib.dll
Please anyone ?
|
|
|
|
|
I have a Windows Application written in VB.Net that needs a face lift. I've created a button console VERY similar to the one in Microsoft Windows Media Player, but I'm having problems creating the Windows Forms buttons. I have all the images, but dont know how to make create round buttons in VS.Net. The built in button controls seem to only support square or rectangular shaped buttons. Does anyone know of any samples or have any advice on how to accomplish this? Any help would be appreciated!
Anthony S. Kilhoffer
"Work like a slave, create like a god!"
|
|
|
|
|
if you want to write controls with non-rectangular
shapes you can do it like this
for example:
Button bu = new Button();
GraphicsPath gp = new GraphicsPath();
//here you can add any shapes you want
gp.AddEllipse(0,0,300,300);
bu.Region = new Region(gp);
with the Region-property of the button you set the button to the non-rectangular shape you have created with the GraphicsPath instance.
|
|
|
|
|
I can record a phone call via the soundcard using the class's found in
Microsoft.DirectX.DirectSound, but cant figure out how to display the
recording levels while the call is happening (like the Sound Recorder
app found in Windows).
Any one have any idea on how to do this?
Thanks in advance for any help.
|
|
|
|
|
I have tried in a program to serialize the PrinterSettings class using the BinaryFormatter but an error come up saying that tristate is not serializable even if the PrinterSettings class is serializable.Does anybody know how can i overcome this problem
Thanks in advance
From Greece:
Dimitris Iliopoulos
dimilio@yahoo.com
|
|
|
|
|
You can write your own your custom class and store printer setting in it and serialize it.
Mazy
"I think that only daring speculation can lead us further and not accumulation of facts." - Albert Einstein
|
|
|
|
|
I need functionality that check that one type can be cast explicitly to another. I want to note that need explicit cast not convertion in mean of Convert ot TypeConvert classes. So I need the follow function:
bool CanCast(Type sourceType, Type destType)
{
....
}
and another
object Cast(object val, Type castType)
{
...
}
Anybody have idea how this can be done?
|
|
|
|
|
You're in luck, there is already a method in the framework that does that.
bool CanCast(Type sourceType, Type destType)
{
return destType.IsAssignableFrom(sourceType);
}
not sure what you want to do in the second method because an "object" is a type that ANY object in the framework and in your own class libraries can be casted to. Basically it is pointless to try to cast object type parameter 'val' to the 'castType' and then return an 'object' again. If you wanted to "create" and object of a type that is only known at runtime you can use the Activator class methods to do that.
|
|
|
|
|
IsAssignableFrom work for inheritance but not for explicit or implicit cast. About second method maybe you are right, but I'm not sure that there will have no preblems if I work with boxed long instead of int, if int is required (like parameter value for SQLCommand as example).
So I want to check if object from some type can be safly casted to another type. I have tried to find what cast operators the type have but have not found anyway to do that. Maybe there is some method like Type.GetMembers() that return all cast opertors for specific reflected type? (GetMembers() do not return cast operators)
|
|
|
|
|
Well you can always enclose the casts that are important in a try...catch block and catch the InvalidCastException. I mean using exceptions to control a program flow is not a good programming practice, but I don't see another way to do it at runtime. What are you going to be casting? Something like this:
object someExternValue = ... get this value ...;
int param = (int) someExternValue;
If you are doing it like that, you can use the Convert.GetTypeCode method to get a TypeCode of an 'object' variable. So
TypeCode tc = Convert.GetTypeCode(someExternValue);
if (tc != TypeCode.Int32)
{
.. ok to cast to int ..
} else {
.. not ok ...
}
hope this helps
|
|
|
|
|
Hi everybody,
What do you think? What is better choice: Dundas Ultimate Toolbox or Dundas Chart for ASP.NET???
thanks in advance
|
|
|
|
|
That is like asking "Which is better: a washing machine or a fridge?"
If you are going to be drawing charts in ASP.NET then go for Dundas Chart. If you are going to be developing Windows applications using MFC go for Dundas Ultimate Toolbox.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
Hi Colin,
I'm going to be developing both(charts in ASP.NET, Win. App. with MFC). I would like know your opinion which one is more useful?
|
|
|
|
|
First, I've not used the Ultimate Toolbox and it has been a few years since I did and MFC development, so I cannot really comment on that. From what I've seen on the web site it looks great.
Dundas Chart is one of the best charting toolkits available so I'd recommend it.
But back to my previous post: "Which is better a fridge or a washing machine?".
If you're going to be working on both projects why not get both. If it is a budget problem and you only have the resources for one then you need to prioritise. (Using my analogy above) Do you need to wash your clothes more urgently than store cold food?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
|
Miško wrote:
So, this is reason, why i'm asking "stupid" question.
Sorry, I didn't mean to cause offense. I never said your question was stupid.
What I was trying to do was to draw the answer from you. I think that you are the only person that knows the answer to the question, because you know best what you are likely to be doing in the near future.
Why not look at it another way? Which will you get more long term use from?
Which ever choice you go for, good luck.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
I am developing a Compact Framework app that reads files created by a "legacy" desktop application.
One of the values it must handle originated as a COleDateTime and was written to the file as a double . I can read the double easily enough, but how can I get it into a System.DateTime ?
Thanks in advance for any advice.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Convert it using the rules for DATE :
public static DateTime DateTimeFromOADate( double oaDate )
{
DateTime dtOrigin = new DateTime( 1899, 12, 30, 0, 0, 0 );
double absDate = Math.Abs( oaDate );
double intPart = Math.Floor( absDate ) * Math.Sign( oaDate );
double fracPart = absDate - Math.Floor( absDate );
DateTime dtConv = dtOrigin.AddDays( intPart );
dtConv = dtConv.AddDays( fracPart );
return dtConv;
} The bizarre maths comes from the fact that DATE isn't a true number-line: a number's whole part and fractional part are considered separately. The whole part is a number of days relative to 30 December 1899, while the fractional part is always a positive offset to the time within that day (e.g. a fraction of 0.25 always represents 06:00, even if the number is negative).
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Excellent! Thanks.
I just came up with the same thing except for the bizarreness. I think I can do without the bizarreness anyway. The application in question wasn't recording data before 30 Dec 1899!
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
I like to be complete
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Do you need VS. NET to run the Pocket PC 2003 emulator, I have Borland's C# Builder (free) and wanted to try some some programing for it since i dont have a Pocket PC yet.
modified 16-May-21 21:01pm.
|
|
|
|
|
|
yea its what i was afraid of beging a 56k'er. I just read on the help file that came with the SDK and it said something about starting the emulator without eMbedded Visual C++, using the command line, but i guess you need the eMbedded C++ or VS .Net.
modified 16-May-21 21:01pm.
|
|
|
|
|
Can i still run my .Net apps (well .Net compact) with the pocket PC emulator in eMbedded Visual Tools?
modified 16-May-21 21:01pm.
|
|
|
|
|
hi, its me again is there a free tool for developing applications for pocket pc/smart phones the uses the .NEt Compact Framework?
Is the .NET Compact framework SDK available for download?
Can SharpDevelop do mobile applications?
thanks a lot
|
|
|
|