|
Once the cursor is over another program, it can change the cursor, so the answer is probably no.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Considering that those "other applications" may want to change the cursor for various UI hints and reasons, why would your cursor overide their cursor?? In general it is not good usibility alter cursors outside of your application. If you want to change a cursor for all applications use a theme.
|
|
|
|
|
This is only a School project, and I like to know if this is possible in anyway. I am not trying to overwrite any other applications. However, I might take a wrong approach for this project.
If not possible, I may need to reconsider my project.
Thanks for the reply All.
Khanh.p
|
|
|
|
|
hello,
I have a basic question since Im at the basic level of programming anything. how can I make the program fill out certain text boxes in an IE window and then submit them with a button on the website? so if there is "Name" then it puts the name in there, and if there is an "ok" button then it automatically submits it with the button?
thanks for the help
|
|
|
|
|
Any one can help how to create a netmodule
in VS IDE?? I can not find similar option as in command line .
Thanks thanks thanks...
|
|
|
|
|
That all depends on what your definition of a "netmodule" is. What do you want this thing to do?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hey!
I am running Visual Studio 2005 professional.
I am now working on a webproject where i need to use sessions
I store sessions like this
<br />
Session.Timeout = 30;<br />
Session.Add("profileId", profileId);<br />
and im getting the sessions by this code:
<br />
try<br />
{<br />
if (Session["profileId"] != null)<br />
{<br />
mUserId = int.Parse(Session["profileId"].ToString());<br />
postMessage.Controls.Add(LoadControl("~/common/uc/loginBox.ascx"));<br />
}<br />
}<br />
catch (Exception ex) { throw (ex); }<br />
The problem is when we reach the if i get a error:
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpmodules> section in the application configuration.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpmodules> section in the application configuration.
Any ide what i need to do? i havent had this problem before?
Best Regards
Jimmy
|
|
|
|
|
by default enablesessionstate is true. Incase it is false,you can enable sessionstate at page level by setting enablesessionstate of page directive to true.
Thanks
|
|
|
|
|
You have probably disabled session state for the page. Check the properties for the page.
By the way, why are you taking the value from the session variable, converting it to a string, and then back to an integer? Isn't the value you put in the session variable an integer? Just check if the data type is correct and then cast it.
---
b { font-weight: normal; }
|
|
|
|
|
Hey
My page header looks like this
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="communityReplys.aspx.cs" Inherits="community_communityReplys" %>
But i am inherting from a base class that are in hearting from system.web.UI.page but i havent set enny settings regarding sessions?
|
|
|
|
|
I have notice that its my cs file that is my basePage class that are getting the exception? cant i get the session variable in the my basePage.cs that inherits from web.page?
All my webpages(aspx) is inherited from my basePage.cs and that have workt fine, but the sessions dont simes to work in the cs file?
|
|
|
|
|
Current issue is making me crazy at the moment, there must be something I missed, 'cause it's not working as expected...
I like to access a hash table key either by it's name or a class instance. To achieve this I create a new class (HashKey) which internally has a string called _name. When the hashtable calls HashKey.GetHashCode() it returns the HashCode of the internal wrapped string _name. Should be pretty much the same like I would use a literal string value key directly, right?
so it must the be same if I add my value by a string key
HashTable myHashTable = new HashTable();
myHashTable.Add("keyName", 4);
or I add my value by a string key wrapped in HashKey class.
HashKey myHashKey = new HashKey("keyName");
myHashTable.Add(myHashKey, 4);
Now I should/wanna be able to read the value by literal string or by the HashKey instance.
object value = myHashTable["keyName"];
value = myHashTable[myHashKey];
This doesn't work, but WHY?
Here is the implemenation of HashKey class, which wraps the string and overrides GetHashCode and Equals methods.
public class HashKey
{
private string _name;
public HashKey(string name)
{
_name = name;
}
public override string ToString()
{
return _name;
}
public override int GetHashCode()
{
return _name.GetHashCode();
}
public override bool Equals(object obj)
{
return _name.Equals (obj);
}
}
|
|
|
|
|
I copied your code and stepped through the debugger, and this is the solution, it works:
public override bool Equals(object obj)
{
if (obj is HashKey)
return _name.Equals(((HashKey)obj)._name);
else
return _name.Equals(obj);
}
You need to cast the object when necessary and access the _name attribute directly.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi Greeeg,
Thanks for your fast reply, just added your code.
Now it works to access the key with the HashKey instance
value = myHashTable[myHashKey];
but this scenario still doesn't work here
object value = myHashTable["keyName"];
Any other changes you made to the code, any ideas?
myMsg.BehindDaKeys = "Jerry Maguire";
|
|
|
|
|
Strange, both work for me
Hashtable myHashTable = new Hashtable();
HashKey myHashKey = new HashKey("keyName");
myHashTable.Add(myHashKey, 4);
value = myHashTable["keyName"];
value = null;
value = myHashTable[myHashKey];
after both calls "value" is 4. I inserted the "value = null" to see whether the second call will change "value" at all.
You might want to add another if-clause like else if(obj is String) return _name.Equals((String)obj) into the Equals method.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
It doesn't work for me. I think it can't work because in case of asking
value = myHashTable["keyName"];
string.Equals() is called which is can never returns true when asked about equality with HashKey instance, right?
myMsg.BehindDaKeys = "Jerry Maguire";
|
|
|
|
|
But you do an object comparison with the _name-string of your hashkey instance, so you compare two strings in case object is a string.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Yep, but I guess the problem is that in case of the string hashtable key not the Hashkey.Equals() method is called. Instead it calls the string "keyName".Equals(hashKeyInstance) which returns false.
So in case of asking the value with the string key, it works the other way round with calling Equals(). Is this correct?
Thank you very much for your efforts.
myMsg.BehindDaKeys = "Jerry Maguire";
|
|
|
|
|
I am trying to serialize and deserialize C# objects to an SVG file. I need to specify some custom types and have these serialized as attributes (e.g. fill = '#CCFF00'). However I cannot figure out how to serialize types other than the built-in types (string, int etc).
Right now my code looks like this (and it works):
<br />
private SVGColor m_Fill = new SVGColor(Color.White);<br />
[XmlAttribute("fill")]<br />
public string svg_fill {<br />
get {<br />
return m_Fill.ToString();<br />
}<br />
set {<br />
m_Fill = SVGColor.Parse(value);<br />
}<br />
}<br />
[XmlIgnore]<br />
public Color Fill {<br />
get {<br />
return m_Fill.Colour;<br />
}<br />
set {<br />
m_Fill.Colour = value;<br />
}<br />
}<br />
But it seems as though there should be a way to implement an interface for SVGColor that would allow the parser to automatically serialize & deserialize it based on its ToString & Parse methods. Then one could replace all this code with:
[XmlAttribute("fill")] public SVGColor Fill;
Is this possible??
|
|
|
|
|
I am new to programming in C# so please be patient. How do i read (in C#) the status of a port to trigger an event. For example.... when door opens, trigger switch high, (or low) through optio-coupler device via serial port to control stereo power on, or answering machine play, etc.
Throw me a line and we'll help each other.
|
|
|
|
|
You might want to have a look at this[^] series on Coding4Fun.
It'll save you having to write device drivers to get at the low-level details of a serial port, something that is abstracted from your code by Windows.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am trying to set sessions on the sql server in my web services. After running some scripts on sql server and setting the config files, how do I actually populate the sql server session tables? I would also like to save the data (from the user's search results) from several sessions in the session tables. Can somebody help me with this. Thanks.
Mina
|
|
|
|
|
i've selected some rows from the database and populate my DataSet.
After i've deleted some rows and update them.
Now i want to update the original Database with changed on the dataset.
i've used this code, but it is not good becouse it need an insert comand:
conn = new OleDbConnection(conn_string);
string selction_string = "Select * FROM myTable";
OleDbDataAdapter adapter = new OleDbDataAdapter(selction_string, conn);
conn.Open();
adapter.Update(mydataSet); <-----
conn.Close();
|
|
|
|
|
Yes, you need to provide the SQL to do the insert. What's wrong with that ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
so the dataAdapter doesn't understand automatically what is changed and make the correct update automatically?
If so, what is a possible SQL statement to do that (how have i to change the code)?
|
|
|
|