|
|
Hi all,
i want to check the connectivity of my windows based mobile to my pc.
please tell me how can i use rapi for this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
...and I fail at it And somehow I can't get a working answer on Google.
I want to store an in-memory generated assembly in the database for future use. I create this assembly from generated C#. For some reason, I can serialize the object, it generates a nice byte[] which is stored in the db. But when I want to retrieve the assembly for deserialisation to my object, I get an error like "{"Unable to find assembly '9-onzk69, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'."}"
My serialization routine is:
public byte[] Formula2ByteArray(Compiler.CompiledFormula formula)
{
byte[] result = null;
try
{
System.IO.MemoryStream mStream = new System.IO.MemoryStream();
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter =
new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
formatter.Serialize(mStream, formula);
result = mStream.ToArray();
}
catch (System.Exception ex)
{
throw ex;
}
return result;
}
And my deserialisation code is:
public CompiledFormula LoadFormulaFromAssembly(byte[] array)
{
try
{
Compiler.CompiledFormula formula;
using (System.IO.MemoryStream stream = new System.IO.MemoryStream(array))
{
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter =
new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
formula = (CompiledFormula)formatter.Deserialize(stream);
}
return formula;
}
catch (System.Exception ex)
{
throw ex;
}
}
Both the application which saves it into the db and the application which uses it contain the same libraries, so the objects-structures are known to both apps. De serialisation/deserialisation routines are in the same library/class working with the same object model.
What am I missing? If I do something stupid, just tell me
The consumer isn't a moron; she is your wife.
|
|
|
|
|
The answer might be stupid as well
Just a thought, if you need to Serialize an object shouldnt that be marked with the attribute "[Serializable]"?
Hariharan.T
|
|
|
|
|
The relevant classes are marked as Serializable, as otherwise the error would be notifying me which class is not serializable. This is not the case however, thus the serialize-attribute is set correctly.
The consumer isn't a moron; she is your wife.
|
|
|
|
|
Can you modify your deserialization code a bit to narrow down where an exception is thrown?
i mean seperate try catch for deserializing and one more for the type casting to find when it fails
Hariharan.T
|
|
|
|
|
The exception is thrown on the line:
"formula = (CompiledFormula)formatter.Deserialize(stream);"
This is the only deserializationcode I have, since I let the framework handle it.
I'm suspecting the name '9-onzk69' is the name of the temporary file created by the codeprovider which compiles it, but I don't know for sure, as a system wide file search comes up empty.
The stack trace of the exception is:
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
at Compiler.CompilerSingleton.LoadFormuleFromAssembly(Byte[] array)
The InnerException is null.
The consumer isn't a moron; she is your wife.
|
|
|
|
|
friends i created outlook plugin. its work fine with me but when i give it to my client it generate an error "The surrogate pair (0xD840, 0xD840) is invalid. A high surrogate character (0xD800 - 0xDBFF) must always be paired with a low surrogate character (0xDC00 - 0xDFFF)"
My language of outlook is English and my client language is spanish.
How can i fix this error plz help me.
WANTED wasim khan(Killed 50 Innocent Buggs, Distroyed 200 Exception, make 5 Project Hostage) any Compnay Hire him will pay 30,000. Best place where u can get him is Sorcim Technologies Murre Road RWP
|
|
|
|
|
My guess would be that it is having problems with the "special" characters present in those languages.
Are you using the Encoding.UTF7 or Unicode to do the encoding?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
HI
Can anyone help me, creating a bar chart using crystal reports
it's uses a simple Database table
TableName|WaiterResponseTime
Table 1 | 30 seconds
Table 2 | 20 seconds
i want the graph to show thable name on the x axis and Waiter Response Time in seconds on the y axis
i got this working fine, however it's not displying the seconds correctly, i think it's doing a count and showing how many times a table appears in the database instead of displaying the corresponding seconds value
thanx in advance
|
|
|
|
|
I have a simple C# exe. It internally has some calls to custom interop. I dont have any problem in executing it manually by either double clicking the exe or thru command prompt, everything works as expected. But the moment i launch it using windows scheduled task it always fails.
It fails with the following exception,BTW i am using W2K.
Error: Unable to cast COM object of type 'Interop.DynamicDCOM.RetPointerClass' to interface type 'Interop.DynamicDCOM._RetPointer'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{8E3511C2-23CE-4098-92DC-D86E8C26ECF3}' failed due to the following error: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
I have the right user permission to run this task, same as windows logon, also member of administrator group on the box.
Any suggestion/solution?
Thanks in advance....
Hariharan.T
|
|
|
|
|
Log the name of the Windows User at startup
--edit--
I know it's a short answer, but I think that Colin[^] may have a point. And it would seem logical to verify his statement and answering his post.
I are troll
|
|
|
|
|
Thanks for the reply!!!
just got it fixed The issues is the component service running on the machine didnt have the Administrators group in the Default Security -> Default Access Permission. Adding it resolved the issue.
Hariharan.T
|
|
|
|
|
I am looking for a solution to converting a byte array to an image using the compact framework(windows mobile application). I have tried multiple ways, but the restrictions of the compact framework are proving to be very difficult because the Image.FromStream is not part of the
This code was posted by me...
|
|
|
|
|
Hi,
did you tried to save the byte-array into a file, and loading the image from file. Maybe that's just a nasty hack, but it will work until you find a better solution
Regards
Sebastian
|
|
|
|
|
i m giving the code code and i m getting just "Exception".i cant understand wht exception is it.sometimes i m getting outofmemory exception.the line that throws exception is
pictureBox1.Image = new Bitmap(File.Open("\\Program Files\\syswifi\\pic\\screen.Bmp",FileMode.Open,FileAccess.Read));
this line raises another exception too "the process cannot access the files \Program Files\\syswifi\\pic\\screen.jpg because it is used been used by another process"
System.IO.MemoryStream ms = new System.IO.MemoryStream(data);
try
{
FileStream fs = new FileStream("\\Program Files\\syswifi\\pic\\screen.Bmp", FileMode.Create);
ms.WriteTo(fs);
fs.Close();
ms.Flush();
ms.Close();
pictureBox1.Image = new Bitmap(File.Open("\\Program Files\\syswifi\\pic\\screen.Bmp",FileMode.Open,FileAccess.Read)) ;
}
catch(Exception ex)
{
MessageBox.Show("Failed to display" + ex.Message);
}
This code was posted by me...
modified on Wednesday, July 8, 2009 6:33 AM
|
|
|
|
|
hmm, are you sure that it is this line? it is trying to access a jpg...
I would call the fs.Close after ms.Flush, so that the data can flew into the FileStream.
|
|
|
|
|
Bitmap has a constructor that takes in MemoryStream as parameter. Something like this:
MemoryStream oMemStream = new MemoryStream(yourByteArray);
Image oImg = new Bitmap(oMemStream);
Does this works with Compact Framework?
|
|
|
|
|
its giving an exception "value does not fall with in range"
This code was posted by me...
|
|
|
|
|
Can you show some code you have written and the line giving error?
|
|
|
|
|
i m giving the code code and i m getting just "Exception".i cant understand wht exception is it.sometimes i m getting outofmemory exception.the line that throws exception is
pictureBox1.Image = new Bitmap(File.Open("\\Program Files\\syswifi\\pic\\screen.Bmp",FileMode.Open,FileAccess.Read));
this line raises another exception too "the process cannot access the files \Program Files\\syswifi\\pic\\screen.jpg because it is used been used by another process"
System.IO.MemoryStream ms = new System.IO.MemoryStream(data);
try
{
FileStream fs = new FileStream("\\Program Files\\syswifi\\pic\\screen.Bmp", FileMode.Create);
ms.WriteTo(fs);
fs.Close();
ms.Flush();
ms.Close();
pictureBox1.Image = new Bitmap(File.Open("\\Program Files\\syswifi\\pic\\screen.Bmp",FileMode.Open,FileAccess.Read)) ;
}
catch(Exception ex)
{
MessageBox.Show("Failed to display" + ex.Message);
}
This code was posted by me...
|
|
|
|
|
if i use this code
MemoryStream oMemStream = new MemoryStream(yourByteArray);
Image oImg = new Bitmap(oMemStream);
picturebox1.Image=oImg;
the exception "value does not fall within expected range" is raised in line 2
This code was posted by me...
|
|
|
|
|
Vivek Vijayan wrote: value does not fall within expected range
There can be two reasons, either that btye array is not a valid bitmap or your device cannot decode the image.
|
|
|
|
|
how can can i load an image from a file in to a picture box in mobile application (not using filedialog)
This code was posted by me...
|
|
|
|
|
What kind of byte array is it? Raw pixels or a complete image with header and all?
|
|
|
|