|
|
The way you asked the question, "module" could mean anything. In this case, another .EXE was the last thing I would have guessed. I was thinking maybe something in a referenced .DLL, or trying to call a method in a class, or maybe something in another namespace, ...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
What are all the way to play an .avi file in my application other these:
Video object of Direct Show
mciSendString (c++ for c#)
using windows media player COM
|
|
|
|
|
Hello all,
I need to prevent user from closing the form if he modify any field and ask him if want save or not?
Please help
Thanks
hay
|
|
|
|
|
Hi.
Take a look on the FormClosing-Event. With e.Cancel in the EventArgs e you can prevent the user from clsoing the Form.
|
|
|
|
|
Hi...
I'm writing a Windows Service in C# that when started opens a socket (Listening Port) that reads ethernet frames, inspects the payload, and logs to a DB certain data within the payload. Obviously I want the frames to be processed at a speed that doesnt' cause any lost packets.
So, do I create a thread for each received frame, to keep the main thread from
being blocked? Do I use a thread pool manager? What's the best design for processing the frames in real-time or close to real-time as possible?
Any suggestions/code snippets would be greatly appreciated.
Thanks,
Tom
thomas.paluzzi@havensolutionsgroup.com
|
|
|
|
|
I am new to object oriented. With classes and objects, what is the equivalent for global varialbe. Suppose I have different forms...each forms has its own class.
If I want to decalre a variable that is common to all forms, so that I can change and retrieve the value of that variable in any form I want, how do I do that.
Thanks.
|
|
|
|
|
In C# declare the variable as a static member of one of the classes. It can be accessed by classname.variable name in the other classes.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
A much better way would be to pass the variable to each form as opposed to decalring it as global. For several "global" types declare a class and pass it to each form.
|
|
|
|
|
Hi,
I have a base Form and a base TextBox control. I have derived my Form and TextBox control from the base classes. In the base class of form, I am adding EventHandler for TextChanged Event of TextBox to do some generic operation like setting dirty flag. And again in the Derived View I am using TextChanged Event of TextBox Control to enable/disable the OK button. I am opening the form in Modal form. When I close the Form, it is not getting cleanup from memory. I checked it in .NET Profiler. In the profiler it is showing me that TextChanged EventHandler is still referring the Form. I want to cleanup all EventHandlers on Closed event of the Form. Pls let me know how I can cleanup all EventHandlers for all Controls in the Form. IT IS URGENT. Please let me know.
|
|
|
|
|
If you're showing the form by calling it's .ShowDialog() method, you MUST call .Dispose() on it when you're done with it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am also calling .Dispose() after ShowDialog(). Still it is not helping...
|
|
|
|
|
You have to manually unsubscribe.
private void Subscribe()
{
otherForm.TextChanged += new TextChangedDelegate(thisForm_TextChanged);
}
private void Unsubscribe()
{
otherForm.TextChanged -= new TextChangedDelegate(thisForm_TextChanged);
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Actually the problem is that I don't know what all the EventHandlers each Derived Form is using. So it's become very difficult to remove all EventHandlers from each Derived Form manually. I just want to know if there is any way to remove all EventHandlers for all controls in the Form so that I can loop through all controls in the Form and Remove it in Base Form class. Please Help.
|
|
|
|
|
Hello everybody here!!!.
i would like to know how can i add new command to the run process of the windows os for example .
press the following
--------------------
start ---> run --->and type ---->cmd or regedit
it will open the MsDos or Registry of the Windows OS respectively but i want to add new command like this of my own is it some string key or entry in the registry that manages this and by the way yahoo messenger do the same when you expose one friend's email from yahoo online member directory, you will see the online icon and you press that icon with this simple html script:
<code>
<a href="ymsgr:sendim?the_Friend_nickname">the online icon</a>
</code>
and it is it it opens for you private window for chatting with that friend.
I want to add command of my own like this any body has any solutions for this please refer to me with an idea or even an article on this.
As i guess ! it is all related to enter new key value data in the registry in specific part with the extension of your program , but where i don't know any body can help me in this please ..
Thanks for your help.
Mess With The Best And Die Like The Rest
-- modified at 16:00 Friday 14th October, 2005
|
|
|
|
|
It is the path property in the environment that decides where the system will look for programs to run. Back in the days when the system was DOS based, the path was set in the autoexec.bat file. Nowadays you can change it from the properties of "My Computer". When you enter the name of a program in the start...run dialog or at a command prompt, the system first looks for the program in the paths specified in the path property.
The thing that yahoo messenger does is something completely different. "ymsgr" is a protocol, just like "http" or "ftp". It works pretty much as a file type, and the protocols are visible in the file type list in the folder options in Explorer.
Now I hope that you have a bit more information so that you can determine what it is you want to do, really.
---
b { font-weight: normal; }
|
|
|
|
|
Ok maybe I am going dumb here, but I cannot for the life of me figure this problem out. In the MSDE database there is a column called Slides. In that Slide table there is a Version column. Which is defined as a string. It contains data like 1.0.0. Well i am trying to create a typedataset where I just dragged and dropped the Slide table from the server explorer.
That being said, when I go in for the Fill command, I keep getting the InvalidCastException. I tried changing the column types to double etc...but no go. Any suggestion.
Thanks
Sameer
|
|
|
|
|
1- use float casting .
or
2- change the column data type into float numbers and tell us what did you get still having that problem or not ?
Mess With The Best And Die Like The Rest
|
|
|
|
|
Actually I am an idiot...the problem was in my DAL. When I wrote this function called
RunSqlReturnDS( string cmd , table )
well lets just say I hardcoded the table array position..i.e m_dataHolder.Tables[0].Rows..you get the idea.
So, it was returning rows from the previous run of the function.
|
|
|
|
|
Hello,
I have a ListView which has a small ellipsis button that I place dynamically.
The problem is I am not able to reposition the button when I scroll the Listview horizontally.
Any suggesstion is valuable to me.
Thanks
Alomgir Miah
Live Life King Size
-- modified at 14:02 Friday 14th October, 2005
|
|
|
|
|
Hi
I am in the process of developing a web application (well, kind of parital migration as the database storprocedures are going to be reused and the old app which was in vb6/asp is being re-written in ASP.NET) and had some questions with the data layers. I am using custom business entities to repesent business objects and these entities also have the CRUD methods for data access. I modelled it based on the Time Tracker Starter kit at http://www.asp.net and also the samples from enterprise library june 2005 version. I read numerous articles abt this and got confused.
I am not sure if it is a good approach to have the CRUD methods in the custom business entity or have it in a separate data layer component.
I have posted a sample code for a business entity that is used in my add.
Any suggestions / comments to make it a better solution would really be appreciated.
Thanks
Please
<br />
public class User<br />
{<br />
private string _oneWorldID;<br />
private string _lastName;<br />
private string _firstName;<br />
private string _middleInitial;<br />
private string _respDivName;<br />
private string _accessLevel;<br />
private string _activeInd;<br />
private int _respDiv;<br />
<br />
public enum Select<br />
{<br />
Active="Y",<br />
InActive="N",<br />
All=""<br />
}<br />
public User(string sOneWorldID)<br />
{<br />
OneWorldID = sOneWorldID;<br />
FirstName = LastName = MiddleInitial = string.Empty;<br />
RespDivName = ActiveInd = string.Empty;<br />
RespDiv = 0;<br />
}<br />
<br />
public User()<br />
{<br />
User(string.Empty);<br />
}<br />
<br />
public string OneWorldID<br />
{<br />
get {return _oneWorldID;}<br />
set {_oneWorldID = value;}<br />
}<br />
public string FirstName<br />
{<br />
get {return _firstName;}<br />
set {_firstName = value;}<br />
}<br />
public string LastName<br />
{<br />
get {return _lastName;}<br />
set {_lastName = value;}<br />
}<br />
public string MiddleInitial<br />
{<br />
get {return _middleInitial;}<br />
set {_middleInitial = value;}<br />
}<br />
public string RespDivName<br />
{<br />
get {return _respDivName;}<br />
set {_respDivName = value;}<br />
}<br />
public int RespDiv<br />
{<br />
get {return _respDiv;}<br />
set {_respDiv = value;}<br />
}<br />
public string ActiveInd<br />
{<br />
get {return _activeInd;}<br />
set {_activeInd = value;}<br />
}<br />
public string AccessLevel<br />
{<br />
get {return _accessLevel;}<br />
set {_accessLevel = value;}<br />
}<br />
<br />
public bool GetUsersDetails()<br />
{<br />
bool bUserFound = false;<br />
Database sqldb = DatabaseFactory.CreateDatabase("GatewaySQL");<br />
DBCommandWrapper sqlCommandWrapper = sqldb.GetStoredProcCommandWrapper("sp_Select_User_List");<br />
<br />
Utils.BuildParameters( sqlCommandWrapper, <br />
Utils.ParameterCount.SingleParameter,<br />
new object[]{"@ONW",System.Data.DbType.AnsiStringFixedLength,4,ParameterDirection.Input,this.OneWorldID}<br />
);<br />
<br />
using (IDataReader dr = sqldb.ExecuteReader(sqlCommandWrapper))<br />
{<br />
while (dr.Read())<br />
{<br />
this.LastName = dr.GetValue(1).ToString();<br />
this.FirstName = dr.GetValue(2).ToString();<br />
this.MiddleInitial = dr.GetValue(3).ToString();<br />
this.RespDivName = dr.GetValue(4).ToString();<br />
this.ActiveInd = dr.GetValue(5).ToString();<br />
this.AccessLevel = dr.GetValue(6).ToString();<br />
bUserFound = true;<br />
}<br />
return bUserFound;<br />
} <br />
}<br />
<br />
<br />
public static UsersCollection GetUsers(int iRespDiv, User.Select select)<br />
{<br />
Database sqldb = DatabaseFactory.CreateDatabase("GatewaySQL");<br />
DBCommandWrapper sqlCommandWrapper = sqldb.GetStoredProcCommandWrapper("sp_Select_User_List");<br />
<br />
string sActiveInactiveInd = "";<br />
switch (select)<br />
{<br />
case User.Select.Active:<br />
ActiveInactiveInd = "Y";<br />
break;<br />
case User.Select.InActive:<br />
ActiveInactiveInd = "N";<br />
break;<br />
}<br />
<br />
Utils.BuildParameters( sqlCommandWrapper, <br />
Utils.ParameterCount.MultipleParameters, new object[]{"@iRespDiv",System.Data.DbType.Int32,4,ParameterDirection.iRespDiv},<br />
new object[]{"@ActiveInactiveInd",System.Data.DbType.AnsiStringFixedLength,1,ParameterDirection.Input,sActiveInactiveInd}<br />
);<br />
<br />
using (IDataReader dr = sqldb.ExecuteReader(sqlCommandWrapper))<br />
{<br />
UsersCollection users = new UsersCollection();<br />
while (dr.Read())<br />
{<br />
User usr = new User();<br />
usr.OneWorldID = dr.GetValue(0).ToString();<br />
usr.LastName = dr.GetValue(1).ToString();<br />
usr.FirstName = dr.GetValue(2).ToString();<br />
usr.MiddleInitial = dr.GetValue(3).ToString();<br />
usr.AccessLevel = dr.GetValue(4).ToString();<br />
usr.ActiveInd = dr.GetValue(5).ToString();<br />
}<br />
return users;<br />
} <br />
}<br />
<br />
public void InsertUser(string sUpdt_User_OneWorldID)<br />
{<br />
try <br />
{<br />
using (new EntServicesProvider())<br />
{<br />
Database sqldb = DatabaseFactory.CreateDatabase("GatewaySQL");<br />
DBCommandWrapper sqlCommandWrapper = sqldb.GetStoredProcCommandWrapper("sp_Insert_User");<br />
<br />
Utils.BuildParameters( sqlCommandWrapper, <br />
Utils.ParameterCount.MultipleParameters,<br />
new object[]{"@OWN",System.Data.DbType.StringFixedLength,9,ParameterDirection.Input,this.UserID}, <br />
new object[]{"@firstName",System.Data.DbType.StringFixedLength,40,ParameterDirection.Input,this.FirstName},<br />
new object[]{"@lastName",System.Data.DbType.StringFixedLength,40,ParameterDirection.Input,this.LastName},<br />
new object[]{"@middleInitial",System.Data.DbType.StringFixedLength,40,ParameterDirection.Input,this.MiddleInitial},<br />
new object[]{"@accessLevel",System.Data.DbType.StringFixedLength,1,ParameterDirection.Input,this.AccessLevel},<br />
new object[]{"@activeInd",System.Data.DbType.StringFixedLength,1,ParameterDirection.Input,this.ActiveInd},<br />
new object[]{"@respDiv",System.Data.DbType.Int16,2,ParameterDirection.InputOutput,this.RespDiv} <br />
);<br />
<br />
using (IDbConnection connection = sqldb.GetConnection())<br />
{<br />
connection.Open(); <br />
sqldb.ExecuteNonQuery(sqlCommandWrapper);<br />
}<br />
SQLTransactionLog.InsertTransaction( "Insert",<br />
sUpdt_UserID,<br />
"SQL",<br />
"sp_Insert_User",<br />
this.Id,<br />
this.RespDiv.ToString(),<br />
"Secondary column contains User's Division ID." );<br />
<br />
ContextUtil.SetComplete();<br />
}<br />
}<br />
catch (Exception e)<br />
{<br />
ContextUtil.SetAbort();<br />
throw new Exception (e.Message);<br />
}<br />
}<br />
<br />
}<br />
<br />
|
|
|
|
|
How to use function of VB.NET in C#
for example: when i want to use IsNumeric function of VB.NET in C#.
Thanks
I tried so hard and got so far
|
|
|
|
|
I think this would work, haven't had time to test it though
add a reference to the Microsoft.VisualBasic.dll
Microsoft.VisualBasic.Information.IsNumeric( Object )
HTH
Russ
|
|
|
|
|
Well the crazy way would be
bool isnumeric = false;
try
{
Convert.Int32(Object)
}
catch
{
isNumeric = true;
}
//use the isnumeric now
|
|
|
|
|
Not quite...
the isNumeric=true; has to follow the Convert.ToInt32() .
Or use Double.TryParse() to test without having to throw excaptions.
Regards,
mav
|
|
|
|
|