• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

My first steps with C++

Started by Patrice Terrier, July 30, 2010, 10:01:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Patrice Terrier

Written my first VS2010 64-bit flat API DLL, using WinDev to test it.

So far the 64-bit version is only 14% larger than the 32-bit, but the test DLL is very basic, and does only simple long addition returning the result to the calling application.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

I have been able to match successfully 32 and 64-bit code inside of a same project, using private messages based on the RegisterWindowMessage API to communicate between the different modules in real time.

:)
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Anand Kumar

Patrice,

You might consider using Pipes.  The trouble with messages is that if you would like to send text or structures from 32 to 64 bit then there might be access issues.  Pipes are far easier to work with in such situations.


Patrice Terrier

#63
Anand

I am already sending all my data as byte, thus i don't know if that would make a big difference.
Socket or memory mapped file could be used as well, but using private message is so easy to use once you know the handle of the target window.

For those interrested here is a good link on this topic:
http://www.codeproject.com/Articles/13724/Windows-IPC
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Anand Kumar

Patrice,

The choice of pipes or any other IPC mechanisms depends on the amount of data that you would like to transfer and  the size of the data chunks that you can send across in a single transmission.  Moreover, messages can be intercepted.

With pipes, two way communication is possible and the amount of data that you can send is quite reasonable (send the length of the data first and then the content). You can include authentication mechanisms to validate the sessions (trusted connectivity). 

Anand

Patrice Terrier

Currently i am still using C++ from VS2010 Pro, and i would like to know if i should move to VS2013.

What do you think are the most significative new features ?
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Jim Dunn

Quote from: Patrice Terrier on October 26, 2013, 02:59:19 PM
Currently i am still using C++ from VS2010 Pro, and i would like to know if i should move to VS2013.

What do you think are the most significative new features ?

http://www.hanselman.com/blog/SCREENCASTSWhatsNewInVisualStudio2013LearnOverLunch.aspx

Patrice Terrier

Jim--

Thanks, but the link refers mostly to web programming.
I want to know what is new for the core C/C++ 64-bit compiler (because there are many parts of VS that i do not care about for the moment).
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com


Patrice Terrier

Brice--

Thank you.

I will wait to upgrade until the official release.

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

James C. Fuller

Patrice,
  Official release??
I think it has been released officially.

http://www.microsoft.com/visualstudio/eng/downloads#d-2013-editions

James

Mike Stefanik

#71
VS2013 was released last week, but you have to be an MSDN subscriber to download it. The official launch date is in a few weeks, on November 13th. If you do plan on upgrading, one thing that you should keep in mind is that you plan on continuing to support Windows XP, you need to make sure that your projects use the right toolset. In your project properties (General section) you'll see a field named Project Toolset. In VS2012 and VS2013, you'll see something like the following:

Visual Studio 2012 (v110)
Visual Studio 2012 - Windows XP (v110_xp)
Visual Studio 2010 (v100)
Visual Studio 2008 (v90)

If you load up your existing VS2010 projects, the toolset should remain "Visual Studio 2010 (v100)" and that's fine. But if you create new projects, or want to take advantage of new compiler features, you want to make sure that you use the "Visual Studio 2012 - Windows XP (v110_xp)" toolset. If your project uses the "Visual Studio 2012 (v110)" toolset, your DLLs will not load on Windows XP systems because the libraries that they link with will make calls to kernel functions that only exist in Windows Vista and later platforms.

Edit: It looks like you can download VS2013 to try it out, but you can't actually purchase a license yet unless you buy an MSDN subscription. If you go to the Microsoft Store to buy a Visual Studio license, it's still for VS2012.
Mike Stefanik
sockettools.com

Patrice Terrier

QuoteIf you go to the Microsoft Store to buy a Visual Studio license, it's still for VS2012.
Yes, same here, the official VS2013 Pro is not yet available without a MSDN subscription, have to wait the begining of 2014.

By the way, i have another question, related to Unicode.

All my GDImage 64-bit is now unicode, however when creating bitmapped font for OpenGL i still need to use ANSI char.
Thus my question is what is the best method to convert from WCHAR to char, currently i am using wcstombs_s is that the best one?
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Mike Stefanik

Quote from: Patrice Terrier on October 26, 2013, 08:19:31 PM
Thus my question is what is the best method to convert from WCHAR to char, currently i am using wcstombs_s is that the best one?

That's fine. Internally, the CRT function calls _wcstombs_l_helper which is really just a wrapper around the WideCharToMultiByte function, along with some additional checks for the "C" locale and whatever the current locale codepage is.
Mike Stefanik
sockettools.com

Jim Dunn

Quote... you plan on continuing to support Windows XP, you need to ...

I know I *always* get shot down when I mention this, but XP is going end of like in April 2014.  I'm sure there will be a lot of people try to keep using it, but without security updates, it would not be wise.

Ok, go ahead... line up and tell me about all the clients you have that are still using MSDOS.