|
The funny thing that C# has a very prominent similarity to Java...
It is not a C# or VS problem. DevEx had declared the delegate in different way (one time with namespace and at the other without)...
(You can look inside there assembly and see this - just don't tell me)
It IS frustrating, but you can make it better - provide clear code!!!
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
RBKpro wrote: The only kind of explanation I have is VS sometimes has a problem with
recognizing method signatures as being valid and therefore will not execute
them???
Nope. Visual Studio doesn't execute your code. So, no. That's not the problem and, frankly, i've never heard of such a problem with Visual Studio or the .NET CLR.
Chances are REALLY good that it's a problem with DevEx. Either the DevEx isn't raising the event or the event handler wasn't wired up properly.
BTW, those two method headers are NOT the same. The first one leaves some room for ambiguity if the PrintEventArgs type is defined in multiple namespaces, which is not unheard of.
|
|
|
|
|
RBKpro wrote: I'd complain to DevEx, but I am sure they will insist it is a Visual Studio (2012 Ultimate) problem and Microsoft will say it is a DevEx problem, so I am posting my complaint here.
Have you ever contacted DevExpress? Used their forums? While I understand your frustration I would have thought a calm, well documented, correspondence would elicit the best response.
Any software provider will look at well presented issues and try to help - but having a rant isn't the best way to go about solving your issue.
MVVM # - I did it My Way
___________________________________________
Man, you're a god. - walterhevedeich 26/05/2011
.\\axxx
(That's an 'M')
|
|
|
|
|
_Maxxx_ wrote: but having a rant isn't the best way to go about solving your issue.
But it is dramatically more satisfying. And you go and bring logic and common sense to a rant tch tch.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
First thing.
Those signatures are totally identical. So I don't know what you're complaining about
public void foo(Color x);
is identical to public void foo(System.Drawing.Color x)
If you are importing the System.Drawing namespace that is. I think java has namespaces too.
Second thing.
When it wasn't firing, did you check that you are actually subscribing/wiring up xrInvAllegations_BeforePrint method to an event?
I strongly suspect what you probably did was accidentally not subscribe to the event. Then you probably used the visual studio IDE to create a 'new' event via using the forms designer. The forms designer probably subscribed to the event for you, and hence xrInvAllegations_BeforePrint now gets called correctly. Which fixed your problem (In a stupid round about way)
On the non firing version. I'd go check you actually have code somewhere that looks like someClass.SomeEvent += xrInvAllegations_BeforePrint;
If you don't, it's pretty obvious why it's not getting fired :P Functions and methods don't magically get called unless you tell something you want them to be called.
|
|
|
|
|
Matty22 wrote: When it wasn't firing
Matty22 wrote: why it's not getting fired
Employees get fired. Events get raised.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Microsoft uses all of fired, triggered and raised interchangeably
Example from the "Event" article on the MSDN
"An event often has no custom data; the fact that the event was fired provides all the information that event handlers require. In this case, the event can pass an EventArgs object to its handlers. The EventArgs class has only a single member, Empty, that is not inherited from System.Object. It can be used to instantiate a new EventArgs class."
"An event delegate is used to define the signature of the event. A particular event delegate typically corresponds to a particular event data class. By convention, events in the .NET Framework have the signature EventName(sender, e), where sender is an Object that provides a reference to the class or structure that fired the event"
I guess you better get MS on the phone and tell them all about the sand in your knickers
|
|
|
|
|
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?
|
|
|
|