|
monrobot13 wrote:
I just tried to add the override keyword and get this compiler error: A member marked as override cannot be marked as new or virtual
Isn't this sort of a catch 22 type thing?
No. If you mark something as override then it's automatically virtual, if you mark it as new then it's completely hiding the base class implementation so you can decide to make it non-virtual.
Paul
We all will feed the worms and trees So don't be shy - Queens of the Stone Age, Mosquito Song
|
|
|
|
|
Thanks for the replies guys. The problem was that I was keeping the virutal keyword in as well as override , didn't know you had to remove it. Thanks again.
- monrobot13
|
|
|
|
|
the virutal keyword will be picked up be anti virus scanners and your code wont compile
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
I have a project I am working on where I need to be able to programmatically search a remote SharePoint Portal Server for specific information. I would like to accomplish this using .NET, rather than going through Web Part developement (which at this point is a little over my head).
Has anyone run across a .NET wrapper library for SharePoint or some code that will allow me to interact with SharePoint? I found (I think here on CP) a set of classes that someone developed to interact with the Exchange WSS, but it seems to work only with that and not with SPS (which is based on the Exchange WSS).
Many thanks
RabidK
|
|
|
|
|
SharePoint version 2 (which comes with Office 2003 beta 2), is written with ASP.NET. I'd think that would be what you're looking for.
any idiot
can write haiku you just stop
at seventeenth syl
-ThinkGeek Fortunes
|
|
|
|
|
Hello EveryBody,
I want to develop a computational grid using C# & .NET.I came across components such as Xceed grid,dbnetgrid etc.,for developing data grids.But i want to develop a computational grid.Is there any s/w or library available ?I want to do a project in it.So please help me in this regard.
Thank you all for your response,
With regards,
Shankara Raman S
|
|
|
|
|
Using various articles found here on CP I am putting together a small systray application to take a screen capture, resize it, and then upload to an FTP server.
I have everything working so far with the exception of the ftp upload, this is because this article :
http://www.codeproject.com/csharp/.net_ftp_upload.asp?target=ftp%7Cupload
Has a dead link, when you try an download the project files.
Does anybody know of any other articles of a similar ilk?
|
|
|
|
|
Hi!
(I hope this is the correct forum for this question)
I have a bunch of .net modules, written in different languages (managed c++ and c#). Now I'd like to link them all together into one .dll. I tried using al.exe, but this tool only generates an assembly manifest, that refers to the external modules rather than embeds them into the dll.
Then I tried this: I disassembled all modules with ildasm and then tried to re-assembly the .il files with ilasm into one final .dll. Hower this does not work, as my modules contain native functions.
What can I do?
Thanks in advance
- Andre
|
|
|
|
|
|
Thank you for the link, but this exactly what I wanted to *avoid*: having the assembly split over several modules. Instead I wanted several modules to be physically embedded into one final .dll.
Let me explain my motivation:
I have a dll written in c++ with managed extensions. I use MC++ as I do a fair amount of IJW and COM-Interop. However, I need a collection derived from CollectionBase that reimplements object* get_Item(int) with a covariant return type (SomeType * get_Item(int)). As this does not seem possible in MC++ but well in C# (I posted my problem before: http://www.codeproject.com/script/comments/forums.asp?forumid=3785#xx455157xx), I decided to write the collections in C#.
So I would have a "main" dll e.g.
GentleStorm.Nasty.Graphics.dll
and a module with the collections
GentleStorm.Nasty.Graphics.netmodule
It would be nice if I could embed the latter into the first, so that I only have to distribute the .dll
- Andre
|
|
|
|
|
there was a upload on gotdotnet, but i cant seem to find it any more. it was called IL Linker, that does exactly what you want. i can email it
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
Nice tool, leppie. However I need to link a mc++ module with native code as well which is something that cannot be done using ildasm/ilasm.
- Andre
|
|
|
|
|
Thats nice to kow, o well there goes my plans for a native/managed C++ assembly...
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
Assume I want a client to use two different objects created in two different servers, what am i supposed to do? I want to know how i need to write my servers & client configuration files.
novice
|
|
|
|
|
Hi everyone!
I want to write an application which has a server and some clients. I would like them to communicate with tcp/ip.
I would like to send and recieve all kinds of data.
I have read about TCPListener, TCPClient, channels, sockets sync and async methods.
What are the diffrences between those methods ? Which is the better way ?
Thanks.
|
|
|
|
|
If your wanting to talk RAW TCP/IP - then use the Listner and either the client or socket class.
Example:
TcpListener tcplpop = new TcpListener(110);
tcplpop.Start();
Socket s = tcplpop.AcceptSocket() // Blocks until someone calls
s.Send(...)
s.Receive(...)
|
|
|
|
|
What is the difference between version no.1:
TcpListener tcplpop = new TcpListener(110);
tcplpop.Start();
Socket s = tcplpop.AcceptSocket() // Blocks until someone calls
s.Send(...)
s.Receive(...)
and version no.2:
IPEndPoint dbg_EndPoint = new IPEndPoint(ipAddress, dbg_port);
Socket dbg_listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp );
dbg_listener.Bind(dbg_EndPoint);
dbg_listener.Listen(num_of_devices);
dbg_listener.BeginAccept( new AsyncCallback(AcceptCallback), dbg_listener );
// Get the socket that handles the client request.
Socket listener = (Socket) ar.AsyncState;
Socket handler = listener.EndAccept(ar);
// Create the state object.
StateObject state = new StateObject();
state.workSocket = handler;
handler.BeginReceive( state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReadCallback), state);
Thanks.
|
|
|
|
|
Hi
I want to do in C# what you can do in COM with custom catagories. In ATL I can implement a custom catagory in a class by adding the following macro:
BEGIN_CATEGORY_MAP(CEffect)
IMPLEMENTED_CATEGORY(CATID_EFFECTS)
END_CATEGORY_MAP()
and I can seach for class's that implement that catagory by using:
ICatInformation::EnumClassesOfCategories()
which returns a list of CLSID's of classes that implement the specified catagory.
Is there any way to do this in C#?
|
|
|
|
|
Choppa wrote:
Is there any way to do this in C#?
No. There is only one category in .NET, and it's hard coded.
Category GUID : {62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}
Category Description : .NET Category
[edit]This info is from the CLR System.Runtime.InteropServices.RegistrationServices implementation.[/edit]
|
|
|
|
|
Hello,
How to dynamically validate a xml document against a dtd when no dtd reference is actually in the xml document.
Thanks,
Chito
|
|
|
|
|
Please help,
Here is my scenario:
Mainform has a private ChatSocket object that uses a socket, and this ChatSocket object has its own thread to Receive() bytes in a while(true) loop. Whenever the socket receives data, its calls an event I made in ChatSocket called MessageReceived. The MessageReceivedEventArgs contain the string of who the message was from and the message itself. The Mainform is listening for this event and calls the
OnMessageReceived( object sender, MessageReceivedEventArgs e );
This method checks a hashtable ( which is a private member in the Mainform ) to see if a ChatForm is already on the screen for the user the message came from. If it is not already on the screen ( in the hashtable ) it makes a new ChatForm. This ChatForm is made and i call Show() on it.
It shows, but it is pure white and it says it is not responding.
I tried async events as well, calling BeginInvoke() but that does not work either.
The thread of the MainForm is named MainThread, and the thread for the socket recving is called RecvThread, however when I am in the event handler within the MainForm, the thread running has an empty string for a name. I read that only the thread that creates the form should use it. If i create the ChatForm with a OnClick event with one fo the buttons on the MainForm it works fine. I also noticed that when you click on the button the new chatform is not fully displayed untill the OnClick method has completly returned. In my case the thread that invokes the event (ChatSocket) goes back to Receive() and therfore never returns. That is why I thought the async events would work but it still does not.
|
|
|
|
|
I have fixed the problem, but im not sure if there is a better way of doing it.
I ended up making a class that displays the ChatBox form I created as ShowDialog(), this seems to noew display the form, as Show() did not work. However, ShowDialog() blocks the thread untill that form is closed. So I have to craete the ChatBox form then pass it to an object that starts a new thread just for it. I dont really like this way because if i have 20 clients im chatting with thats 20 extra threads.
If anyone knows a better way please repsond. Sorry if my first post is a lot to take in, i didnt know how to explain my problem without giving all the background and details.
original problem, trying to be more clear:
a thread invokes an event, and a form (on the main thread) that is listening for the event creates a new form in the event hanlder, but the new form pops up and is "Not Responding".
I see that the new form is actually created in the thread that invokes the event, not the thread that has the form (that has the event handler), I dont really like that, i thought events you fire off and then the form thread would work on the event handler, i think this is why i had a problem (creating a form in a different thread and calling show() if i called showDialog() it works but the other thread blocks). I even tried async events, but even though its not the thread that invoked the event now creating the new form( working on the event handler), but its an anonymous new thread working on the event handler. I dont know how to make it more clear, this does sound confusing reading it back to myself sorry again.
The class to fix the problem, but creates a thread for each new form now:
private class EEChatBoxThread
{
internal EEChatBoxThread( FormEEChatBox chatBox )
{
_chatBox = chatBox;
Thread thread = new Thread( new ThreadStart( ShowChatBox ) );
thread.Name = chatBox.Client;
thread.IsBackground = true;
thread.Priority = ThreadPriority.BelowNormal;
thread.Start();
}
private void ShowChatBox()
{
_chatBox.ShowDialog();
}
private FormEEChatBox _chatBox;
}
Part of MainForm:
public void OnMessageReceived( Object sender, MessageReceivedEventArgs e )
{
FormEEChatBox chatBox = GetChatBox( e.From );
chatBox.MessageRecv( e.From, e.Message, e.Secure );
}
private FormEEChatBox GetChatBox( string with )
{
FormEEChatBox chatBox = ( FormEEChatBox )_chatBoxes[ with ];
// if the chatBox is not already on the screen, make one and display
if( chatBox == null )
{
chatBox = CreateChatBox( new string[] { with } );
}
return chatBox;
}
private FormEEChatBox CreateChatBox( string[] with )
{
FormEEChatBox chatBox = new FormEEChatBox( with, this );
chatBox.Closing += new CancelEventHandler( OnChatBoxClosing );
Monitor.Enter( _chatBoxes );
_chatBoxes.Add( with[ 0 ], chatBox );
Monitor.Exit( _chatBoxes );
// this class is above, just calls ShowDialog() on the chatBox form.
EEChatBoxThread boxThread = new EEChatBoxThread( chatBox );
return chatBox;
}
|
|
|
|
|
I think a better way might to be to use the InvokeRequired() and Invoke() methods in the OnMessageReceived method to marshal the event to the GUI thread. You should then be able to create and display the new form with no problems. See the article http://www.codeproject.com/cs/miscctrl/TSWizard.asp[^] for some examples of this.
Chris Jobson
|
|
|
|
|
Thanks you sooo much Chris Jobson, I looked at this sample you recomended the day you sent it, and see it was only the object "Step4" in that solution that i would be concerned with. This worked perfectly and i just summed up a quick way to handle what i was trying to do and how this helped me for others to see.
Again, thanks alot.
code below of what i basically was trying to do:
private void button1_Click(object sender, System.EventArgs e)
{
System.Threading.Thread formThread =
new System.Threading.Thread(
new System.Threading.ThreadStart( ShowNewFormThread ) );
formThread.IsBackground = true;
formThread.Priority = System.Threading.ThreadPriority.BelowNormal;
formThread.Start();
}
private delegate void ShowNewFormThreadDelegate();
private void ShowNewFormThread()
{
if( InvokeRequired )
{
ShowNewFormThreadDelegate del =
new ShowNewFormThreadDelegate( ShowNewFormThread );
Invoke( del, new Object [] { } );
return ;
}
++i;
Form form = new Form();
form.Text = i.ToString();
form.Width = 50;
form.Height = 50;
form.Owner = this;
_forms.Add( form.Text, form );
form.Show();
}
private void OnFormClosed( object sender, EventArgs e )
{
_forms.Remove( ( ( Form )sender ).Text );
}
int i = 0;
private Hashtable _forms = new Hashtable();
|
|
|
|
|
Dear experts,
Does anyone know how to get access to the text box control that is displayed underneath icons on the Windows desktop. I want to re-use this text box in my own application as it has the "growth" behaviour that I urgently need. I need a text box that will grow in height as more text is added to it.
PLEASE HELP ME! Thanks in advance for your assistance.
Benjamin
|
|
|
|