|
|
Does anyone have any information, examples, or ideas about Global Common, Shared memory, File Mapping, etc...? I am trying to share a structure of information between 3 different applications. The shared area needs to be accessed every 100 milliseconds. Any kind of idea will be appreciated.
Thanks,
Tom
|
|
|
|
|
Maybe .Net Remoting will work for you.
43 68 65 65 72 73 2c
4d 69 63 68 61 65 6c
|
|
|
|
|
I have done very little with .Net Remoting. I am under the impression that .Net Remoting simply uses network sockets to pass objects between applications "behind the scenes". I am worried that this will not be fast enough for the updates that I need.
I may be wrong about the above.
Anymore ideas?
Tom
|
|
|
|
|
I am looking at using something more time dedicated other than socket routines. I was hoping to see if anyone has implemented something close to the kernel32.lib routines "CreateFileMapping and MapViewOfFile". I have used "CreateFileMapping and MapViewOfFile" with Visual Basic 6.0 and Visual C++ 6.0 and it worked as I expected it to. Does C# have anything like these routines? Can C# use the kernel32.lib?
|
|
|
|
|
Tom McDaniel wrote:
Can C# use the kernel32.lib?
Yes, via the DllImportAttribute C# can use most, if not all, extern functions from an umanaged dll. See further down the forums, in the last week we had quite alot of talk about it.
Also look at MSDN, NET Framework Developer's Guide, Interoperating with Unmanaged Code Section.
Hope this helps
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Thanks for the answer. This is what I have been looking for. Your help is greatly appreciated.
Tom
|
|
|
|
|
I have a main project and a Dll project in the same solution.
Randomly Visual studio tells me (in debug mode) this:
Unable to write to output file '.....mydll.dll': The process cannot access the file because it is being used by another process.
Unable to write to output file '.....mydll.pdb': Access is denied.
To fix this I have to quit Visual Studio and go to the project folder and remove those files. I can't remove them while Visual Studio is running because they are writeprotected.
It must be an other way to fix this, any ideas?
|
|
|
|
|
I get this frequently as well, and got it in MFC occassionally.
I shut down Visual Studio, but have never really had to remove the files manually.
|
|
|
|
|
I get this too, very annoying. It seems to happen when using multiple (3 or more) projects in one solution (guess it isnt a solution then, is it?). I find 9/10 times doing a rebuild will solve the problem. Very occasionally i had to go and delete files as well.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
When i load my project i got the following message: "Cannot widen from target type to primitive type." ( build error) about 12 times.
I can do every thing that i use to do but after a while Visualstudio removes some controls from one of my winForms and I have to redesign the whole winForm. What is happening? Please help!
|
|
|
|
|
Clearly it's whatever item you are putting on your form. Something in the source code in the ImplementControl area is incorrect.
And I got that message when converting floats to integers myself. Make sure you use the Convert class such as the Convert.ToInt32 function when doing type casting.
|
|
|
|
|
I am envisioning a component that you can drop on a form and specify what controls on the form are maditory, and which ones are not. Also to be able to specify what values for each control are valid. It should also place a small inidcator in the corner of each control to indicate that it is required. The control should also give feedback by altering the background colors of the controls it is watching if there is a data entry error or not.
As far as I understand I will need to learn how to write something called a control extender?
Anyone have any good examples / articles to recomend?
|
|
|
|
|
I wrote two control extenders and put them on the board.
One for Toolbars
http://www.codeproject.com/cs/miscctrl/extendedtoolbar.asp
One for Statusbars
http://www.codeproject.com/cs/miscctrl/extendedinterface.asp
I hope this is what you are seeking.
|
|
|
|
|
How can I open, query SAS Dataset using C#?
Jassim Rahma
|
|
|
|
|
SAS?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
|
Yes .. I'm using Base SAS which imports AS400 DB2 files to a SAS dataset and I need to access the dataset with an OLE DB.
|
|
|
|
|
Hello,
How can I insert the image of an object Graphics in an other ?
By example, I have two panels : I draw some lines on the first one. How can I copy it to the second panel ? (or only a part of it) ?
Thanks
Troz
|
|
|
|
|
This is a semi-large problem I have with the GDI+ Graphics object. You have no way of accessing the bitmap data that has been drawn on it. The reasoning for this is that the Graphics object may not have a bitmap to pull the data back from (such as when printing).
One work around that might work would be to get the DC (GetHdc), BitBlt the data, then release the DC (ReleaseHdc).
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
Thanks a lot
there is the solution, found on http://www.syncfusion.com/FAQ/WinForms/FAQ_c55c.asp
[System.Runtime.InteropServices.DllImportAttribute("gdi32.dll")]
private static extern bool BitBlt(
IntPtr hdcDest, // handle to destination DC
int nXDest, // x-coord of destination upper-left corner
int nYDest, // y-coord of destination upper-left corner
int nWidth, // width of destination rectangle
int nHeight, // height of destination rectangle
IntPtr hdcSrc, // handle to source DC
int nXSrc, // x-coordinate of source upper-left corner
int nYSrc, // y-coordinate of source upper-left corner
System.Int32 dwRop // raster operation code
);
private void button1_Click(object sender, System.EventArgs e)
{
Graphics g1 = panel1.CreateGraphics();
Graphics g2 = panel2.CreateGraphics();
//Drawing on panel1 (g1)
//...
//Copy it to panel2
Size s = panel1.Size;
Image memImage = new Bitmap(s.Width, s.Height, g1);
Graphics memGraphic = Graphics.FromImage(memImage);
IntPtr dc1 = g1.GetHdc();
IntPtr dc2 = memGraphic.GetHdc();
BitBlt(dc2, 0, 0, panel1.ClientRectangle.Width,
panel1.ClientRectangle.Height, dc1, 0, 0, 13369376);
g1.ReleaseHdc(dc1);
memGraphic.ReleaseHdc(dc2);
g2.DrawImage(memImage,0,0);
}
It works with any Graphics object (you can copy a form, a MSChart ...)
Troz
|
|
|
|
|
Oh my lordy!!! How could they not allow static members in interfaces!!! That's soooo irritating. Tick, theres another todo on the C# wish list...
|
|
|
|
|
Use an abstract class instead. An interface provides no implementation.
Logically it doesnt make sense to add a static member to an interface, because at runtime the interface provides u with methods that can be used on an instance of an interface and never the interface directly.
How about just adding it without making it static??? Seeing that it will be used with an instance of the interface.
Maybe even move the static member to the class that implements the interface, although i would have no clue how to access it then. Again the keyword is instance.
Hope this helps
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
What do you do leppie? You have amazing response times - not that I'm complaining. Anyways, I believe (not a language historian or anything) that is makes complete sense. For instance, lets say we have the following interface:
IChalk {
Color color { get; }
void Break();
string SerializeXml();
static IChalk Deserialize( string Xml ); //Cannot actually do the static thang.
}
class GreenChalk : IChalk {
Color IChalk.color { get { return Color.Red; } }
void Break() { throw( new Exception("Damn it!!!") ); }
string IChalk.SerializeXml() {
XmlSerializer sr = new XmlSerializer( this.GetType );
//blah blah
}
static IChalk IChalk.Deserialize( string xml ){
GreenChalk gc = new GreenChalk();
//blah blah
return gc;
}
}
I hate using specific examples for explainations but it'll save on length and confusion.
Now you could just make it deserialize to the instance and remove the need for the static member, but I believe it is more consistant this way; once you instanciate the implementing class you HAVE an IChalk, Deserialize in escence creates another one. So to Deserialize I have to create two versions.
You do point out a good idea that could mirror that though. I could use an abstract class with the Serialization methods in them and do that I guess, but it is definitly a hack in my mind. Unless someone else (or you) can explain why it isn't.
|
|
|
|
|
static functions are generally a bad idea, it presumes how your class will be used.
you are better off using a seperate help classer - see design patterns, GOF - "prefer composition to inheritance" (or something like that).
Personally I think Serialization sucks - have a look a the memento pattern...
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|