[lnkForumImage]
TotalShareware - Download Free Software

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


 

ScottP

11/12/2007 10:49:00 PM

Hi there,

I've been fighting a tough problem for the last week. I have an
application with a VB6 client and a .NET server. On the developer
machine, the application works as expected.

However when I installed our software at our first beta site, the VB6
application now crashes when it receives events from the .NET server.

When I changed the .NET event invocation from synchronous to
asynchronous, the client stopped crashing, but the events are not
received. Again, this mode works fine on the dev tools.

I manually registered the assembly on the target machine, so I am not
suspicious of the installation.

Anyone seen this before or have any idea what I should be looking into?

This is a VB6 SP6 client with .NET 2.0 in proc server.

Thanks,
Scott
6 Answers

ScottP

11/13/2007 1:21:00 AM

0

One other piece of information:

When I trap the error that is thrown when the event is called, I get the
error: Object does not match target type.

I'm thinking that the way the object is registered on the target machine
does not quite match the way it is registered on the dev machine. Does
anyone know how to diagnose this?

Thanks again,
Scott

ScottP wrote:
> Hi there,
>
> I've been fighting a tough problem for the last week. I have an
> application with a VB6 client and a .NET server. On the developer
> machine, the application works as expected.
>
> However when I installed our software at our first beta site, the VB6
> application now crashes when it receives events from the .NET server.
>
> When I changed the .NET event invocation from synchronous to
> asynchronous, the client stopped crashing, but the events are not
> received. Again, this mode works fine on the dev tools.
>
> I manually registered the assembly on the target machine, so I am not
> suspicious of the installation.
>
> Anyone seen this before or have any idea what I should be looking into?
>
> This is a VB6 SP6 client with .NET 2.0 in proc server.
>
> Thanks,
> Scott

wawang

11/13/2007 1:32:00 AM

0

Hi Scott,

It's hard to say what might be wrong without some code. If you manually
installed the files on your beta site, maybe there were some required files
missing on it given the fact that your development box worked fine.


Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

ScottP

11/13/2007 6:53:00 PM

0

I guess I was not clear enough in my post. This is not a case a missing
files. If you are missing files, then the REGASM operation fails, or
visual basic complains when the object is instantiated.

This is specifically an issue that when the event is raised from the c#
server, the VB6 application crashes.

Thanks,
Scott

Here's the code:

namespace Solarius.Vision
{
public delegate void AlignmentCompletedEventHandler(int uniqueID,
bool succeeded);

[ComSourceInterfaces(typeof(IVisionAlignEvents)),
ClassInterface(ClassInterfaceType.None)]
public class VisionAlignment : IVisionAlign
{
private IDictionary<int, AlignmentJob> m_AlignmentJobs;
private bool m_StopJob;
private VideoDialog m_Dialog;

// Events for vision alignment
public event AlignmentCompletedEventHandler AlignmentCompleted;

....

protected virtual void DoWork(Object stateInfo)
{
AlignmentJob job = stateInfo as AlignmentJob;

if (job == null)
{
OnAlignmentCompleted(0, false);
}
else
{
// State info is valid, proceed with synchronous
alignment job
m_Dialog.PerformAlignment(ref job);
}
m_AlignmentJobs.Add(new KeyValuePair<int,
AlignmentJob>(job.UniqueID, job));

OnAlignmentCompleted(job.UniqueID, job.Succeeded);
}

protected virtual void OnAlignmentCompleted(int uniqueID, bool
succeeded)
{
try
{
if (AlignmentCompleted != null)
{
AlignmentCompleted(uniqueID, succeeded);
}
else
{
m_Dialog.SetStatus("OnAlignmentCompleted Event sink
not set.");
}
}
catch (Exception ex)
{
MessageBox.Show("Error during event: " + ex.Message);
}
}


Walter Wang [MSFT] wrote:
> Hi Scott,
>
> It's hard to say what might be wrong without some code. If you manually
> installed the files on your beta site, maybe there were some required files
> missing on it given the fact that your development box worked fine.
>
>
> Regards,
> Walter Wang (wawang@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
>
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>

ScottP

11/13/2007 8:46:00 PM

0

ugghh

This appears to be a bug with the REGASM utility. The utility only
registers the event handlers when you use the /tlb flag.

That was a good waste of 4 days.

-Scott

Walter Wang [MSFT] wrote:
> Hi Scott,
>
> It's hard to say what might be wrong without some code. If you manually
> installed the files on your beta site, maybe there were some required files
> missing on it given the fact that your development box worked fine.
>
>
> Regards,
> Walter Wang (wawang@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
>
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>

Brian Muth

11/13/2007 11:37:00 PM

0

>
> This appears to be a bug with the REGASM utility. The utility only
> registers the event handlers when you use the /tlb flag.
>
> That was a good waste of 4 days.
>

Ah, but Scott, look at it this way. You've saved _me_ 4 days.

Regards,

Brian

ScottP

11/14/2007 9:56:00 PM

0

Glad I could help Brian :-)


Brian Muth wrote:
>>
>> This appears to be a bug with the REGASM utility. The utility only
>> registers the event handlers when you use the /tlb flag.
>>
>> That was a good waste of 4 days.
>>
>
> Ah, but Scott, look at it this way. You've saved _me_ 4 days.
>
> Regards,
>
> Brian
>