CWindow RC 23

Started by José Roca, October 03, 2016, 03:04:12 PM

Previous topic - Next topic

Marc Pons

Jose, 
i'm very sad :'(

All the knowledge and passion you have for COM technology must not desapear !

You are one of the people who gave me the possibility to understand and work at certain extend with COM outside VC/VB .

For a vb6 guy as i was, it was so frustating to not be able to play as simple, as it was on the vb6 era.
For that reason, i've investigated a lot on Autoit wich has the flavor of basic and giving almost the same easy support to COM as VB6.
You on PowerBasic, Loe and Aloberoger on the freebasic forum ( who were also inspired by you) gave me almost the same possibilities (not as simpler) and i have to thank you so much for that.

Even making the last TypeLib browser functionnal for freebasic! And sharing your source code!

I hope, the frustration you feel by the "lack of interrest" will not persiste...

For my part, I will continue to investigate, improving my small competences on using activeX components,
it is a deep mine for curious people.

Hope, if i have stupid questions you can continue to give me some help, here or somewhere else...

Please receive my best regards, Marc.

Note : be sure, i have and will archive your precious posts   8)

David Warner

Hi Jose,

I too am sad to read of your disappointment with the lack of interaction and feedback about your amazing efforts. I imagine the lack of feedback is largely to do with the fact that your accomplishments are so far ahead of where the rest of us 'mere mortals' are at. It is immensely difficult for the silent majority to contribute as you operate at a level so far beyond ours. What might seem obvious and straightforward to you is somewhat obscure and impenetrable to others and it is hugely reassuring to know that Jose the master has blazed a trail for the rest and made everything simple to use.

It is a frequent source of pleasure and admiration for me that you are kind and gracious enough to share your efforts with those of us who would never be able to originate such tremendous software. Whatever your choice may be about what you publish in the future, I would just like to express my thanks to you for all that you have already done. You have demonstrated not only how to write the best software but how to be a decent, generous and inspirational human being. Thank you.

José Roca

What it remains still contains a lot of useful stuff. I mainly have removed the COM parts, so those that never use COM won't miss it. The COM wrappers were an attempt to make this technology more accessible, but I don't really need them.

I will continue exploring what I can do with the WebBrowser control using HTML and javascript. With the OLE Container and the CWebBrowser class I can start to attempt to make GUIs using HTML instead of / or mixing with Windows controls. This is an exciting possibility to make cool GUIs, taking the best of both technologies.



Wilko Verweij

Dear Jose,
I just recently started exploring FreeBasic, as I have a project written in FireFly/PowerBasic which I want to finish before quitting PowerBasic entirely. So my lack of interest is because I am late in switching to FreeBasic, not because I am not interested in your work. On the contrary, I really appreciate your expertise and the huge amount of work you spent on developing and testing these includes for FireFly/Powerbasic and FreeBasic. So I hope you do not stop this work...
Wilko

Paul Squires

Quote from: Jose Roca on October 07, 2016, 04:50:44 PM
...With the OLE Container and the CWebBrowser class I can start to attempt to make GUIs using HTML instead of / or mixing with Windows controls. This is an exciting possibility to make cool GUIs, taking the best of both technologies.

That would be a very cool project for GUI's. I wrote an ecommerce site last year and it was my first big project using Javascript, HTML/CSS, PHP, MYSQL and other libraries. Web technologies have come a long way. These days there is a push to create standalone cross platform applications. Take a look at projects like the Atom code editor that uses the Electron framework. Amazing what can be created these days with web technologies.
Paul Squires
PlanetSquires Software

Petrus Vorster

Paul, let me please ask a question i think many here is waiting for.

Would you consider using this cwindow developments of Jose in a future firefly for FB?
There are so much new developments that if you two throw this together, you will build one serious development tool.

I for one would love to have a Firefly that has all this new stuff from Jose as well.

Ps. Checked out ATOM, very cool.
-Regards
Peter

Paul Squires

Hi Peter, yes, of course I would use Jose's CWindow in FireFly for FB. That is not too difficult to do at all. I did it for the PB version a long time ago. The "problem" is that I want FireFly to be unicode based and Jose has done tremendous work in that area with regards to FreeBasic and unicode. I would want the visual designer to be 100% unicode based while also using CWindow for the code generation. As you probably already know, I have been working on code editors for FB (FBE) and one version is pretty much done with the other version almost done. Both are unicode and CWindow based. The next step after that would be to add a visual designer that integrates with the code editor.
Paul Squires
PlanetSquires Software

José Roca

Now that we have CWSTR, there is not excuse to not use unicode. It is super fast and dynamic. I learned years ago that using ansi in an application that you later plain to convert to unicode is the wrong way. For what we need a framework with both ansi and unicode versions if only the unicode one is needed? Although FB has not full unicode suport, at least it deals with unicode transparently, allowing to pass ansi strings to functions that have WSTRING parameters and doing an automatic conversion.

For the "Spectre" version of the framework, I'm going to rescue some stuff like the OLE Container and the CWebBrowser class. There are only a few wrappers that use CBSTRings and I can adapt them to use CWSTR instead, doing the needed conversions in the internal code. I'm going to use it extensively and don't want to have a version of the framework for general use and another for private use.

Regarding CBSTR, I wasn't fully satisfied with this data type because I had to use a couple of hacks. Anyway, if I'm the only one that is going to use COM, I have no problem to use it at low-level.

I'm also going to rescue some COM related stuff, like AfxCOM.inc, that does not use CBSTR, CVARIANT or CSafeArray. I need it and its use is optional.


José Roca

I have discovered a curious thing.

If I use a CWSTR in a line such


PRINT "Line " & WSTR(curLine) & ", Column " &  WSTR(curColumn) & ": " & **cwsText


I have to use **cwsText (double indirection)

But if I use + instead of &, I don't need the **


PRINT "Line " & WSTR(curLine) & ", Column " &  WSTR(curColumn) & ": " + cwsText


It also happens when concatenating strings:


cws = WSTR(curLine) + ", Column " +  WSTR(curColumn) + ": " + cwsText


Johan Klassen

Hi Jose
at the risk of being wrong, could it be that the + operator is overloaded ?

José Roca

Both are overloaded. The difference is that whereas the two expressions concatenated by the + operator must be strings, the & operator also accepts numbers and tries to do the conversion.

Paul Squires

Jose, I have also noticed that several times in the code that I've written. Sometimes the "&" concatenation does not work. I have always used the "&" rather than "+".
Paul Squires
PlanetSquires Software

José Roca

Using ** or the + operator always works. Maybe the & operator sometimes can't ascertain if it is a pointer to a string or a number that must be converted to a string.

José Roca

I have managed to get most of the framework working without using CBSTR and CVARIANT.

Marc Pons

Quote from: Jose Roca on October 09, 2016, 10:26:26 PM
Both are overloaded. The difference is that whereas the two expressions concatenated by the + operator must be strings, the & operator also accepts numbers and tries to do the conversion.

in fact when using operator "&" , it will implicitly make a conversion to string using str()
the operator "+" will expect true strings so it will not make implicit conversion

that explain :
QuoteIf I use a CWSTR in a line such

Code: [Select]

PRINT "Line " & WSTR(curLine) & ", Column " &  WSTR(curColumn) & ": " & **cwsText


I have to use **cwsText (double indirection)

because cwsText is a class and str() function does not understand how to do with it.

i think you can define a new overload operator "&" to use cwstr directly  without **cwsText
for string result
Operator & (ByRef ust1 as string , ByVal cwst2 as CWSTR) as string
      return ust1 & **cwst2  'using here the implicit cast to string to convert cwst2 content to string
'or      return ust1 & str(**cwst2) 'explicit conversion
end operator

easier way but more operations !
could also be duplicated to CWSTR  or WSTRING