|
I think you can really argue whether this is a bug or not.
One application I would have found the possiblity to reference a .NET exe quite convenient was when I tried to make a working application controllable via remoting.
I wanted a quick way to tell my "remote control application" which members my application has, so this was the direct way.
Meanwhile I've dropped the whole idea, but nevertheless I think this to be a perfectly valid example for wanting to reference an exe from a different project.
Any other, better ideas are welcome, though.
Regards,
mav
|
|
|
|
|
You can't set a reference to an .EXE, only .DLL's and other libraries. An .EXE is NOT a library. Well, unless it's an old ActiveX server anyway...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It's perfectly possible using the command line compiler, only Visual Studio doesn't allow it. Workaround: rename the file to .dll, add it as reference, rename it back, modify the project file in Notepad.
|
|
|
|
|
|
I was wondering how to find the source code line / filename (__LINE__/__FILE__ equivalent) when using the Compact Framework, since the System.Diagnostics.StackTrace class is not supported? Goal is to support logging of location of errors in release as well as debug. Has anyone found a technique using Trace, perhaps?
|
|
|
|
|
|
I see the .NET Framework have GraphicsPath class to do this but in .NET Compact Framework don't have it. How can i hit the lines? Thanks
Nothing
-- modified at 20:07 Thursday 2nd February, 2006
|
|
|
|
|
hello, this is my first 2 weeks in programming language, iam taking visual C++ and Visual C# and i need a help in C#
if i have a company and inside it i have 3 departments, each department has a symbol, like : A-Adminstration.etc..
i wanna define a char variable like this :
char depar = ( and here i wanna write that 'A' means Adminstrations and 'I' means Information), so when the user enters a symbol, appeares the full name of the department.
so how can i define in ?
-- modified at 11:06 Wednesday 1st February, 2006
|
|
|
|
|
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.2
|
|
|
|
|
First, make an enumeration as follows:
enum Positions
{
Administration = 0;
Management = 1;
Junior = 2;
}
You can then use this to store the current value ie
Positions myPositions = Positions.Administration;
when the function is called you want to check the input (A, M, or J) and then statically handle it, so
if (a) myPositions = Positions.Adminstration
etc
Hope this helps
James
|
|
|
|
|
thanx james, i learned how to do it using switch structure.
|
|
|
|
|
Write a simple FTP (File Transfer Protocol) server and client using the TCP socket libraries on
Unix. This simple FTP application only implements the command “GET” to retrieve a file and
the command “LIST” to request a list of all the files the server offers. The example client and
server codes studied in class show how to use command line parameters and the use of the
socket libraries for a simple stateful server that returns a message to the client that tells the
number of times it has been accessed. The specifications for your client and server are as
follows:
===========================================
Client specification:
Your client should accept as parameters from the command line the name of the host on which
the server runs and the corresponding port number. Both arguments are optional. If no host
name is specified, the client uses "localhost"; if no protocol port is specified, the client uses a
default one given by PROTOPORT.
The client should do the following:
· Prompt the user to enter one of the following two commands:
o GET filename to retrieve the given file
o LIST to get a list of all files the server offers
· Connect to the server and request service by sending the user’s request.
· The client should then simply display the information sent back by the server on the screen.
· The requested file should be written into a file of the same name. If the file already exists, prompt the user to enter a new name.
· Close connection with server when done.
-----------------------------------------------------------------------------------
Server specification:
The server takes a single commandline argument that specifies the port number the server is
using, i.e. server 5555 . If no protocol port is specified, the client uses a default one given by
PROTOPORT. Have the server export a set of files from the computer on which it runs (i.e.
make them availabla for download). The server should:
· Read the request message from the client.
· Process the request (either GET or LIST):
o If the request is GET filename, then retrieve the file and send it to the
client.
o If the request is LIST, then get the list of all files available for download.
· On errors, send an error message back to the client such as:
o Not a command or command not implemented
o File does not exist
o Incorrect command format
Satyaranjan Sahu
|
|
|
|
|
And your question is?
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
the codes are not compiling properly.
If u agree i ll send the codes,ve a look in to it.
http://www.netbook.cs.purdue.edu/code/code30_1.htm (for client code)
-- modified at 11:18 Wednesday 1st February, 2006
|
|
|
|
|
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.2
|
|
|
|
|
|
|
I don't understand the problem. You have to build a control. You put in a numUpDown and a label for the number if you don't want to have a textbox. Then catch the KeyEvents. If a number is typed change the value. You might have to catch the Events from the Form and then change your controlvalue.
Or did I missunderstood your question?
Greetings,
Ingo
|
|
|
|
|
Hello,
I have a method that executes the given SqlCommand and returns the command result as a DataSet, while the method works under heavy load SQL Server (2000 Enterprise SP3) memory usage goes through the roof.
After some investigation I found that connections were being left active in the database. "Proof" of this was found after running a load test, a few minutes after the test completes (and while there is not activity on the SQL server) SQL Profiler shows various "Audit Logout" entries
EventClass : Audit Logout
TextData :
ApplicationName : LoadTestRun1
NTUserName : NETWORK SERVICE
LoginName : sa
CPU : 0
Reads : 10
Writes : 0
Duration : 459920
ClientProcessID : 0
Spid : 2969
StartTime : 2006-02-01 15:16:12.987
After hunting around various sites and tutorials this is the SqlCommand execution method:
public static DataSet ExecuteSqlCommand(SqlCommand command, string dataSetName)
{
if (command == null)
{
throw new ArgumentNullException("command");
}
if (dataSetName == null)
{
throw new ArgumentNullException("dataSetName");
}
DataSet returnDataSet = new DataSet();
returnDataSet.DataSetName = dataSetName;
returnDataSet.Locale = CultureInfo.InvariantCulture;
try
{
SqlDataAdapter sda = new SqlDataAdapter(command);
sda.Fill(returnDataSet);
sda.Dispose();
sda = null;
return returnDataSet;
}
catch
{
throw;
}
finally
{
if (command.Connection.State != ConnectionState.Closed)
{
command.Connection.Close();
}
command.Connection.Dispose();
command.Connection = null;
command.Dispose();
command = null;
}
}
Can anybody tell me if there is anything obviously wrong with my implementation or if there is something else I should check for.
|
|
|
|
|
//Perhaps this might work. Although I saw nothin in your post that would leave
//an open connection Remember the connection pool will remain for reuse but
// that's a good thing
try
{
SqlDataAdapter sda = new SqlDataAdapter(command);
command.Connection.Open;
sda.Fill(returnDataSet);
command.Connection.Dispose();
command.Dispose();
sda.Dispose();
return returnDataSet;
}
catch
{
throw;
}
finally
{
}
"People who never make mistakes, never do anything."
My Blog
|
|
|
|
|
It is generally good practice to put anything that is being disposed in the finally block so that it is still run if an exception is thrown.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
yes you are correct ... silly me.
"People who never make mistakes, never do anything."
My Blog
|
|
|
|
|
I'm trying to string several arrays together. Here is my code.
<br />
public void OnCreateMessage(string TermID, string AddressLine, string MessageText)<br />
{<br />
private byte[] HeaderBegin = new byte[]{0xFF, 0x00, 0xAA, 0x55, 0x00, 0x1E, 0x48, 0x02, 0x00, 0x01, <br />
0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, <br />
0x08, 0xD2, 0x00, 0x00, 0x00, 0x00};<br />
private byte[] HeaderEnd = new byte[]{0x55, 0xAA, 0x00, 0xFF};<br />
<br />
Encoding enc = Encoding.ASCII;<br />
uint nTermID = (uint)Encoding.ASCII.GetByteCount(TermID);<br />
uint nAddressLine = (uint)Encoding.ASCII.GetByteCount(AddressLine);<br />
uint nMessageText = (uint)Encoding.ASCII.GetByteCount(MessageText);<br />
string sMyMsg = TermID+ASCII.CR+ASCII.LF+AddressLine+ASCII.CR+ASCII.LF+MessageText;<br />
byte[] myBytes = enc.GetBytes(sMyMsg);<br />
byte[] MyMsg = new byte[30+nTermID+nAddressLine+nMessageText+4];<br />
<br />
MyMsg = HeaderBegin;<br />
myBytes.CopyTo(MyMsg, 26);<br />
HeaderEnd.CopyTo(MyMsg, MyMsg.Length);<br />
However when I step thru my code there is nothing in the MyMsg. Am I doing something wrong?
Thanks for any suggestions.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
RTFM
The second parameter of the CopyTo method is the destination position, not the length.
---
b { font-weight: normal; }
|
|
|
|
|
ah..okay...That's what I'm doing,
first I move in headerbegins. 26 bytes in length.
then I move in myBytes which is a byte array of ASCII text, into MyMsg at postion 26.
Then I copy in HeaderEnd into MyMsg at the current length of MyMsg.
Is this wrong?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|