[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

BeeJ

11/12/2011 8:55:00 PM

Same app, same name, one old, one new version.
Old one has mostly the same code.
The new one has fixes and improvements.

The old on has a UC with subclassing for the mouse.
The new one has the same code. (firstly compared, then deleted and
copied code from old one); still fails.

The old one runs through the subclassing fine and the subclassing
works.
The new one always fails (did not fail a few days ago).
Fails when trying to find its app in the table.

This is standrd Paul Caton Subclasser code.
' Get the address of the specified ordinal method
nAddr = zAddressOf(oCallback, nOrdinal) 'FAILS HERE
If nAddr = 0 Then ' Ensure that we've found the ordinal method
zError SUB_NAME, "Callback method not found"
Exit Function
End If

So what else is subclassing dependent on?
I can run both at the same time and get different prog IDs as expected.
If it let the new one past the errors, the program runs fine except
that the subclassing stuff, mouse wheel etc are not functional.

I see no differences in Project References or other places as I step
through from startup in the IDE.
The compiled version produces the same error.

The PC has been restarted from full OFF several times.

Is something in the main part of the app or some app property that is
causing the problem?


6 Answers

Mayayana

11/12/2011 10:17:00 PM

0

There's not really enough info. to tell, but one
thing comes to mind: Assuming you're calling
Subclass in both cases with nOrdinal set to 1,
the callback function needs to be the last method
in the calling module. If you added a new function
at the end it will fail.

--
--
"BeeJ" <nospam@spamnot.com> wrote in message
news:j9mmec$spt$1@speranza.aioe.org...
| Same app, same name, one old, one new version.
| Old one has mostly the same code.
| The new one has fixes and improvements.
|
| The old on has a UC with subclassing for the mouse.
| The new one has the same code. (firstly compared, then deleted and
| copied code from old one); still fails.
|
| The old one runs through the subclassing fine and the subclassing
| works.
| The new one always fails (did not fail a few days ago).
| Fails when trying to find its app in the table.
|
| This is standrd Paul Caton Subclasser code.
| ' Get the address of the specified ordinal method
| nAddr = zAddressOf(oCallback, nOrdinal) 'FAILS HERE
| If nAddr = 0 Then ' Ensure that we've found the ordinal method
| zError SUB_NAME, "Callback method not found"
| Exit Function
| End If
|
| So what else is subclassing dependent on?
| I can run both at the same time and get different prog IDs as expected.
| If it let the new one past the errors, the program runs fine except
| that the subclassing stuff, mouse wheel etc are not functional.
|
| I see no differences in Project References or other places as I step
| through from startup in the IDE.
| The compiled version produces the same error.
|
| The PC has been restarted from full OFF several times.
|
| Is something in the main part of the app or some app property that is
| causing the problem?
|
|


BeeJ

11/12/2011 11:50:00 PM

0

Mayayana has brought this to us :
> There's not really enough info. to tell, but one
> thing comes to mind: Assuming you're calling
> Subclass in both cases with nOrdinal set to 1,
> the callback function needs to be the last method
> in the calling module. If you added a new function
> at the end it will fail.
>
> --
> --
> "BeeJ" <nospam@spamnot.com> wrote in message
> news:j9mmec$spt$1@speranza.aioe.org...
>> Same app, same name, one old, one new version.
>> Old one has mostly the same code.
>> The new one has fixes and improvements.
>>
>> The old on has a UC with subclassing for the mouse.
>> The new one has the same code. (firstly compared, then deleted and
>> copied code from old one); still fails.
>>
>> The old one runs through the subclassing fine and the subclassing
>> works.
>> The new one always fails (did not fail a few days ago).
>> Fails when trying to find its app in the table.
>>
>> This is standrd Paul Caton Subclasser code.
>> ' Get the address of the specified ordinal method
>> nAddr = zAddressOf(oCallback, nOrdinal) 'FAILS HERE
>> If nAddr = 0 Then ' Ensure that we've found the ordinal method
>> zError SUB_NAME, "Callback method not found"
>> Exit Function
>> End If
>>
>> So what else is subclassing dependent on?
>> I can run both at the same time and get different prog IDs as expected.
>> If it let the new one past the errors, the program runs fine except
>> that the subclassing stuff, mouse wheel etc are not functional.
>>
>> I see no differences in Project References or other places as I step
>> through from startup in the IDE.
>> The compiled version produces the same error.
>>
>> The PC has been restarted from full OFF several times.
>>
>> Is something in the main part of the app or some app property that is
>> causing the problem?
>>
>>

There is none. I have notes all over that area to make sure to NOT put
any code after. But good though and I did recheck. The old UC code
(that works in the old app) does not work in the new app so I do not
think it has anything overt related to the UC code (that has the
subclassing code in it).

Also, there are zero (0) add-ins.


Mayayana

11/13/2011 3:22:00 PM

0

I find WinMerge helpful for this kind of thing. I think
I originally got the idea from "Nobody, Master of Useful
Links". To the extent that detailed file comparison can
be made simple, WinMerge achieves that. It would provide
a way to see exactly what's different in the two versions.
The problem you're describing sounds to me like one of
those two day searches that ends with, "Jeez, I can't
believe I overlooked that!"

--
--
"BeeJ" <nospam@spamnot.com> wrote in message
news:j9n0o7$niu$1@speranza.aioe.org...
| Mayayana has brought this to us :
| > There's not really enough info. to tell, but one
| > thing comes to mind: Assuming you're calling
| > Subclass in both cases with nOrdinal set to 1,
| > the callback function needs to be the last method
| > in the calling module. If you added a new function
| > at the end it will fail.
| >
| > --
| > --
| > "BeeJ" <nospam@spamnot.com> wrote in message
| > news:j9mmec$spt$1@speranza.aioe.org...
| >> Same app, same name, one old, one new version.
| >> Old one has mostly the same code.
| >> The new one has fixes and improvements.
| >>
| >> The old on has a UC with subclassing for the mouse.
| >> The new one has the same code. (firstly compared, then deleted and
| >> copied code from old one); still fails.
| >>
| >> The old one runs through the subclassing fine and the subclassing
| >> works.
| >> The new one always fails (did not fail a few days ago).
| >> Fails when trying to find its app in the table.
| >>
| >> This is standrd Paul Caton Subclasser code.
| >> ' Get the address of the specified ordinal method
| >> nAddr = zAddressOf(oCallback, nOrdinal) 'FAILS HERE
| >> If nAddr = 0 Then ' Ensure that we've found the ordinal method
| >> zError SUB_NAME, "Callback method not found"
| >> Exit Function
| >> End If
| >>
| >> So what else is subclassing dependent on?
| >> I can run both at the same time and get different prog IDs as expected.
| >> If it let the new one past the errors, the program runs fine except
| >> that the subclassing stuff, mouse wheel etc are not functional.
| >>
| >> I see no differences in Project References or other places as I step
| >> through from startup in the IDE.
| >> The compiled version produces the same error.
| >>
| >> The PC has been restarted from full OFF several times.
| >>
| >> Is something in the main part of the app or some app property that is
| >> causing the problem?
| >>
| >>
|
| There is none. I have notes all over that area to make sure to NOT put
| any code after. But good though and I did recheck. The old UC code
| (that works in the old app) does not work in the new app so I do not
| think it has anything overt related to the UC code (that has the
| subclassing code in it).
|
| Also, there are zero (0) add-ins.
|
|


ralph

11/13/2011 4:23:00 PM

0

On Sun, 13 Nov 2011 10:22:25 -0500, "Mayayana"
<mayayana@invalid.nospam> wrote:

> I find WinMerge helpful for this kind of thing. I think
>I originally got the idea from "Nobody, Master of Useful
>Links". To the extent that detailed file comparison can
>be made simple, WinMerge achieves that. It would provide
>a way to see exactly what's different in the two versions.
>The problem you're describing sounds to me like one of
>those two day searches that ends with, "Jeez, I can't
>believe I overlooked that!"
>

Especially since the problem will eventually be discovered within a
block of code that one knows for an absolute fact is error free. <g>

-ralph

BeeJ

11/13/2011 9:33:00 PM

0

ralph expressed precisely :
> On Sun, 13 Nov 2011 10:22:25 -0500, "Mayayana"
> <mayayana@invalid.nospam> wrote:
>
>> I find WinMerge helpful for this kind of thing. I think
>> I originally got the idea from "Nobody, Master of Useful
>> Links". To the extent that detailed file comparison can
>> be made simple, WinMerge achieves that. It would provide
>> a way to see exactly what's different in the two versions.
>> The problem you're describing sounds to me like one of
>> those two day searches that ends with, "Jeez, I can't
>> believe I overlooked that!"
>>
>
> Especially since the problem will eventually be discovered within a
> block of code that one knows for an absolute fact is error free. <g>
>
> -ralph

Problem is, what in code, other than in the subclassing code, could
cause it to fail? Something in Properties or some module header text?

nAddr = zAddressOf(oCallback, nOrdinal) 'FAILS HERE
Right before this
nOrdinal = 1
Set oCallback = Me ' Me seems to be unknown in the "new" code.

and "new" fails whether run in the IDE or as .EXE

I moved both versions to a different PC and the "new" code still fails
and the "old" code runs fine.

Compare is sort of a last resort since there are so many lines and so
many modules and now so many changes between the working subclassing
and non-working subclassing (both have the same subclassing code so I
is not in there, me thinks).
I use WinMerge all the time. Very useful tool. Ya! Got that from one
of you in this newsgroup. Thanks!

Maybe some module header got corrupted?
All I can think of is that during some rename (in the IDE), I was not
careful enough and let it rip. So it probably tore a kerf if the
fabric of space-time (within my code, don't want to be responsible for
more than that. This is not a collider project.). "The Sage" does not
have "kerf" as don't many others (pardon my English) so I thought I
would use that here to screw around with any spell checkers (including
MesNews) that might parse this text.

kerf: the slot the saw blade creates as it cuts the workpiece.


ralph

11/14/2011 12:26:00 AM

0

On Sun, 13 Nov 2011 13:32:31 -0800, BeeJ <nospam@spamnot.com> wrote:

>ralph expressed precisely :
>> On Sun, 13 Nov 2011 10:22:25 -0500, "Mayayana"
>> <mayayana@invalid.nospam> wrote:
>>
>>> I find WinMerge helpful for this kind of thing. I think
>>> I originally got the idea from "Nobody, Master of Useful
>>> Links". To the extent that detailed file comparison can
>>> be made simple, WinMerge achieves that. It would provide
>>> a way to see exactly what's different in the two versions.
>>> The problem you're describing sounds to me like one of
>>> those two day searches that ends with, "Jeez, I can't
>>> believe I overlooked that!"
>>>
>>
>> Especially since the problem will eventually be discovered within a
>> block of code that one knows for an absolute fact is error free. <g>
>>
>> -ralph
>
>Problem is, what in code, other than in the subclassing code, could
>cause it to fail? Something in Properties or some module header text?
>
> nAddr = zAddressOf(oCallback, nOrdinal) 'FAILS HERE
>Right before this
> nOrdinal = 1
> Set oCallback = Me ' Me seems to be unknown in the "new" code.
>
>and "new" fails whether run in the IDE or as .EXE
>

Not enough information. But since not having all the facts has never
been a deterrent for me ...

Blind guess would be to check for a naming collision as that is the
most common problem when bringing in modules from one Project into
another.

Another would be to check to see that you are attempting to store an
object reference from one context and use it in another. (If you have
to store a reference do it as a Long and not as an object.)

"Set oCallback = Me" working in one and not the other, is a sure
sign you aren't chewing on what you think you are.

Create new modules in the new project and paste your code. Don't use
the preexisting file modules.

>I moved both versions to a different PC and the "new" code still fails
>and the "old" code runs fine.
>
....
>Maybe some module header got corrupted?

All that is too much. You are looking for the exotic. The solution
will be much simpler.

>Compare is sort of a last resort since there are so many lines and so
>many modules and now so many changes between the working subclassing
>and non-working subclassing (both have the same subclassing code so I
>is not in there, me thinks).

After 30+ years - code I KNOW is not a problem is aways the first
place I look. <bg>

If you are having trouble subclassing, then look closely at where you
are subclassing.

-ralph