West Wind Internet and Client Tools
Change in POP3 after moving to version 7.04
Gravatar is a globally recognized avatar based on your email address. Change in POP3 after moving to version 7.04
  Marcin
  All
  Apr 7, 2019 @ 01:18pm

Hi Rick, I am using the code presented below for the last 6 years on a daily basis collecting incomming mails. Everything was fine until version 6 of dotnetbridge. When I start using the files dotnetbridge.dll and .prg of version 7.04 the error message "The parameter is incorrect" comes at the line "loarray.fromenumerable .." The reason seems to be because the line "loList=lobridge.InvokeMethod(loPOP,"GetMessageUids")" does not provide the expected data. When I copy back the files of dotnetbridge.dll .prg of version 6 it is working fine again. I see that you marked in your documentation the class for POP3 as deprecated. Is that mean that there is no way to use bewlow code with the version 7? I am now involved in converting my program to work with Rest Api service and didn't expeted to be involved in reworking mail communicaation part. Can you advice how to solve the issue in a simplest way,please? I am using OpenPop dll the same you have in your samples. Regards, Marcin

lobridge=GetwwDotNetBridge()											

IF NOT lobridge.LoadAssembly("OpenPop.dll")
	MESSAGEBOX("Error ..")
	RETURN .F.
endif

loPop = lobridge.CreateInstance("OpenPop.Pop3.Pop3Client")
lobridge.InvokeMethod(loPop,"Connect","****",995,.T.)  	
loPop.Authenticate("****",lcHaslo)						

loList=lobridge.InvokeMethod(loPOP,"GetMessageUids")
loArray = lobridge.CreateArray()		
loArray.FromEnumerable(loList)							 
lnCount = loarray.count
Gravatar is a globally recognized avatar based on your email address. re: Change in POP3 after moving to version 7.04
  Rick Strahl
  Marcin
  Apr 7, 2019 @ 02:32pm

wwPop3 doesn't use wwDotnetBridge, so the code you're using is not based on something that's in the box actually. The openPop .NET component is a sample I shipped and demonstrated at a few conferences as an example, but it was never a full implementation.

As to changes - there have been some changes how .NET collections are processed and that might have an effect on the behavior of some lists. One of the changes was to automatically convert IEnumerable values into lists, that are then returned as arrays. However, based on what you show there the code should still work - I have to take a look.

Actually looking again I think the result that comes back from the Invoke will already be a COMARRAY so you don't have to explicitly convert.

In other words this should work now:

loList=lobridge.InvokeMethod(loPOP,"GetMessageUids")
lnCount = loList.count

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Change in POP3 after moving to version 7.04
  Marcin
  Rick Strahl
  Apr 8, 2019 @ 03:29pm

Indeed, it works now. Thanks. Marcin

© 1996-2019