|
Matty,
Sorry for not replying sooner. Your explanation is the kind of explanation I was looking for, as it explains why it wouldn't fire and reason for needing to rewrite (and re-subscribe) it identical to the first version. The one thing is doesn't explain that I find the most confusing is that to have had it coded, subscribed to, and working, with no other changes, is why it suddenly became "unsubscribed" and stop working necessitating the steps that had to be taken. Is there something the user could have done or moreover some possible data constraint violated that would "Unsubscribe" the event? If so this is what needs to be identified so that something can be done so it doesn't happen again.
I had suspected the two different signatures may have been the same, but then DevEx should use ony one and not confuse the issue by randomly choosing one or the other that only makes one waste hours looking at them as a cause for the mysterious "unsubscription".
|
|
|
|
|
Reason it may have not been subscribed:
1. You were using the visual studio forms designer; moved the control, cut and paste, played with the properties or otherwise changed the control in the designer and forgot to subscribe your method to the relevant event in the UI designer and the emitted *.designer.cs was missing the subscription you wanted
2. You were subscribing by hand without knowing what you are doing and subscribed to the event in a bad place in the applications life cycle. Eg, after the event had been fired.
Solution to 1 and 2 as with all things is to know what you are doing.
The most important thing to do is obviously identify the the place in your code where you subscribe to the event.
If you can't locate where you subscribe to the event; then it's not surprising methods don't get called when you expect them to and you need to read more about how events work and .NET in general..
If you do know where you are subscribing and you've checked using the debugger that it gets called at an appropriate time in the applications life cycle then it's DevEx's problem as they're not triggering the event reliably, which is probably unlikely.
|
|
|
|
|
how to choose a best app to create in c#.net....
|
|
|
|
|
Darts.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Best at what? The best NoSQL database engine would not be the best 3D games engine, for instance.
|
|
|
|
|
Choose the one that will make you most money or get you most girls!
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Write the application you dream about.
"What Turing gave us for the first time (and without Turing you just couldn't do any of this) is he gave us a way of thinking about and taking seriously and thinking in a disciplined way about phenomena that have, as I like to say, trillions of moving parts.
Until the late 20th century, nobody knew how to take seriously a machine with a trillion moving parts. It's just mind-boggling." Daniel C. Dennett
|
|
|
|
|
This is the hardest thing to do.
|
|
|
|
|
What is the analogy formation in Artificial Intelligence?
|
|
|
|
|
What does this have to do with C#?
Veni, vidi, abiit domum
|
|
|
|
|
"Analogy formation" in artificial intelligence is an inverted gull-wing offensive position where the running-back plays center, and the tight-end does an end-run around metaphor, followed by a hail-Mary lateral pass to the last simile left standing.
"What Turing gave us for the first time (and without Turing you just couldn't do any of this) is he gave us a way of thinking about and taking seriously and thinking in a disciplined way about phenomena that have, as I like to say, trillions of moving parts.
Until the late 20th century, nobody knew how to take seriously a machine with a trillion moving parts. It's just mind-boggling." Daniel C. Dennett
|
|
|
|
|
I bet the OP got even less of that than I did.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
plz.. help me. how to host win form appl in web. i read some blogs,first convert win form application to wpf. then host that wpf in iis.
if it's the process how to convert .
|
|
|
|
|
There is no way but to do some recoding.
WPF can be hosted in IIS as an xbap application.
|
|
|
|
|
Help with what exactly? What have you tried, where are you stuck?
Member 10263519 wrote: first convert win form application to wpf. There's no converters for that, would need to be recoded.
Member 10263519 wrote: then host that wpf in iis. ..looking for an easy way to host a winform in a browser?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi friend
I am creating a com interface , It created , but when i am using it with different platform ,interface is not created within that application.
Please help me where i am wrong.
Code is as follow :
using System;
using System.Runtime.InteropServices;
using System.IO;
using System.Text;
using System.Data.SqlClient;
using System.Net;
namespace SMSApp
{
[Guid("694C1820-04B6-4988-928F-FD858B95C880")]
public interface SendSMSInterface
{
[DispId(1)]
void Init(string userid, string password);
[DispId(2)]
bool ExecuteSelectCommand(string selCommand);
[DispId(3)]
bool NextRow();
[DispId(4)]
void ExecuteNonSelectCommand(string insCommand);
[DispId(5)]
string GetColumnData(int pos);
[DispId(6)]
string sendMessage(string user, string password, string customer, string cardno, string MobileNo, string CreditPt, string DebitPt, string balancept);
[DispId(7)]
string sendSmsFirstTime(string user, string password, string customer, string cardno, string MobileNo, string balancept);
}
[Guid("47C976E0-C208-4740-AC42-41212D3C34F0"),
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface DBCOM_Events
{
}
[Guid("9E5E5FB2-219D-4ee7-AB27-E4DBED8E123E"),
ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(DBCOM_Events))]
public class SendSMS : SendSMSInterface
{
private SqlConnection myConnection = null;
SqlDataReader myReader = null;
public SendSMS()
{
}
public void Init(string userid, string password)
{
try
{
string myConnectString = "user id=" + userid + ";password=" + password +
";Database=NorthWind;Server=SKYWALKER;Connect Timeout=30";
myConnection = new SqlConnection(myConnectString);
myConnection.Open();
}
catch (Exception)
{
}
}
public bool ExecuteSelectCommand(string selCommand)
{
if (myReader != null)
myReader.Close();
SqlCommand myCommand = new SqlCommand(selCommand);
myCommand.Connection = myConnection;
myCommand.ExecuteNonQuery();
myReader = myCommand.ExecuteReader();
return true;
}
public bool NextRow()
{
if (!myReader.Read())
{
myReader.Close();
return false;
}
return true;
}
public string GetColumnData(int pos)
{
Object obj = myReader.GetValue(pos);
if (obj == null) return "";
return obj.ToString();
}
public void ExecuteNonSelectCommand(string insCommand)
{
SqlCommand myCommand = new SqlCommand(insCommand, myConnection);
int retRows = myCommand.ExecuteNonQuery();
}
public string sendMessage(string user, string password, string customer, string cardno, string MobileNo, string CreditPt, string DebitPt, string balancept)
{
UnicodeEncoding unicode = new UnicodeEncoding();
string strUrl = "http://api.mVaayoo.com/mvaayooapi/MessageCompose?user=";
string strUr2 = user + ':' + password;
string strUr3 = "&senderID=ETHOSW&receipientno=";
string strUr4 = MobileNo + "&msgtxt=";
string Strur5 = "Dear " + customer + " , thank u for using ur Club Echo card no. " + cardno + " . " + DebitPt + " Pts dr " + "%26 " + CreditPt + " pts cr to ur card. A/c Bal " + balancept + " pts.";
string finalurl = strUrl + strUr2 + strUr3 + strUr4 + Strur5;
WebRequest request = HttpWebRequest.Create(finalurl);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream s = (Stream)response.GetResponseStream();
StreamReader readStream = new StreamReader(s);
string dataString = readStream.ReadToEnd();
string responsemsg = finalurl;
response.Close();
s.Close();
readStream.Close();
return (responsemsg);
}
public string sendSmsFirstTime(string user, string password, string customer, string cardno, string MobileNo, string balancept)
{
UnicodeEncoding unicode = new UnicodeEncoding();
string strUrl = "http://api.mVaayoo.com/mvaayooapi/MessageCompose?user=";
string strUr2 = user + ':' + password;
string strUr3 = "&senderID=ETHOSW&receipientno=";
string strUr4 = MobileNo + "&msgtxt=";
string Strur5 = "Dear " + customer + " , thank u for shopping with us. Your card no. is " + cardno + " . A/c Bal is " + balancept + " points.";
string finalurl = strUrl + strUr2 + strUr3 + strUr4 + Strur5;
WebRequest request = HttpWebRequest.Create(finalurl);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream s = (Stream)response.GetResponseStream();
StreamReader readStream = new StreamReader(s);
string dataString = readStream.ReadToEnd();
string responsemsg = finalurl;
response.Close();
s.Close();
readStream.Close();
return (responsemsg);
}
|
|
|
|
|
Alright, does the code give you any Errors, Exceptions or warnings?
We can't read your mind, neither access your HDD - You need to be specific and tell us error details.
Rakesh_Ranjan_Godrej wrote: I am creating a com interface
No. There is no COM interface in your sample code, and neither are you using the System.IO.Ports namespace which you'd need to access a COM interface.
Edit: My bad - I thought you were talking about Serial COM Ports
modified 19-Nov-13 4:27am.
|
|
|
|
|
Rakesh_Ranjan_Godrej wrote: interface is not created within that application
What do you want to tell us with that? Is it created somewhere else?!
Tell us what errors you experience and the platforms on which you experience the errors - and also: on which platforms does it work as expected?
|
|
|
|
|
I want to create a dll and use it with CAL Coding using automation variable.
|
|
|
|
|
I don't see anywhere that you are marking these as exposed to com (i.e. ComVisible("true") ). Have you done that elsewhere?
|
|
|
|
|
|
Ah, I see. So, it's registering on the build machine but not when it's running on a different machine. I take it that this is the problem you are facing. When you deploy the code, you need to run the regasm command to actually register your COM interfaces - VS does this for you on your build machine, but you need to do this manually when you run it on another machine. Regasm and it's switches are covered here[^].
|
|
|
|
|
Hi, I have a method that use Microsoft.Office.Interop.Excel class to export a DataTable to a .xls file. Everything is ok untill I got a request that the excel need to have some text rows before displaying the data in DataTable, such like following:
TITLE OF THE EXCEL
Label1 Param1
Label2 Param2
COLUMNHEADER1 COLUMNHEADER2 COLUMNHEADER3
.... .... ......
.... .... ......
.... .... ......
I have tried with DataTable.Merge(...) method but it returned with the COLUMNHEADERS AT THE TOP OF THE EXCEL, like this:
COLUMNHEADER1 COLUMNHEADER2 COLUMNHEADER3
TITLE OF THE EXCEL
Label1 Param1
Label2 Param2
.................. .................. ........................
.................. .................. ........................
.................. .................. ........................
Any suggest is appreciated. Thanks in advance.
|
|
|
|
|
Show us the coe you use now. Otherwise we won't be able to find out how to solve that.
|
|
|
|
|
Hi all,
I have previously worked with Andy Beaulieu's Farseer Helper as a physcis engine for a small Silverlight game.
I am now proposing using a similar conept for a basic class in C# that I am involved in. To my surprise, I realised that Silverlight is not developed anymore, and so, the Farseer physics/Farseer helper combo might not make sense anymore.
Basically, I just need something that is really very easy to start with (it's learning C# that should be the focus; developing a game with objects junping around would be just to make things more fun). Physics Helper was great in that you could work in a WYSIWYG environment and then dig into the code to programmatically add more objects or so. So what I am looking for is something along those lines: easy to learn is better than powerful here.
Any thoughts? (I have looked through the C# forum here without result). I have also done seraches on the net but it's hard to judge what kind of game engine would be easy to use and not discontinued.
The game engine should also be free or perhaps shareware, so that the students can use it from home and the institution maybe pay a fee.
Thanks for any hints!
petter
|
|
|
|