Author Topic: VB6 not dead  (Read 38022 times)

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: VB6 not dead
« Reply #30 on: January 04, 2017, 10:51:50 AM »
Now it works when I gave it another try this morning.  :o

Quote from: Mike
Both VB6 and VB.NET are gonna choke with the double quotes you're using in your sources,

Your comment put me into a tailspin of confusion and now I'm back at square one.

Please do something with your theming support for your VB6 IDE on XP. It gives this thread a bad image of why people left in the first place. The Windows 2000 look is dead not VB6. I have attached the Windows 7 VB6.EXE manifest. Let me know if you need my XP version.
« Last Edit: January 04, 2017, 05:42:07 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: VB6 not dead
« Reply #31 on: January 04, 2017, 08:19:41 PM »
Thanks Mike for the themed addition to your post. It shows how a VB6 modern interface can enhance the user experence.

Mike Lobanovsky

  • Guest
Re: VB6 not dead
« Reply #32 on: January 04, 2017, 08:28:48 PM »
Your comment put me into a tailspin of confusion and now I'm back at square one.

You Linuxoids are too eager to do things differently from the rest of the business world. Where ordinary mortals would use apostrophes: '...', you tend to use an accent and an apostrophe: `...', and where we use conventional double quotes: "...", you prefer to use Windows locale specific glypths “...” that would be turned into Cyrillic handwritten ,,...” (not even sure how to call it in English) by the Russian edition of Windows while russified MS Office would substitute them with Cyrillic typographic double chevrons <<...>>. Hey there on the other side of the ocean, high time to decide on something definitive! Too much internationalization also has its downsides, you know... :D

Quote
Please do something with your theming support for your VB6 IDE on XP.

No problem. I've appended a manifested VB6 IDE snapshot juxtaposed with my earlier one. Feel free to delete or keep either one at your own option. (does scriba have a manifest yet, John?)
« Last Edit: January 04, 2017, 08:33:11 PM by Mike Lobanovsky »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: VB6 not dead
« Reply #33 on: January 04, 2017, 08:40:34 PM »
sbwin.exe is a Windows version of scriba.exe and supports current OS themes used with IUP applications.

AIR was kind enough to build the resource file for the IUP GUI Windows version of Script BASIC using TDM-GCC.
« Last Edit: January 05, 2017, 06:30:06 PM by John »

Mike Lobanovsky

  • Guest
Re: VB6 not dead
« Reply #34 on: January 04, 2017, 08:47:19 PM »
Are you aware of this thread on the O2 forum?

I think own embedded icon, manifest, and version info resources would do both sbwin.exe and scriba.exe more good then harm as well.

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: VB6 not dead
« Reply #35 on: January 04, 2017, 08:52:57 PM »
Thanks for the link but I have no interest at this time doing anything Windows 64 bit.

Mike Lobanovsky

  • Guest
Re: VB6 not dead
« Reply #36 on: January 04, 2017, 09:04:14 PM »
What I said there pertains to all 32- and 64-bit Windows applications, John, regardless of our concomitant topic on 64-bit TCC initiated by James.

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: VB6 not dead
« Reply #37 on: January 05, 2017, 10:30:41 AM »
I understand your point that SB executables should contain all the resouces (manifests, icons, ...) and author, version info.
« Last Edit: January 05, 2017, 10:33:19 AM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: VB6 not dead
« Reply #38 on: January 05, 2017, 05:53:41 PM »
Mike,

Do you know if it's possible with VB6 to create a forms designer? I'm looking at integrating IUP realtime dialog editor/designer as an extension of Dave's VB6 based Script BASIC IDE/Debugger. It would be fun extending the SB IDE just to shake the rust off from not using it for so long.

Another idea I had was a utility to convert VB6 form files to IUP LED form files. Then I could use VB6 as my designer. (Windows and Linux - one code base)

IUP has a IupOleContro but support is minimal. I'm wondering if the SB COM ext. module could be used with it?

Here is an example of using the IupOleControl with the Windows web browser COM control.

Code: C
  1. /*
  2.  * IupOleControl sample using C++
  3.  */
  4.  
  5. #include <stdlib.h>
  6. #include <stdio.h>
  7.  
  8. #include <windows.h>
  9. #include <exdisp.h>
  10.  
  11. #include <iup.h>
  12. #include <iupole.h>
  13.  
  14.  
  15. // Needed to use the WebBrowser OLE control if not using the <expdisp.h> header
  16. //#import "progid:Shell.Explorer.2" no_namespace named_guids
  17.  
  18. static WCHAR* Char2Wide(char* str)
  19. {
  20.   if (str)
  21.   {
  22.     int n = strlen(str)+1;
  23.     WCHAR* wstr = (WCHAR*)malloc(n * sizeof(WCHAR));
  24.     MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, n);
  25.     return wstr;
  26.   }
  27.  
  28.   return NULL;
  29. }
  30.  
  31. static int load_cb(Ihandle* self)
  32. {
  33.   Ihandle* txt = (Ihandle*)IupGetAttribute(self, "MY_TEXT");
  34.   IWebBrowser2 *pweb = (IWebBrowser2*)IupGetAttribute(self, "MY_WEB");
  35.   WCHAR* url = Char2Wide(IupGetAttribute(txt, "VALUE"));
  36.  
  37.   // Uses the navigate method of the control
  38.   pweb->Navigate(url, NULL, NULL, NULL, NULL);
  39.  
  40.   free(url);
  41.   return IUP_DEFAULT;
  42. }
  43.  
  44. int main(int argc, char **argv)
  45. {
  46.   Ihandle* txt, *bt;
  47.   IupOpen(&argc, &argv);
  48.   IupOleControlOpen();
  49.  
  50.   // Creates an instance of the WebBrowser control
  51.   Ihandle* control = IupOleControl("Shell.Explorer.2");
  52.  
  53.   // Sets production mode
  54.   IupSetAttribute(control, "DESIGNMODE", "NO");
  55.  
  56.   // Creates a dialog containing the OLE control
  57.   Ihandle* dlg = IupDialog(IupVbox(IupHbox(txt = IupText(""), bt = IupButton("Load", NULL), NULL), control, NULL));
  58.   IupSetAttribute(dlg, "TITLE", "IupOle");
  59.   IupSetAttribute(dlg, "MY_TEXT", (char*)txt);
  60.   IupSetAttribute(txt, "EXPAND", "HORIZONTAL");
  61.   IupSetCallback(bt, "ACTION", (Icallback)load_cb);
  62.  
  63.   // Maps the dialog to force the creation of the control
  64.   IupMap(dlg);
  65.  
  66.   // Gathers the IUnknown pointer to access the control's interface
  67.  
  68.   IUnknown* punk = (IUnknown*) IupGetAttribute(control, "IUNKNOWN");
  69.   IWebBrowser2 *pweb = NULL;
  70.   punk->QueryInterface(IID_IWebBrowser2, (void **)&pweb);
  71.   punk->Release();
  72.   IupSetAttribute(dlg, "MY_WEB", (char*)pweb);
  73.  
  74.   // Shows dialog
  75.   IupShow(dlg);
  76.  
  77.   IupMainLoop();
  78.  
  79.   // Releases the control interface
  80.   pweb->Release();
  81.  
  82.   IupClose();
  83.  
  84.   return EXIT_SUCCESS;
  85.  
  86. }
  87.  

Once I get control = IupOleControl() I should be able to use the Script BASIC COM interface to access properties and call methods. Events are still being investigated.
« Last Edit: January 05, 2017, 08:59:44 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: VB6 not dead
« Reply #39 on: January 05, 2017, 11:51:43 PM »
It seems every time I try to start VB6 IDE now, it tries to install VS2008 (again). From the few Google searches I've done this is a know problem but none of the suggested fixes worked.  :-[

Mike Lobanovsky

  • Guest
Re: VB6 not dead
« Reply #40 on: January 06, 2017, 04:49:43 AM »
It seems every time I try to start VB6 IDE now, it tries to install VS2008 (again). From the few Google searches I've done this is a know problem but none of the suggested fixes worked.  :-[

Please have a closer look at this thread. MS is reluctant to ensure backward compatibility of their newer Visual Studios with VS6 that the VB6 IDE was part of. The strategy described in the thread I've pointed to may help cure your problem.

Every NT-based Windows of the Professional/Enterprise/Ultimate brand has a cluster of services called Administrative Tools in its Control Panel. (Make sure you're seeing a full list of Control Panel apps and services rather than its default abortive Suzie User view.)

Goto Administrative Tools->Event Viewer->Windows Logs->Application's list of notifications, alerts and errors to deduct exactly what might be causing delays/unwanted activity whenever your launch your VB6 IDE, and try to fight it similar to what the people are doing as per the above link.

You're playing against MS .NET interests and in doing so, it would be unreasonable to expect their co-operation. :)

Mike Lobanovsky

  • Guest
Re: VB6 not dead
« Reply #41 on: January 06, 2017, 05:32:08 AM »
Do you know if it's possible with VB6 to create a forms designer?

You can create any procedural code in VB6 regardless of this BASIC being essentially a COM-based OOP product (cf. ANSI C/C++ compatibility in all VC/GCC products), as long as your code doesn't need explicit access to memory pointers unavailable in an unmodified VB6 environment.

There are many implementations of a minimal forms designer around but most of them are based on the same Public Domain code found e.g. in BCX' BFMD (SDI) or FBSL's FMFD (MDI) albeit with different, target BASIC-dependent code generators.

You can download the FBSL re-implementation of the same and study both its source code and functional precompiled binary. FBSL BASIC is closer to VB6 than BCX in its syntax and its sources would be easier to translate to VB6 to the exact same effect, of course having rewritten the code generator part to emit VB6-specific (or Iup-specific, for that matter) control prototypes because:
  • VB6 doesn't have a generic CONTROL widget available in FBSL/PB/TB/BCX and the like to dynamically create any common control available under Windows;
  • VB6 uses extended in-house Thunder... and ThunderRT... wrappers for its set of intrinsic controls rather than raw Common Controls every other BASIC/C/whatever language uses for their UIs.
Note that both BCX and FBSL minimal form designers would be equally far from perfect because they are based on essentially the same source code. Yet both could be debugged and improved upon while being translated to VB6.
« Last Edit: January 06, 2017, 06:31:26 AM by Mike Lobanovsky »

Mike Lobanovsky

  • Guest
Re: VB6 not dead
« Reply #42 on: January 06, 2017, 08:00:28 AM »
[OT] That's what my weather monitor gadget currently looks like:  ;D [/OT]

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: VB6 not dead
« Reply #43 on: January 06, 2017, 09:12:40 AM »
Thanks Mike for your post!

Adding the directory didn't work for me like it did for others. The last post to that thread mentioned he just let VS#### reinstall and the problem went away. I will give that method a try if your suggestions don't work.

Update

I decided to let VS2008 reinstall and went to grab a cup of coffee and when I returned there was no indication a install was in process or completed, just the desktop as if I just restarted and logged in. Everything works like it should. STRANGE!
« Last Edit: January 06, 2017, 10:17:40 AM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: VB6 not dead
« Reply #44 on: January 06, 2017, 01:26:18 PM »
Quote
  • VB6 doesn't have a generic CONTROL widget available in FBSL/PB/TB/BCX and the like to dynamically create any common control available under Windows;
  • VB6 uses extended in-house Thunder... and ThunderRT... wrappers for its set of intrinsic controls rather than raw Common Controls every other BASIC/C/whatever language uses for their UIs.

That may be true for virgin VB6 but with the use of the VBCCR13.OCX replacement for the Thunder classed controls, I don't think that is still a limitation.