Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Method does not have the same signature as delegate

Reply
Thread Tools

Method does not have the same signature as delegate

 
 
vishakha.ganjoo@gmail.com
Guest
Posts: n/a
 
      09-19-2005
' C Sharp function - Start
' private void id_ok_Click(object sender, EventArgs e)
'{
' try
' {
' _job = new
OsaScanJob((OsaSessionState)Session[OsaSessionState.MFPSession]);
' _job.Create();
' _job.Completed += new
Osa.BusinessObjects.Job.OsaJobCompleteEventHandler (job_Completed);

' _job.SetElements((Osa.Components.Metadata.Metadata Collection)Session["ScanSettingsMetadata"]);
' _job.Execute();
' }
' catch(Exception ex)
' {
' System.Diagnostics.Trace.Write("Error: " + ex.Message +
"innerException: " + ex.InnerException + "Stack trace: " +
ex.StackTrace);
' ShowTopLevelScreen();
' }
'}
' C Sharp function - End

Private Sub id_ok_Click(ByVal sender As Object, ByVal e As
EventArgs)
Try
_job = New
OsaScanJob(CType(Session(OsaSessionState.MFPSessio n), OsaSessionState))
_job.Create()
AddHandler _job.Completed, AddressOf Me.job_Completed
_job.SetElements(CType(Session("ScanSettingsMetada ta"),
Osa.Components.Metadata.MetadataCollection))
_job.Execute()
Catch ex As Exception
System.Diagnostics.Trace.Write("Error:" + ex.Message +
"innerException:" + ex.InnerException.ToString() + "Stack trace:" +
ex.StackTrace)
ShowTopLevelScreen()
End Try
End Sub

It is giving me an error stating
Method 'Private Sub job_Completed(sender As Object, e As
System.EventArgs)' does not have the same signature as delegate
'Delegate Sub OsaJobCompleteEventHandler(sender As Object, e As
Osa.BusinessObjects.Job.OsaJobCompleteEventArgs)'. ..

Please let me know how can I rectify this error.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBNVlA=?=
Guest
Posts: n/a
 
      09-19-2005
Here is the issue:
OsaJobCompleteEventArgs
EventArgs

You need to match by tweaking one side or the other. Either the event args
in the delegate needs to be less specific or the handler needs to be more
specific.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************


"(E-Mail Removed)" wrote:

> ' C Sharp function - Start
> ' private void id_ok_Click(object sender, EventArgs e)
> '{
> ' try
> ' {
> ' _job = new
> OsaScanJob((OsaSessionState)Session[OsaSessionState.MFPSession]);
> ' _job.Create();
> ' _job.Completed += new
> Osa.BusinessObjects.Job.OsaJobCompleteEventHandler (job_Completed);
>
> ' _job.SetElements((Osa.Components.Metadata.Metadata Collection)Session["ScanSettingsMetadata"]);
> ' _job.Execute();
> ' }
> ' catch(Exception ex)
> ' {
> ' System.Diagnostics.Trace.Write("Error: " + ex.Message +
> "innerException: " + ex.InnerException + "Stack trace: " +
> ex.StackTrace);
> ' ShowTopLevelScreen();
> ' }
> '}
> ' C Sharp function - End
>
> Private Sub id_ok_Click(ByVal sender As Object, ByVal e As
> EventArgs)
> Try
> _job = New
> OsaScanJob(CType(Session(OsaSessionState.MFPSessio n), OsaSessionState))
> _job.Create()
> AddHandler _job.Completed, AddressOf Me.job_Completed
> _job.SetElements(CType(Session("ScanSettingsMetada ta"),
> Osa.Components.Metadata.MetadataCollection))
> _job.Execute()
> Catch ex As Exception
> System.Diagnostics.Trace.Write("Error:" + ex.Message +
> "innerException:" + ex.InnerException.ToString() + "Stack trace:" +
> ex.StackTrace)
> ShowTopLevelScreen()
> End Try
> End Sub
>
> It is giving me an error stating
> Method 'Private Sub job_Completed(sender As Object, e As
> System.EventArgs)' does not have the same signature as delegate
> 'Delegate Sub OsaJobCompleteEventHandler(sender As Object, e As
> Osa.BusinessObjects.Job.OsaJobCompleteEventArgs)'. ..
>
> Please let me know how can I rectify this error.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Turning a signature-changing decorator into a signature-preservingone Gustavo Narea Python 14 02-16-2009 04:58 PM
How to get the full signature of a delegate? news.microsoft.com ASP .Net Building Controls 2 05-18-2007 11:02 AM
7-Zip 4.31 file does not have a valid digital signature Jack Computer Support 2 12-07-2005 10:58 PM
UTF-8 with signature & UTF-8 without signature JJBW ASP .Net 1 04-24-2004 10:21 AM
user control in a datagrid does not work with a delegate and event David Cho ASP .Net Datagrid Control 0 10-09-2003 11:18 PM



Advertisments