|
AFAIK, CreateObject also uses reflection like techniques to do its job.
I'm not sure how you can do without adding a reference, because C# is a statically typed language, which means that you have to have a type definition to compile.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
|
|
|
I have found a problem using Rhino (incidentally the same problem is occurring with NMock 1.1).
When I try to mock an interface which defines a method with a multi-dimensional array return type: creating the mock instance throws an error:
ClassLibrary1.SampleTest.MethodOnSampleTest_Rhino : System.TypeLoadException : Method MethodOnSample in type ProxyInterfaceSystemObject_ISample_IMockedObject_ISerializable from assembly DynamicAssemblyProxyGen, Version=0.0.0.0 does not have an implementation.
e.g.
namespace ClassLibrary1
{
public interface ISample
{
double[,] MethodOnSample(string StringArg);
}
}
using NMock;
using NUnit.Framework;
using Rhino.Mocks;
namespace ClassLibrary1
{
///
/// Summary description for SampleTest.
///
[TestFixture]
public class SampleTest
{
[Test]
public void MethodOnSampleTest_Rhino()
{
using (MockRepository mocks = new MockRepository())
{
ISample sample = (ISample) mocks.CreateMock(typeof(ISample));
Expect.Call(sample.MethodOnSample("Test"));
mocks.ReplayAll();
double[,] actual = sample.MethodOnSample("Test");
Assert.IsTrue(true);
}
}
[Test]
public void MethodOnSampleTest_NMock()
{
DynamicMock mock = new DynamicMock(typeof(ISample));
ISample mockInstance = (ISample) mock.MockInstance;
Assert.IsTrue(true);
}
}
}
Has anyone else experienced this problem and is there another mock object I can use to mock this interface?
Thanks.
[U-H]c0d3-m0nk3y
|
|
|
|
|
hi
my C#.net application has a Reminder pop up where a user enters reminder dates,name etc.
how do i make the reminder pop up from the date and time that it was set to?
here's what ive done
DataTable dtRemNow
conn=connection
SqlDatadapter da= new SqlDataAdapter("select * from reminders",conn);
da.fill(dtRemNow )
if(dtRemNow.Rows.Count > 0)
{
foreach(DataRow row1 in dtRemNow.Rows)
{
string strReminder = row1["rem date"].ToString;
if (strReminder .Length == 0) continue;
// get the date the reminder is due
DateTime dt = DateTime.Parse(strReminder);
TimeSpan tsRem = dt - DateTime.Now;
if(tsRem.TotalMilliseconds == 0)
{
}
}
}
dtRemNow.AcceptChanges();
if(dtRemNow.Rows.Count>0)
{
//show pop up for reminder
form.Popup(dtRemNow);
}
the pop up does not show
i would really appreciate if any of you can provide articles that include source code and examples
examples on creating reminder applications.
regards paula
|
|
|
|
|
This isn't quite a reminder application, but it might be useful for what you want to do.
http://www.codeproject.com/dotnet/ABTransClockArticle.asp[^]
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
i'm unable to use System.IO.IsolatedStorage.
How can i create a file into a temp volume?
|
|
|
|
|
You cannot create temporary volumes.
You can read up on Isolated Storage, with some how-to's, here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi guys,
I am trying to add my command bar in OutLook 2000 using dotnet. Do you have nay idea?
Thanks
|
|
|
|
|
Topic posted in the WebDev forum:
Topic
Please help...
___________________________________
Tozzi is right: Gaia is getting rid of us.
My Blog [ITA]
|
|
|
|
|
Dario Solera wrote: Topic posted in the WebDev forum:
No, no, no, no, no, dont cross post, ever!
xacc-ide 0.0.99-preview5 now with C#, C, IL, XML, Nemerle, IronPython and Boo highlighting support!
|
|
|
|
|
Since I don't know if the problem is about web development or simple C#, I needed to cross post...
___________________________________
Tozzi is right: Gaia is getting rid of us.
My Blog [ITA]
|
|
|
|
|
That was not a cross post, it was a reference.
It's quite ok to make a reference to another post. A cross post would spread the answers in two threads, while a reference keeps the answers in one single thread.
---
b { font-weight: normal; }
|
|
|
|
|
I want to get the header of a stream, which has been recieved into a array of byte.
Is there a safe method to get the header quickly?
Here is the header format:
length 4 bytes,
ID 4 bytes,
SN 12 bytes
Thanks!
|
|
|
|
|
If I understand correctly and you're trying to convert from a byte array to primitive integer types, you can use System.BitConverter:
<br />
byte[] data = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a };
<br />
int length = BitConverter.ToInt32(data, 0);<br />
<br />
int id = BitConverter.ToInt32(data, 4);<br />
<br />
|
|
|
|
|
You can use the ReadBytes(int) function from the BinaryReader -class
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
The BinaryReader could only read stream.
How to convert byte[] array to stream?
|
|
|
|
|
In .NET 2003 after creating a Office Project and compile, the Word is opened and a fraction later is closed...
If I clos teh VS and enter the doc created by the project the Word is opened and this error apears:
"The current .NET security policy does not permit testWordProject to run from the folder .\testWordProject_bin\. Do not change the security policy in your computer. The .Net security policy is controlled by your administartor or the developer who wrote the custom macros. .......bla bla..."
How can I solve this?
I have OffciePro 2003 and Office comps from installed from the VS DVD...
PLS HELP
"Tow things are infinite,
the Universe and human stupidity,
and I am not so sure about the former!"
Albert Einstein
|
|
|
|
|
hi, i made a vb6.0 dll and made a reference for it on a C# windows application and made a definitions for two classes of it, it worked wll on my pc but hen i try the code on another PC i got an error on the defition of theses 2 classes definition the error is:
An unhandled exception of type 'system.runtime.interopServices.COMexception' occured in OCR@WORK.EXE
Additional information: Exception from HRESULT:0x800A0030
so please anyone can help me on this problem ... i don't know why it worked on my PC in a right way but it failed while trying the code on another PC
Thanks alot
Hamody
|
|
|
|
|
If it's a COM DLL, did you register it using regsvr32?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
yeah there i tried many times to unregister it and then register it again but the error still appear ...
Thanks alot
Hamody
|
|
|
|
|
Did you create an install for the VB6 .DLL? It would appear that some dependencies are missing, like maybe the VB6 Runtime .DLL's, or some other .DLL that your .DLL is refering to.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
please may u tell me how to create an install for the VB6 .DLL
and what d u mean by VB6 Runtime .DLL's, from where i can get it
Thanks alot
Hamody
|
|
|
|
|
It's a Setup and Deployment project. Look in Start/Programs/Microsoft Visual something... whatever, I haven't used VB6 in years.
You can get the runtime here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|