|
Hi!
Some source code, please.
How do you manage to Serialize/Deserialize a Singleton?
Singleton.Instance = (Singleton)formatter.Deserialize(fs); // Error Singleton is readonly
/Gywox
|
|
|
|
|
Use the System.Xml.Serialization.XmlSerializer class to serialize. As for managing a Singleton that is not a serialization issue but a design issue. But for grins and giggles, in the serialization constructor overwrite your static instance for the singleton.
formatter.Deserialize(fs);
public SomeConstructor(SerializationInfo info, StreamingContext context) {
...
SomeConstructor.me = this;
}
File Not Found
|
|
|
|
|
Hi, I got stuck in a problem and don't know what to do. In my web form. I am trying to display a ModalPopup window(Ajax) when I click on a link button. It gets displayed behind the flash image object which i have in the center of my web form. The modalpopup works completely fine if i remove the flash image object.
I need to make this working is there a way to do. Please help me
Thanks
|
|
|
|
|
I was trying to allow a user to resize one of the panels on my form (by moving arrowicons). However I get these errors.
'System.Windows.Forms.Control.Location' because it is not a variable
'System.Windows.Forms.Control.Size' because it is not a variable
here is what I was trying to do:
AOIpanel.Location.X = leftEdgeArrow.Location.X;
AOIpanel.Location.Y = (centerArrow.Location.Y +(AOIpanel.Size.Height/2));
AOIpanel.Size.Width = (rightEdgeArrow.Location.X - leftEdgeArrow.Location.X);
-- modified at 16:24 Wednesday 21st February, 2007
|
|
|
|
|
Hi,
setting Control.Location.X or Control.Size.Width does not help
(see the remark at Control.Location).
if you want to change the Location or Size you must either use "new Point()" or "new Size()",
or the properties Left, Top, Width, Height.
But it would not generate the errors you mention either (unless the code you are showing is not
actually the code you are compiling). I assume you tried to use Location.X etc. as an
out or ref parameter, which is impossible, out/ref requires a variable, a struct or
a class object, but not a part of them (such as a struct field).
|
|
|
|
|
Hi Guys!
I am having a weird problem with one of our computers here at work, my application uses crystal report viewer with C# application designed in VS2003. All computers print the report just fine but this one computer prints a few rows and columns and then cuts off the rest of the print and if the user goes back and tries to print again the same report then it prints just fine. I am not sure why this is happening, could it be the printer driver.
PLEASE HELP!!!
sasa
|
|
|
|
|
Is it possible to make the mouse pointer follow moving objects on the screen?
|
|
|
|
|
|
I have an application that save some sort of information in a an xml file. I want to control that application remotely so I want to save that xml file in a web service.
I want to how I can save an xml file via a web service
|
|
|
|
|
Accept an XmlDocument as the parameter to the webservice. Then call the save method.
[WebMethod]
public string SaveXml(XmlDocument document){
string fileName = Guid.NewGuid().ToString();
document.Save(fileName);
return fileName;
}
File Not Found
|
|
|
|
|
Hi
I have created a webservice with a simple function HelloWorld. It works fine in the client application.
How do I change the default url of the webservice that points to the asmx file? I know that I can change in Reference.cs in the client application. But I want to set the default url other than localhost to point to a server where my asmx file is.
I am using VS 2003, C#.
Thanks a lot in advance
Muthu.
|
|
|
|
|
Click the web reference you want to change. Look in the properties window and change the URL Behavior to Dynamic. This will create an entry in your app.config file (or web.config for web projects). This file can be modified before run time to point to the right place.
Also, if you want to save hours of problems down the road change the Web Reference URL to an invalid URL in the properties panel and rely on the generated key.
A sample app.config entry
<add key="SimpleTest.localhost.Service1" value="http://localhost/testsite/Service1.asmx"/>
<pre>
<div class="ForumSig"><hr><font size="-2">File Not Found
</font></div>
|
|
|
|
|
Dear All,
i have a Unmanaged c++ based Library and i want to use it C# application(i.e. it expose some c based function .. ).. could some one give some pointer to use unmanaged library in c#.. so that i don't have to provide some extra dll or lib with c# to my end user....
thanks in advance
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
ThatsAlok wrote: so that i don't have to provide some extra dll
It doesn't work that way, you will still need to include the C++ dll.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: t doesn't work that way, you will still need to include the C++ dll.
i have C++ Library and related Header file.. now if get some pointer to proceed .. that will be great help from your side .. i am little confused how to call these function in c#...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
|
Mark Nischalke wrote:
Using Unmanaged code and assembler in C#[^]
thats a great article...! sorry if i sounding like child.. could i use to DLLimport to import my ABC.lib.. or i have to use some other method!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
DllImport only works with unmanaged DLLs. An unmanaged static library (LIB) can't be used this way from C#. Only C++/CLI can mix managed and unmanaged code.
As far as I can see you have 4 options:
- Take the sources and convert them to C#.
- Change the unmanaged project to build a DLL and then use DllImport .
- Create a mixed mode (managed - unmanaged) wrapper DLL in C++/CLI.
- Write the client application in C++/CLI.
Regards,
Tim
|
|
|
|
|
I want to paint a particular part of image and display it on the form that is I want to display the picture not its background... I have differentiated between both the background pixels and picture pixels using lock mode and bitmap data. Now how can I display that required portion on the form??? Can any buddy help?????
How can I keeep the bitmap image in buffer just like BufferImage class in java do we have anything like this in C#.......
|
|
|
|
|
If you want to show only certain parts of an image, set all the other pixels to a color ( magenta is good, 255, 0, 255 ), and use the ImageAttributes class and one of the versions of DrawImage that takes it, to draw with transparency
samreengr8 wrote: How can I keeep the bitmap image in buffer just like BufferImage class in java do we have anything like this in C#.......
The image stays in memory if it's in a variable, I assume this is not what you mean ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: use the ImageAttributes class
Can u tell me how to use it If I want to write those pixels on another bitmap image.....
Christian Graus wrote: The image stays in memory if it's in a variable, I assume this is not what you mean ?
No its image that stays in memory I want the bitmapdata and then want to paste another bitmap to merge to bitmaps and then draw it.......
Well thanx 4 ur response
|
|
|
|
|
OK, well, the bitmapdata is always in memory, you just have to access it. See my image processing articles.
samreengr8 wrote: Can u tell me how to use it If I want to write those pixels on another bitmap image.....
You need to get a graphics object using Graphics.FromBitmap, using your other bitmap, then draw onto it as normal.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Im using setColorKey method of Image attribute class some of the background gets transpareny but still the areas just near the portion I want to display is still showing the background...... Can u help me in this......
Im using
<br />
ImageAttributes imgattrib = new ImageAttributes();<br />
imgattrib.SetColorKey(m_Bitmap.GetPixel(0, 0), m_Bitmap.GetPixel(0, 0));<br />
using (Graphics g = Graphics.FromImage(b_Bitmap))<br />
{<br />
g.DrawImage(m_Bitmap, new Rectangle(pt4.X, pt4.Y, frect.Width, frect.Height), 0, 0, m_Bitmap.Width, m_Bitmap.Height, GraphicsUnit.Pixel, imgattrib);<br />
}<br />
Am I using any wrong method????? Wht should I do to make that areas transparent......... THANX
|
|
|
|
|
Hello,
I need your help,
I want to implememnt a hough transform algorithm to find circles in an image ( or any another appropriate algorithm).
Thanks alot.
|
|
|
|
|
Read my image processing articles on this sitefor info on how to access the pixels of an image. I'm not familiar with the algorithm, do you know how it works ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|