|
Your question is not very clear, so here are two different answers:
To find the lowest of four values:
int lowest = Math.Min(Math.Min(v1, v2), Math.Min(v3, v4));
To find out if any of four values is equal to MinValue:
bool isMin = (v1 == int.MinValue || v2 == int.MinValue || v3 == int.MinValue || v4 == int.MinValue);
---
b { font-weight: normal; }
|
|
|
|
|
|
i have winapp that use dll (assembly)
im createing in runtime object from the assembly.
then destroy this object.
THEN , while the winapp is STILL RUNNING , i want to Recompile the dll (assembly) , and to use the winapp AGAIN to create object from that assembly .(this way i could ,change the code of the object ,if i found bug, and use it again).
since there was no method like Assembly.Unload(), I use AppDomain,
but with that I still can't unload the assembly.
Here is what my program going
---
class Program
{
static void Main(string[] args)
{
MyTest.Test();
}
}
public class MyTest
{
public static void Test()
{
string assemblyFile = @"D:\XC.dll"; //(1)
string typeName = "XC.Form1"; //(2)
AppDomain appDomain = AppDomain.CreateDomain("Domain test");
try
{
ObjectHandle oh = appDomain.CreateComInstanceFrom(assemblyFile, typeName);
object o = oh.Unwrap();
IXC ixc = (IXC)o; //(3)
}
catch (Exception ex)
{
}
}
};
--
(1)the assebmly file path I want to load
(2)the Type I want to create which implement the IXC interface, and the IXC interface was in the assembly "develop.dll" which is used by the winapp
(3) when it goes to here, I got a exception:
$exception {"Type 'XC.Form1' in assembly 'XC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable."} System.Exception {System.Runtime.Serialization.SerializationException}
--
Any help would be appretiated!
Aaron Lu
|
|
|
|
|
What you are trying to attempt is alot more complicated than what you have there. There are many rules to remoting that must be understood, else you will spend weeks on a pointless journey. Specifically focus on types crossing domain boundries.
Regarding the issue @ (3). Your type has to be marked Serializable or inherit from System.MarshalByRefObject . There could be more, but that is the general way.
|
|
|
|
|
But if I have IXC inherit from System.MarshalByRefObject
then I got a new exception, says: "Unable to cast transparent proxy to type 'IXC'".
|
|
|
|
|
Hi
As leppie said, this gets quite complicated.
In answer to your question, you unload the whole AppDomain , not individual assemblies.
Also, cross-domain calls are slow - this may or may not be a factor for you.
You might want to load your assembly into your main AppDomain . You could copy it first and load it from the copy so that the original file is not locked. Then you can re-compile and repeat the process for the new assembly - they will be treated as different if they have different version numbers.
----------------------------
Be excellent to each other
EasiReports[^] My free reporting component for WinForms.
|
|
|
|
|
recently.. i have this project which is to write a sliding number puzzle code in C language.. something similar to the sliding puzzle game that was written piscian1982 http://www.codeproject.com/csharp/slidingpuzzle.asp[^]
however.. i could not figure out how to imply that for numbers because i have to write this program in the sense that it runs in msdos(a console application)...
so i was wondering how to do the input for sliding the numbers using the keyboard..
so can any one pls pls help me...
my complier is visual c...
if possible.. can you provide me with a source code in *.c
thanx!!
-- modified at 4:32 Monday 27th March, 2006
|
|
|
|
|
You have far better chances to get help if you post the question in the correct forum, e.g. the VC++ forum.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I m trying to call an AJAX Method from a javascript method...It's working fine with IE Browser...but not with fire fox...
Pls Help me out to sortout this Problem...
Thanx & Reagrds
Anuj Kamthan
Software Developer
Solversa Technologies,
Pune - 411007, India.
http://www.solversa.com
|
|
|
|
|
What do you mean by an "AJAX Method"?
My psycic powers are not at their best right now, so I guess you have to post your code in the forum for anyone to take a look at it...
---
b { font-weight: normal; }
|
|
|
|
|
|
Was that intended as a reply to my post?
---
b { font-weight: normal; }
|
|
|
|
|
|
Why? Did you think that I don't know what AJAX is?
---
b { font-weight: normal; }
-- modified at 7:24 Monday 27th March, 2006
|
|
|
|
|
In a word...yes.
You wrote: What do you mean by an "AJAX Method"?
I didnt mean to offend. Thought id link to wiki in case anyone didnt know what ajax was....not specifically you.
|
|
|
|
|
This my JavaScript Function
function Leaf()
{
alert("Before Fuction Calling");
var List = My.Page.ChangeLeaf(); <u>--> <b>"Here I m Calling my Ajax method"</b></u>
alert("After Fuction Calling");
}
Code In my .CS File ...
[Ajax.Method]
public string ChangeLeaf()
{
return "Testing";
}
This Function is not getting call in firefox...It's working fine in IE.
Thanx
Anuj Kamthan
Software Developer
Solversa Technologies,
Pune - 411007, India.
http://www.solversa.com
|
|
|
|
|
As there is no AJAX code at all in that code, what library are you using?
---
b { font-weight: normal; }
|
|
|
|
|
Hii Guffa,
I have downloaded an ajax.cs file from " http://en.wikipedia.org/wiki/AJAX "
and Include that in to my Project...
this is a 6th relese of ajax library, i m using in my project...
Actually I m new to use AJAX so might be not getting u...what exactly u want to know.
Thanx & regards
Anuj Kamthan
Software Developer
Solversa Technologies,
Pune - 411007, India.
http://www.solversa.com
|
|
|
|
|
Wikipedia does not develop program libraries. There are many different AJAX libraries. Where did you go to download it?
---
b { font-weight: normal; }
|
|
|
|
|
Hi Guffa,
Good Morning,
Can u tell me where should i download the latest AJAX library...
Thanx & Reagrds
Anuj Kamthan
Software Developer
Solversa Technologies,
Pune - 411007, India.
http://www.solversa.com
|
|
|
|
|
AJAX is a technology, not a product. There is no owner of the AJAX concept, so there is no "The AJAX Library".
---
b { font-weight: normal; }
|
|
|
|
|
What Library are you using....??/
Mind think with Ideas,not Data. No amount of Information or Data could be compared with an inspired thought.
|
|
|
|
|
What?
---
b { font-weight: normal; }
|
|
|
|
|
Hi all,
The AJAX Problem is Resolved... Thanks a lot for your appreciation
I have used AJAX 5.7.25.1 Lib. and now it's working fine...
Thanks once again...
Thanks & regards
Anuj Kamthan
Software Developer
Solversa Technologies,
Pune - 411007, India.
http://www.solversa.com
|
|
|
|
|
Hi all,
I am in a company where the requirement is to post the data query in XML format (our client's schema) to their HTTPS site with authorization and get back their XML data and show it in a datagrid.
I need help in understanding how it all works, because when I am trying to post my xml doc with Https basic authentication header field and xml data as a string , I am just getting an exception Forbidden. It doesn't mean that it went to the Https site and I got back a foridden as response because it wasn't a response but a "Forbidden" exception on my side. What does this mean? What am I doing wrong, does this mean my side is not SSL enabled? Is it why i am getting this exception?
Please do help me i am very much in need of help.
Thank You,
Sowmya Mulukutla,
UAB
|
|
|
|