ActiveX Control instance problems

perimore
03-14-2008, 01:32 PM
Hi,

This is my first post on here. I am currently trying to complete a university project that allows items that are being delivered to be checked whether they are going to the right location via SMS. This involves the use of the MapPoint 2006 EU control and the object library.

The problem I am having is that both the client (software in the delivery truck) and the management system (for creating deliveries) share the same business logic. The management software uses the control whereas the client and business logic reference the object library.

If i call a business logic function using the client, it works fine. If however, I call the same function using the management software I get the following error:

System.TypeLoadException was unhandled
Message="Could not load type 'MapPoint.ApplicationClass' from assembly 'Interop.MapPoint, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."
Source="RFIDSatTrackBiz"
TypeName="MapPoint.ApplicationClass"
StackTrace:
at RFIDSatTrackBiz.DeliveryItem.checkDeliveryLocation ()
at RFIDSatTrackBiz.GSM.readMessage(String Message) in C:\Users\Sean\Documents\Uni Work\Final Year Project\RFIDSatTrack\RFIDSatTrack\RFIDSatTrackBiz\ GSM.vb:line 168
at RFIDSatTrackBiz.GSM.SMSPort_DataReceived(Object sender, SerialDataReceivedEventArgs e) in C:\Users\Sean\Documents\Uni Work\Final Year Project\RFIDSatTrack\RFIDSatTrack\RFIDSatTrackBiz\ GSM.vb:line 126
at System.IO.Ports.SerialPort.CatchReceivedEvents(Obj ect src, SerialDataReceivedEventArgs e)
at System.IO.Ports.SerialStream.EventLoopRunner.CallR eceiveEvents(Object state)
at System.Threading._ThreadPoolWaitCallback.WaitCallb ack_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Objec t userData)
at System.Runtime.CompilerServices.RuntimeHelpers.Exe cuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(Exec utionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
at System.Threading._ThreadPoolWaitCallback.PerformWa itCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
at System.Threading._ThreadPoolWaitCallback.PerformWa itCallback(Object state)

Im guessing that it has something to do with already having the application referenced through the control and then trying to reference it again in the object library. I have created a new instance in the code so it should work.

This is a bit of a long winded problem but if someone could shed some light it would be massively appreciated.

Thanks,

Sean

Wilfried
03-15-2008, 06:46 AM
Hi,

If I understand right then you use the activex control and the object model in the same application. I once tried this in C# and for some reason it is impossible to use both of them in same application.

perimore
03-15-2008, 07:05 AM
I guessed this was the problem, strange one though seeing as I'm creating new instances. I will just have to change the app, not ideal but it will work.

Thanks a lot,

Sean
:drummer:

Wilfried
03-16-2008, 12:50 PM
Hi,

I don't know the reason. You can change the application, or split the applications in 2 separate and let them talk to each other trough Tcp or named pipe or other communication methods windows provide. just some thoughts.

 
Web mp2kmag.com
mapforums.com