Page 1 of 2

Working With Visual Studio 2015 and FWH / Harbour

Posted: Wed May 04, 2016 4:40 pm
by TimStone
Microsoft has released it's latest edition of Visual Studio, and the Community Edition 2015 is free to developers. This is not some cut down limited edition, but a full featured IDE which uses all of the languages available for Windows, Linux, iOS, and Android development. ( You read that correctly ). It also incorporates the tools we, as FWH developers, need to build strong applications.

Though we can use various .mak and .bat files to build these applications just using the MSVC C compiler and linker, we can also use the IDE. I am starting this thread and will go through how to do a setup VS 2015 itself. The advantage here is simple. Use the IDE for everything, and do your builds quickly. I actually edit my files in Ultra Edit Studio, but have VS 2015 open and hit one button to do the build for my tests. It's very fast, and errors of construction are easily displayed.

This topic was discussed over the past few years in this forum. However, it was across multiple threads. I'll share what I have found to work well over the next few days, and ask that anyone else using the IDE feel free to include their observations as well.

PLEASE LIMIT THIS THREAD TO THE IDE. I know there are alternative methods of assembly, but those are all discussed in other threads.

I know some will ask "Why use the Microsoft compiler when we have Borland / Pelles / Others ?" My response:
1) It is FREE
2) It is current
3) Microsoft is on a path to bring together connectivity to ALL major OSs. We will be getting more functionality each month.
It is not your only option, but if you want to explore it, your only cost is time.

To get started, you will want the free Visual Studio 2015 Community Edition. Download it for free from here:
https://www.visualstudio.com/en-us/visu ... ge-vs.aspx

You will want FWH 16.03 or newer, and your libraries will be FiveH32.lib and FiveHC32.lib

You will need Antonio's latest Harbour build from this download site:
https://bitbucket.org/fivetech/harbour- ... 160330.zip

Tim

Re: Working With Visual Studio 2015 and FWH / Harbour

Posted: Wed May 04, 2016 4:55 pm
by Antonio Linares
Tim,

thanks for this very interesting thread.

I am using the Visual Studio Community 2015 (vsc2015) IDE and the low level integrated debugger lately.

Thanks to its great debugger I have been able to implement the Toasts support in FWH 16.04 :-)

Its a great tool and it is free. What else ? :-)

Re: Working With Visual Studio 2015 and FWH / Harbour

Posted: Wed May 04, 2016 5:01 pm
by norberto
TIm, nice, i try some time ago, i will try again, Works with fwh1602? or only 1603?

thanks

Re: Working With Visual Studio 2015 and FWH / Harbour

Posted: Wed May 04, 2016 6:33 pm
by TimStone
2015 requires 16.03 and above because Antonio started building the MS C libraries with it at that point.

Re: Working With Visual Studio 2015 and FWH / Harbour

Posted: Wed May 04, 2016 7:16 pm
by Antonio Linares

Re: Working With Visual Studio 2015 and FWH / Harbour

Posted: Wed May 04, 2016 9:05 pm
by TimStone
STEP 2: Setting up and building a program.

Now that you have gathered all of your files onto your computer, you will need to setup and install a new "solution". Antonio has detailed this beautifully, with screen shots, in the following thread for VS 2013:

http://forums.fivetechsupport.com/viewt ... 23&start=0

Here are some issues for Community 2015, and from some recent testing:

1) Antonio suggests a folder for libraries. I found that the IDE organizes those libs alphabetically, and does not allow you to order them. So, I went into the System Properties, selected Linker, and for input, I entered them as Dependencies. The only exception was that I put FiveH32.lib and FiveHC32.lib into the source folder as suggested. By doing it this way, I can actually put the .lib files into the list in which I want the linker to read them, and certain routines ( ie. Harbour TIP which has 5 files that must be linked in a specific order ) actually work.

2) In step 16, you declare /NODEFAULTLIB:MSVCRT You may also need to do the same for MSVCRTD

3) In the same step, you are told to add the windows libraries from a path specified as Windows SDKs. Now the path for those files needs to be:
c:\Program Files (x86)\Windows Kits\8.1\bin\x86
Follow the same procedure but get the files from this new location for VS 2015.

4) Finally, VS IDE has a decent editor if you want to use it. Highlighting would be nice, and Antonio has provided a guide for setting that up in this thread:
http://forums.fivetechsupport.com/viewt ... =3&t=28600

A lot of time has been spent by Five Tech staff to bring this all together. I appreciate all they have done. I hope others will step in here and also start working with this and provide their input.

Yes, you can build FWH 64 bit applications also with the IDE.

Re: Working With Visual Studio 2015 and FWH / Harbour

Posted: Tue May 17, 2016 5:09 pm
by mariordzmej
I have succesfully built a project using Visual Studio 2015 + FWH1604 + Harbour, after a minor modifications to the instructions provided here (for example the windows libraries are in "C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86").

It is working just fine so far, I have been using MSVC 2013+Fivewin1602+harbour and changing to the new versión of MSVC2015 was easy.

Thanks to all the team who made this possible and I would like to encourage other members of the community to give this IDE a try.

Best regards

Re: Working With Visual Studio 2015 and FWH / Harbour

Posted: Tue May 17, 2016 5:55 pm
by Antonio Linares
Mario,

Many thanks for your feedback.

If you follow these instructions:
http://forums.fivetechsupport.com/viewt ... 17&t=32390
then you will have syntax coloring for PRGs and CHs too

Re: Working With Visual Studio 2015 and FWH / Harbour

Posted: Tue May 17, 2016 8:53 pm
by TimStone
Antonio,

Recently you mentioned you had the Visual Studio Resource Editor working with projects. I tried to open it up on my .rc file and it tells me one of the default headers has a symbol too large.

What did you do to setup yours ?

Tim

Re: Working With Visual Studio 2015 and FWH / Harbour

Posted: Tue May 17, 2016 9:24 pm
by Antonio Linares
Tim,

Try to remove windows.h from the resource file

Re: Working With Visual Studio 2015 and FWH / Harbour

Posted: Tue May 17, 2016 10:11 pm
by TimStone
THE RESOURCE EDITOR

Most of my resources are in an .rc file that was started in the old days with Borland controls but has evolved away from them over the years. Now that I have my application building cleanly using Visual Studio 2015 Community, and also have the editor working with highlighting, it would sure be nice to get the resource editor to work.

The problem is with the INCLUDE .h files. I currently have 3 files that I use:
windows.h
commctrl.h
richedit.h

If I try to open the .rc file in the IDE resource editor, it rebels against prsht.h which is linked in using commctrl.h Since I only use 2 defines from that file, I easily put them in the .rc file and eliminate it. Then I can actually load the .rc file.

The problem comes when making any change. Once that is done, Visual Studio wants to modify the .rc structure before saving it. Most of it is fine, but the problem is that it creates a new include file, resource.h, and eliminates the others. As a result, the file is unable to identify some standard definitions, ie. WS_POPUP, and then it fails to save, and the application cannot be built.

Has anyone else worked with the VS Resource editor ? What files do we need to include ( .h ) so it will be useable, and able to compile properly >

Thanks for your insights.

Tim

Re: Working With Visual Studio 2015 and FWH / Harbour

Posted: Wed May 18, 2016 1:46 pm
by mariordzmej
Antonio, I followed the instruction on the other thread and I got the colors working.

Thanks for the tip.

Re: Working With Visual Studio 2015 and FWH / Harbour

Posted: Wed May 18, 2016 8:44 pm
by TimStone
Please see my modified item up two messages on this thread.

Re: Working With Visual Studio 2015 and FWH / Harbour

Posted: Wed Jun 01, 2016 1:30 pm
by vmarimon
Hi to all, i get many errors something like this:

Code: Select all

Gravedad    Código Descripción    Proyecto    Archivo Línea  Estado de supresión
Error   LNK2019 símbolo externo _GdipAlloc@4 sin resolver al que se hace referencia en la función "public: static void * __cdecl Gdiplus::GdiplusBase::operator new(unsigned int)" (??2GdiplusBase@Gdiplus@@SAPAXI@Z) Win32Project1   C:\Users\vmarimon\Documents\Visual Studio 2015\Projects\Win32Project1\Win32Project1\FiveHC32.lib(GDIPFWH.obj)   1   
 

Maybe any lib more to add to project?

Many Thx.

P.D: FiveWin 1604

Re: Working With Visual Studio 2015 and FWH / Harbour

Posted: Wed Jun 01, 2016 2:08 pm
by vmarimon
I autoanswer-me-.....


gdi32.dll and gdiplus.dll needs to add to project....

runs perfectly on fivewin 1604+VS2015.