Windows Se7en 64 bits can run 32 bit apps.rdority wrote:Well unfortunately my entire experience so far with PB has rested on the shoulders of PurePop3. My little app which I spent months on worked fairly well in Xp but now I can't even use it in Windows 7.
PurePOP3 library : POP3 functions
Moderator: gnozal
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PurePOP3 library : POP3 functions
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PurePOP3 library : POP3 functions
It's true there is an Xp mode that can be applied on a task by task basis in Windows 7 however that didn't make the app start working again. So much for paying the extra cash for W7 professional.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PurePOP3 library : POP3 functions
Update (PB4.5x version)
- Fixed a bug with some multipart messages.
- Fixed a bug with some multipart messages.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
PurePOP3 crash
One of my apps crashed with an Illegal Operation error today, so I re-ran it with the purifier on and it says the FreeMemory() command in this snippet is using an invalid memory ID. Am I using the following snippet properly? If I delete the FreeMemory() command then my app runs fine and no crash happens, but I don't think that's a good idea to do.
Code: Select all
body$=""
html=PurePOP3_IsMessageHTML()
b=PurePOP3_GetMessageTextInMemory(html)
If b
body$=PeekS(b)
FreeMemory(b); Purifier hates this line.
EndIf
-
- Always Here
- Posts: 6425
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PurePOP3 crash
Hi
This post should be on gnozal's section. The function requires a pointer to a string in memory, as per the example in the PurePop3 help, which also states that it must be used after a PurePOP3_RetrieveMessage() call:
Get text from retrieved message.
If HTML is #True, the retrieved text is "text/html" (default is "text/plain")
Must be used after PurePOP3_RetrieveMessage().
Returned values :
- > 0 : memory pointer to message text [ASCIIZ]
- 0 : error
This post should be on gnozal's section. The function requires a pointer to a string in memory, as per the example in the PurePop3 help, which also states that it must be used after a PurePOP3_RetrieveMessage() call:
Get text from retrieved message.
If HTML is #True, the retrieved text is "text/html" (default is "text/plain")
Must be used after PurePOP3_RetrieveMessage().
Returned values :
- > 0 : memory pointer to message text [ASCIIZ]
- 0 : error
Code: Select all
If PurePOP3_RetrieveMessage(MessageNumber.l) > 0
*Message = PurePOP3_GetMessageTextInMemory()
If *Message
Debug "Message text : " + PeekS(*Message)
FreeMemory(*Message)
EndIf
EndIf
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: PurePOP3 crash
Sorry! Perhaps a forum moderator could move it for me, please.IdeasVacuum wrote:This post should be on gnozal's section
I didn't post my full code to save time, but the code sample I posted is just part of my source. I have already retrieved the message before the code is executed. My code shows that b<>0, which means the mail body HAS been read correctly, and indeed my program shows me the body correctly (stored in body$), but then trying to free it is causing a invalid memory access error. It shouldn't if the body has been read, correct?IdeasVacuum wrote:The function requires a pointer to a string in memory, as per the example in the PurePop3 help, which also states that it must be used after a PurePOP3_RetrieveMessage() call
Re: PurePOP3 crash
You have to remove FreeMemory, FreeMemory is only for allocated Memory with PB, not for
pointer to Strings.
pointer to Strings.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Re: PurePOP3 crash
But the help file says to use FreeMemory(), just as IdeasVacuum posted. How else can I free it?ts-soft wrote:You have to remove FreeMemory, FreeMemory is only for allocated Memory with PB, not for
pointer to Strings.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PurePOP3 crash
PurePOP3_GetMessageTextInMemory() returns a pointer to allocated memory with AllocateMemory().ts-soft wrote:You have to remove FreeMemory, FreeMemory is only for allocated Memory with PB, not for
pointer to Strings.
Now, although I never experienced a problem myself, maybe there is an issue because the memory is allocated in the library, and FreeMemory() is executed in the main code.
I may have to add a function to free the memory from the library.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PurePOP3 library : POP3 functions
This problem comes with to small allocated memory! Your allocations miss the place for the nullbyte(s) for strings?
Test this with and without purifier
Code: Select all
Define.s Text = "Hello"
Define *mem = AllocateMemory(Len(Text)); to small!
PokeS(*mem, Text)
FreeMemory(*mem)
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PurePOP3 library : POP3 functions
The library code allocates extra space for the null bytes.ts-soft wrote:This problem comes with to small allocated memory! Your allocations miss the place for the nullbyte(s) for strings?
And the library does not trigger any error with the purifier.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PurePOP3 library : POP3 functions
I have updated the library (PB 4.50 version).
I have added a new function PurePOP3_FreeMessagePointer() to free the memory allocated by PurePOP3_GetMessageTextInMemory().Please test.
I have added a new function PurePOP3_FreeMessagePointer() to free the memory allocated by PurePOP3_GetMessageTextInMemory().
Code: Select all
If PurePOP3_RetrieveMessage(MessageNumber.l) > 0
*Message = PurePOP3_GetMessageTextInMemory()
If *Message
Debug "Message text : " + PeekS(*Message)
PurePOP3_FreeMessagePointer(*Message)
EndIf
EndIf
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PurePOP3 library : POP3 functions
Thank you, no more crash when using PurePOP3_FreeMessagePointer() now.
PurePOP3_IsMessageHTML() hangs
I've got an email with a 35 KB image attachment, and when I use the PurePOP3_IsMessageHTML() command, it just hangs. I know it hangs because the following code just prints "start" to the debug output window and never the "finish", and my program just sits there without continuing, even after 5 minutes. I can post the trace output if you like, but would rather not for privacy reasons. Maybe you can just look at the command first and see if something obvious was missed?
Code: Select all
Debug "start"
h=PurePOP3_IsMessageHTML()
Debug "finish"
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PurePOP3_IsMessageHTML() hangs
Without the traces, I can do zip.C64 wrote:I've got an email with a 35 KB image attachment, and when I use the PurePOP3_IsMessageHTML() command, it just hangs. I know it hangs because the following code just prints "start" to the debug output window and never the "finish", and my program just sits there without continuing, even after 5 minutes. I can post the trace output if you like, but would rather not for privacy reasons. Maybe you can just look at the command first and see if something obvious was missed?
There is nothing obvious with "multipart/related", "multipart/alternative", etc... ; every mail client sends the stuff differently.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).