Click here to Skip to main content
15,886,362 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Creating Round Buttons Pin
SJ_Phoenix15-Apr-04 9:46
SJ_Phoenix15-Apr-04 9:46 
GeneralMicrosoft.DirectX.DirectSound recording levels Pin
bobbiek9-Apr-04 3:30
bobbiek9-Apr-04 3:30 
GeneralSerialize PrinterSettings Pin
Dimitris Iliopoulos9-Apr-04 3:14
Dimitris Iliopoulos9-Apr-04 3:14 
GeneralRe: Serialize PrinterSettings Pin
Mazdak9-Apr-04 3:22
Mazdak9-Apr-04 3:22 
Generaldynamic types cast Pin
iZakaroN9-Apr-04 2:53
iZakaroN9-Apr-04 2:53 
GeneralRe: dynamic types cast Pin
Roman Rodov13-Apr-04 15:12
Roman Rodov13-Apr-04 15:12 
GeneralRe: dynamic types cast Pin
iZakaroN14-Apr-04 5:08
iZakaroN14-Apr-04 5:08 
GeneralRe: dynamic types cast Pin
Roman Rodov14-Apr-04 15:52
Roman Rodov14-Apr-04 15:52 
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
GeneralDundas Components Pin
mmikey78-Apr-04 13:21
mmikey78-Apr-04 13:21 
GeneralRe: Dundas Components Pin
Colin Angus Mackay8-Apr-04 14:03
Colin Angus Mackay8-Apr-04 14:03 
GeneralRe: Dundas Components Pin
mmikey78-Apr-04 14:11
mmikey78-Apr-04 14:11 
GeneralRe: Dundas Components Pin
Colin Angus Mackay8-Apr-04 14:26
Colin Angus Mackay8-Apr-04 14:26 
GeneralRe: Dundas Components Pin
mmikey78-Apr-04 14:32
mmikey78-Apr-04 14:32 
GeneralRe: Dundas Components Pin
Colin Angus Mackay8-Apr-04 14:49
Colin Angus Mackay8-Apr-04 14:49 
GeneralRead a COleDateTime in Compact Framework Pin
Phil J Pearson8-Apr-04 1:41
Phil J Pearson8-Apr-04 1:41 
GeneralRe: Read a COleDateTime in Compact Framework Pin
Mike Dimmick8-Apr-04 2:25
Mike Dimmick8-Apr-04 2:25 
GeneralRe: Read a COleDateTime in Compact Framework Pin
Phil J Pearson8-Apr-04 2:35
Phil J Pearson8-Apr-04 2:35 
GeneralRe: Read a COleDateTime in Compact Framework Pin
Mike Dimmick8-Apr-04 5:53
Mike Dimmick8-Apr-04 5:53 
GeneralPocket PC 2003 emulator without VS .NET Pin
User 9625787-Apr-04 10:12
User 9625787-Apr-04 10:12 
GeneralRe: Pocket PC 2003 emulator without VS .NET Pin
Roman Rodov7-Apr-04 14:47
Roman Rodov7-Apr-04 14:47 
GeneralRe: Pocket PC 2003 emulator without VS .NET Pin
User 9625787-Apr-04 19:49
User 9625787-Apr-04 19:49 
GeneralRe: Pocket PC 2003 emulator without VS .NET Pin
User 96257810-Apr-04 9:05
User 96257810-Apr-04 9:05 
General.net CF Pin
monn6-Apr-04 17:04
monn6-Apr-04 17:04 
QuestionHow to create Help files in windows Pin
Sreepathi6-Apr-04 16:13
Sreepathi6-Apr-04 16:13 
GeneralIDE Pin
monn6-Apr-04 6:07
monn6-Apr-04 6:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.