msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Method ... does not have the same signature as delegate ...

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax
Author Message
Brian J



Joined: 04 Oct 2007
Posts: 2

PostPosted: Sun Sep 16, 2007 6:31 pm    Post subject: Method ... does not have the same signature as delegate ... Reply with quote

Please can anyone help a delegate newbie.
I am upgrading some VB6 code ...

'UPGRADE_WARNING: Add a delegate for AddressOf MidiIN_Proc
midiError = midiInOpen(hMidiIN, mMPU401IN, AddressOf
MidiIN_Proc, 0, CALLBACK_FUNCTION)

and am getting the error ...

Method 'Public Sub MidiIN_Proc(hmIN As Integer, wMsg As Integer, dwInstance
As Integer, dwParam1 As Integer, dwParam2 As Integer)' does not have the
same signature as delegate 'Delegate Function MidiIN_Proc_Delegate(hmIN As
Integer, wMsg As Integer, dwInstance As Integer, dwParam1 As Integer,
dwParam2 As Integer) As Integer'.

definitions ...

Delegate Function MidiIN_Proc_Delegate( _
ByVal hmIN As Integer, ByVal wMsg As Integer, _
ByVal dwInstance As Integer, ByVal dwParam1 As Integer, _
ByVal dwParam2 As Integer) As Integer

Declare Function midiInOpen Lib "winmm.dll" ( _
ByRef lphMidiIn As Integer, ByVal uDeviceID As Integer, _
ByVal dwCallback As MidiIN_Proc_Delegate, ByVal dwInstance As
Integer, _
ByVal dwFlags As Integer) As Integer

Public Sub MidiIN_Proc(ByVal hmIN As Integer, ByVal wMsg As Integer, _
ByVal dwInstance As Integer, ByVal dwParam1 As Integer, _
ByVal dwParam2 As Integer)

I have read a lot of articles that seem to have confused the issue.
Can anyone point to where I am going wrong please?

Archived from group: microsoft>public>vb>syntax
Back to top
View user's profile Send private message
Bob Butler



Joined: 04 Oct 2007
Posts: 1081

PostPosted: Sun Sep 16, 2007 10:40 am    Post subject: Re: Method ... does not have the same signature as delegate Reply with quote

"Brian J" wrote in message @microsoft.com...
> Please can anyone help a delegate newbie.
> I am upgrading some VB6 code ...
>
> 'UPGRADE_WARNING: Add a delegate for AddressOf MidiIN_Proc
> midiError = midiInOpen(hMidiIN, mMPU401IN, AddressOf
> MidiIN_Proc, 0, CALLBACK_FUNCTION)

Calling a move from VB 6 to VB.Net an "upgrade" is a prime example of
doublespeak


--
You need to ask in a newsgroup with "dotnet" in the name. This group is for
VB 6.0 and earlier and does not include VB.Net or VB 200x.
Back to top
View user's profile Send private message
Brian J



Joined: 04 Oct 2007
Posts: 2

PostPosted: Sun Sep 16, 2007 8:10 pm    Post subject: Re: Method ... does not have the same signature as delegate Reply with quote

>
> Calling a move from VB 6 to VB.Net an "upgrade" is a prime example of
> doublespeak
>
Yes, just untangling the errors left by the 'upgrade' utility process.
I am beginning to think a rewrite might have been the easier option!
>
> You need to ask in a newsgroup with "dotnet" in the name. This group is
> for VB 6.0 and earlier and does not include VB.Net or VB 200x.
thanks for the pointer
Back to top
View user's profile Send private message
Michael Cole



Joined: 04 Oct 2007
Posts: 79

PostPosted: Mon Sep 17, 2007 4:12 pm    Post subject: Re: Method ... does not have the same signature as delegate Reply with quote

Brian J wrote:
>> Calling a move from VB 6 to VB.Net an "upgrade" is a prime example of
>> doublespeak
>>
> Yes, just untangling the errors left by the 'upgrade' utility process.
> I am beginning to think a rewrite might have been the easier option!

Probably not nessesary to add, but a rewrite may definately be needed even
with an "upgrade". VB6 and VB.NET work differently - garbage collection
being the most noticable example, and even if the code "upgrades" perfectly,
the app may no longer run the way it should. You will still need to go
through the entire app and check it all again.

--
Regards,

Michael Cole
Back to top
View user's profile Send private message
"Jan Hyde



Joined: 04 Oct 2007
Posts: 466

PostPosted: Mon Sep 17, 2007 1:42 pm    Post subject: Re: Method ... does not have the same signature as delegate Reply with quote

"Brian J" 's wild thoughts were released
on Sun, 16 Sep 2007 16:10:35 +0100 bearing the following
fruit:

>>
>> Calling a move from VB 6 to VB.Net an "upgrade" is a prime example of
>> doublespeak
>>
>Yes, just untangling the errors left by the 'upgrade' utility process.
>I am beginning to think a rewrite might have been the easier option!

That's the advice you'd have got from me Wink

J

>>
>> You need to ask in a newsgroup with "dotnet" in the name. This group is
>> for VB 6.0 and earlier and does not include VB.Net or VB 200x.
>thanks for the pointer

--
Jan Hyde

https://mvp.support.microsoft.com/profile/Jan.Hyde
Back to top
View user's profile Send private message
"Jan Hyde



Joined: 04 Oct 2007
Posts: 466

PostPosted: Mon Sep 17, 2007 1:43 pm    Post subject: Re: Method ... does not have the same signature as delegate Reply with quote

"Michael Cole" 's wild thoughts were
released on Mon, 17 Sep 2007 12:12:00 +1000 bearing the
following fruit:

>Brian J wrote:
>>> Calling a move from VB 6 to VB.Net an "upgrade" is a prime example of
>>> doublespeak
>>>
>> Yes, just untangling the errors left by the 'upgrade' utility process.
>> I am beginning to think a rewrite might have been the easier option!
>
>Probably not nessesary to add, but a rewrite may definately be needed even
>with an "upgrade". VB6 and VB.NET work differently - garbage collection
>being the most noticable example, and even if the code "upgrades" perfectly,
>the app may no longer run the way it should. You will still need to go
>through the entire app and check it all again.

Yea, and some functions exists in dotnet and so will upgrade
but they don't work the same way as they did in VB6.


--
Jan Hyde

https://mvp.support.microsoft.com/profile/Jan.Hyde

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
How should i implement a delegate in VB6? I need to implement delegates in VB6, having some experience in C# and read about AddressOf in VB6 but am not sure how to call the procedure at the address. The application should evaluate the state of certain variables and call a corresponding method, th

Error Signature Hi, I got problem when making EXE file from my VB Project. When I run the EXE file (e.g click one button in the menu) there's "send error report" message. This error report contains: Error signature AppName: demo.exe AppVer: 1.0.0.0 ModName: mftr32.

Evaluate Method Hi, I am using MS excel to write some code in VB. I have mutilple check boxes in form (i.e. checkbox1, checkbox2, etc...). I want to change there value from code so i loop it, and set the value using = Ture/False. However, in looping i bui

Evaulate Method Hi, I am using MS excel to write some code in VB. I have mutilple check boxes in form (i.e. checkbox1, checkbox2, etc...). I want to change there value from code so i loop it, and set the value using = Ture/False. However, in looping i bui

HTMLDocument.Write() method in VB6 How can I use the Write() method of the HTMLDocument in VB6? Could someone please respond with a brief sample code after testing it on their VB6? I tried the following and get the following error: Function or interface marked as restricted, or the functio
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group