3

I need to set the /TSAWARE flag for a legacy VB 6.0 activeX EXE. I can do it with

BINEDIT /TSAWARE app.exe

after building the app, but I'm thinking there should be a way to select it in the VB6 project itself in Visual Studio. I've looked at project properties but don't see anywhere to set linker options. The project is an ActiveX component.

This question mentions doing it in Visual Studio 6.0 with C++ in the linker but haven't seen way to do it in VB which doesn't seem to have explicit link settings.

JonN
  • 2,498
  • 5
  • 33
  • 49
  • 1
    VB6 is certainly older than Windows 2000, which is when Terminal Services really started to become a thing. I'm not sure if it's older than NT4 Terminal Services Edition. Regardless, VB6 is really *that* old. –  Jul 28 '17 at 12:30
  • Ignore the trolls. People wouldn't be using VB6 if Microsoft had ever provided a replacement. Sadly it is the only general purpose high level language native compiler they ever produced for Windows. – Bob77 Aug 02 '17 at 13:19
  • Oh, I still love VB6. It's just that it is so old and unsupported, that when you try to use it with anything newer, you run into issues like this. It can be easy to forget how many things came out *after* VB6, and thus it may not handle easily out of the box. –  Aug 03 '17 at 13:41

2 Answers2

2

You are going to need to do it as you currently are, that flag is not supported by the VB6 linker:

A@ALEX C:\Program Files (x86)\Microsoft Visual Studio\VB98
> link /OUT:x.exe /TSAWARE x.obj
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

LINK : warning LNK4044: unrecognized option "TSAWARE"; ignored
Alex K.
  • 171,639
  • 30
  • 264
  • 288
  • Testing seems to prove this to be an incorrect statement. Works just fine here. – Bob77 Aug 02 '17 at 13:12
  • @Bob77 Are you saying that you can specify /TSAWARE in VB6 Visual Studio? Where and how? I can't find anywhere that linker options are specified in the IDE. However you are right about linker supporting /TSAWARE. Note my linker is later than Alex K. C:\Program Files (x86)\Microsoft Visual Studio 6.0\VB98>link Microsoft (R) Incremental Linker Version 6.00.8447 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. usage: LINK [options] [files] [@commandfile] options: /ALIGN:# . . . /SWAPRUN:{CD|NET} /TSAWARE[:NO] /VERBOSE[:LIB] . . . – JonN Aug 03 '17 at 22:11
  • 1
    As I said in my answer, you can specify that you want this by hand-editing your .VBP files and adding the undocumented `[VBCompiler]` section. – Bob77 Aug 04 '17 at 12:01
2

Actually the "VB6 linker" (VS 6.0 LINK.EXE) does indeed support this flag. Of course you may have to be sure you have installed the VS 6.0 service packs through at least SP6.

To invoke this you can edit your Project's .VBP file, adding the section:

[VBCompiler]
LinkSwitches=/TSAWARE

Using a later "Microsoft (R) COFF/PE Dumper Version 8.00.50727.42" to dump the compiled EXE for confirmation, it shows as 8000 DLL characteristics Terminal Server Aware.

As far as I know this has worked for a very long time, perhaps since Service Pack 3.

Bob77
  • 13,167
  • 1
  • 29
  • 37
  • So the only way to do it is to edit the VBP file directly? There's no user interface for this in Visual Studio 6? – JonN Aug 03 '17 at 22:16
  • If by "Visual Studio 6" you are talking about the VB 6.0 IDE (the VS 6.0 IDE itself does not support VB 6.0) then no, there is no UI access provided. However there may be 3rd party add-ins or add-ins from Microsoft that they shared with certain classes of customers such as Partners. Or you might make your own. – Bob77 Aug 04 '17 at 11:59