Giter Club home page Giter Club logo

vcsamples's Introduction

VCSamples

This repo contains C++ samples that shipped with earlier versions of Visual Studio, or that are no longer hosted on code.msdn.microsoft.com. You'll find all the samples just like they were in 2008, 2010, 2012, and 2015.

For more C++ samples, see the Microsoft Docs Code samples page. Other sources include:

Universal Windows Platform (UWP) app samples repo.

DirectX-Graphics-Samples repo.

Microsoft Xbox Advanced Technology Group Xbox-ATG-Samples repo.

Samples for C++/WinRT

Code Migration

We are migrating samples to VC++ 2015 and VC++2017.

See the Wiki for more information about C++ Migration code.

See the Porting and upgrading guide

Contribute

We accept contributions on these samples, such as migrating them to a newer version, modernizing the source code, or adding new samples.

Use Issues and make pull requests to submit new migration cases, fixes or suggestions.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ. Or, contact [email protected] with any additional questions or comments.

License

Code licensed under the MIT License.

vcsamples's People

Contributors

ericmitt avatar gregg-miskelly avatar magol avatar maxmarkin avatar msftgits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vcsamples's Issues

Question

Not really an issue, but rather a clarification need.

In the sample, you open an Environment handle, and then a Connection handle and finally Statement handles. Can the Environment handle manage multiple Connections, or do I have to open an Environment for each Connection needed

Readme's require migration to markdown

The readme docs are currently in the form of Word flavored HTML, these should be migrated to markdown to display properly on github. Sadly they don't seem to be compatible with an online converter (hence no pull request).

CSummInfo::IncrRevNum fails in UNICODE builds (file summinfo.cpp)

In Unicode builds of CSummInfo::IncrRevNum() the update TCHAR (which is wchar_t for Unicde) buffer gets written as type VT_LPSTR, which always expects a char*

BOOL CSummInfo::IncrRevNum() { ULONG count; _stscanf_s((LPCTSTR)GetRevNum(), _T("%lu"), &count); count++; TCHAR buff[20]; _stprintf_s(buff, 20, _T("%lu"), count); return m_pSection->Set(PIDSI_REVNUMBER, (void*)buff, VT_LPSTR); }

this can be fixed be replacing the last line of the function by

`return m_pSection->Set(PID_REVNUMBER, (void*)tcstocs(buff), VT_LPSTR);`

NB: tcstocs is defined at the top of the summinfo.cpp

odbcsql.cpp when compiled in VS2017 says that it is not a valid Win32 Application.

test project.zip

Attached is an fresh project file and the only modification from the original is that I want it to load the information always from the odbc.dsn file. Unless I am not referencing an DLL file but yet it still compiles and does not add it to the Import Address Table cuasing this issue.

Also in Release/x86 you can find an precompiled exe that you can see reproduces this issue.

Edit: It seems that somehow /DLL was set in the exe file cuasing this, and that it wont automatically load the DSN file I wanted to load.

BUG: the expression value of (DBTYPE_WSTR & DBTYPE_BYREF) is 0

Use | operator instead of &

else if( dbtype == (DBTYPE_WSTR & DBTYPE_BYREF) )

else if( dbtype == (DBTYPE_STR & DBTYPE_BYREF) )

else if( dbtype == (DBTYPE_BYTES & DBTYPE_BYREF) )

Getting compiler errors with latest C++ compiler (VS2019 Preview 3.1)

Hi,

I downloaded the ATLCollections sample and tried to compile it using Visual Studio 2019 Preview 3.1. It works fine when selecting default settings in "Project Settings - General - C++ Language Standard" setting.
When selecting "Preview - Features from the Latest C++ Working Draft (/std:c++latest)" as the C++ Language Standard, I get the following compiler errors:

1>------ Build started: Project: ATLCollections, Configuration: Debug Win32 ------
1>StdAfx.cpp
1>ATLCollections.cpp
1>E:\Users\f.stapenhorst\Downloads\ATLCollections\Reuse\VCUE_Collection.h(160,17): error C3861: 'm_coll': identifier not found
1>E:\Users\f.stapenhorst\Downloads\ATLCollections\Reuse\VCUE_Collection.h(168): message : see reference to class template instantiation 'VCUE::ICollectionOnSTLCopyImpl<T,CollType,ItemType,CopyItem,EnumType,Holder>' being compiled
1>MapCollection.cpp
1>E:\Users\f.stapenhorst\Downloads\ATLCollections\Reuse\VCUE_Collection.h(160,17): error C3861: 'm_coll': identifier not found
1>E:\Users\f.stapenhorst\Downloads\ATLCollections\Reuse\VCUE_Collection.h(168): message : see reference to class template instantiation 'VCUE::ICollectionOnSTLCopyImpl<T,CollType,ItemType,CopyItem,EnumType,Holder>' being compiled
1>StringCollection.cpp

Any idea what the issue might be?

repro guide

You could add a paragraph about how to actually get to a minimal repro source file.

I've personally used https://github.com/CyberShadow/DustMite with --split "*.{c,cpp,cxx,h,hpp}:d" successfully for clang and msvc bug reports.
And my VS plugin to quickly get preprocessed source code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.