• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

PBWin10 and COM

Started by Dominic Mitchell, March 29, 2011, 10:02:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dominic Mitchell

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.
Dominic Mitchell
Phoenix Visual Designer
http://www.phnxthunder.com

José Roca

#1
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.

José Roca

 
Another change is that VARIANT$ is now for VARIANTs containing an ANSI string. For VARIANTs containing an Unicode string you must use VARIANT$$.

Dominic Mitchell

#OPTIMIZE CODE OFF does not solve the problem.

I will check Unicode/Variant$ later.
Dominic Mitchell
Phoenix Visual Designer
http://www.phnxthunder.com

Eros Olmi

thinBasic Script Interpreter - www.thinbasic.com | www.thinbasic.com/community
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

José Roca

Quote
I will check Unicode/Variant$ later.

Got it working just changing three VARIANT$ to VARIANT$$ in SDK_Class.bas.

Dominic Mitchell

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.
Dominic Mitchell
Phoenix Visual Designer
http://www.phnxthunder.com

José Roca

#7
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.



Dominic Mitchell

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.
Dominic Mitchell
Phoenix Visual Designer
http://www.phnxthunder.com

Jean-Pierre Leroy

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