Finding out what is different between 9 and 10 should be interesting.
My Component Object Model SDK class successfully compiles on both version 9 and 10, but
the exe produced by version 10 GPF's.
Regarding COM, the major change is native Unicode support.
Also, if you use internal callback classes that are called by an external application, you must declare them as COMMON to avoid code removal.
Another change is that VARIANT$ is now for VARIANTs containing an ANSI string. For VARIANTs containing an Unicode string you must use VARIANT$$.
#OPTIMIZE CODE OFF does not solve the problem.
I will check Unicode/Variant$ later.
Maybe
#OPTION ANSIAPI
Quote
I will check Unicode/Variant$ later.
Got it working just changing three VARIANT$ to VARIANT$$ in SDK_Class.bas.
Thanks.
The utility I use to track down GPFs does not handle PowerBASIC COM syntax. I was in the process of modifying it.
If PB 10 handles calculated references, I will just specify that the SDK class must be used with
version 10 or higher of the compiler.
On second thought, I will not bother supporting version 9 for this class.
Quote
If PB 10 handles calculated references [...]
Unfortunately, it does not.
The two features I was most interested and that I have checked thoroughly during the beta testing, are unicode support and dead code removal.
No more need for ACODE$/UCODE$ and USEMACROS, and no more need for workarounds such declaring a null terminated string parameter as DWORD, using an ansi string with UCODE$ and passing it with STRPTR. Now, these parameters are declared as BYREF WSTRINGZ.
Dead code removal is allowing me to write classes and tons of wrapper functions that don't add bloat. It's a great way of extending the language.
Your ListView example for the SDK_Class compiled to 199 KB using PB9 and now compiles to 97 KB using PB 10 and my new headers.
Thanks again, you just saved me a lot of trouble.
The size reduction is very impressive. It means I can add functionality to the class with total abandon.
QuoteNo more need for ACODE$/UCODE$ and USEMACROS, and no more need for workarounds such declaring a null terminated string parameter as DWORD, using an ansi string with UCODE$ and passing it with STRPTR. Now, these parameters are declared as BYREF WSTRINGZ.
Hi José,
Some times ago you wrote some codes to retrieve the date and time when the original image data was generated; it was in this thread (http://www.powerbasic.com/support/pbforums/showthread.php?t=43429)
Following your advices, I adapted the code with the new WSTRINGZ string data type and everything works fine now; thanks.
With PB9
Local lPictureFileName As String
lPictureFileName = UCode$(pPictureFileName)
hStatus = GdipLoadImageFromFile(StrPtr(lPictureFileName), pImage)
With PB10
Local lPictureFileName As WSTRINGZ*%MAX_PATH
lPictureFileName = pPictureFileName
hStatus = GdipLoadImageFromFile(lPictureFileName, pImage)
Thanks,
Jean-Pierre