Quantcast
Channel: Visual C forum
Viewing all 15302 articles
Browse latest View live

Visual Studio 2015: std::memset() returns char*, takes no parameters.

$
0
0

I have two screenshots showing this error. I can't compile.

Why is it not the void* memset(ptr, int, size_t) version that I saw everywhere else?


How do I know if a binary tree is "lefty" in O(n) time complexity

$
0
0

A binary tree is "lefty", only if the height of the left subtree is not less than the height of the right subtree, and both left and right subtrees are also "lefty" too.

In other words, the tree and all subtrees must be "lefty", namely in tree and in every subtree, the height of the left subtree shouldnot be less than the height of the right subtree.


Changed the COM signatures....using ildasm.....

$
0
0

Hi,

I have a .exe COM which I used in .NET but some signatures got changed....so I opened it with ildasm and changed the signatures so that it should return something from the function....This is the error I'm getting now....

The runtime has encountered a fatal error. The address of the error was at 0x79e8aff6, on thread 0xb4. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

Any Ideas....

Thanks,

Harsimrat

Static library for ARM architechture

$
0
0
We have a Static Library that needs to be built for ARM. It is not clear how to do this in VS 2015. A new static library project only has x86 and x64 targets. Is this possible in 2015?

error MSB6003 Problem in VS2013

$
0
0

I always get the following error when trying to build my application with VS2013.  And this is a very recent problem, as everything was perfectly fine till last week! I have no idea what changed in my (corporate) PC, and from the error itself I have no idea what is actually going wrong ...

Can somebody hint me in the good direction, please?

error MSB6003: The specified task executable "cmd.exe" could not be run. The process cannot access the file 'C:\Temp\tmp60aa617f8e9b4e8da3510d9a445d15e5.cmd' because it is being used by another process.    

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets (170,5)

    ....
    <CustomBuild
      Sources                     ="@(CustomBuild)"
      BuildSuffix                 ="$(_BuildSuffix)"
      TrackerLogDirectory         ="%(CustomBuild.TrackerLogDirectory)"
      MinimalRebuildFromTracking  ="%(CustomBuild.MinimalRebuildFromTracking)"
      TLogReadFiles               ="@(CustomBuildTLogReadFiles)"
      TLogWriteFiles              ="@(CustomBuildTLogWriteFiles)"
      TrackFileAccess             ="false"
      ToolArchitecture            ="$(CustomBuildToolArchitecture)"
      TrackerFrameworkPath        ="$(CustomBuildTrackerFrameworkPath)"
      TrackerSdkPath              ="$(CustomBuildTrackerSdkPath)"
      AcceptableNonZeroExitCodes  ="%(CustomBuild.AcceptableNonZeroExitCodes)"
      >
    </CustomBuild>
    ....

Linking Error : Error LNK2022 metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (_nlsversioninfo):

$
0
0

We have converted VS2010 application into VS2015, application use static library(also converted in VS2015), 
Both aaplication is managed c++/clr and also switched target V140 in both the application.
After converting application I am getting following error.

ErrorLNK2022 metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (_nlsversioninfo): (0x02000602).ProjectName
LibraryName.lib(LibraryName.obj)

I have checked both projects and it use .net version 4.0
I had looked at the following link but it did not help.

and other links related to this  Error LNK2022 metadata operation failed (8013118D)on different site.

Am I missing some settings here in projects ?

Help please !!



Thanks.



empty wdm driver

$
0
0

Hello all.

So I have VS 2013.

I want to make a WMD driver,so I go new ->project->WMD->empty wmd driver and just for a test I write:

#include <wdm.h>

NTSTATUS DriverEntry(PDRIVER_OBJECT object, PUNICODE_STRING registryPath)
{
   return STATUS_SUCCESS;
}

Error    1    error : File not found: blah blah blah... drivertest.sys

And intellisense says:  IntelliSense: #error directive: "No target architecture defined"

Thanks.





what are the effects on system when a application starts a timer and dosent kill

$
0
0

I have a application which has 4 normal timers and 3 multimedia timers.

Multimedia timers are used for background process and normal timers are used for display.

I want to know what happens to system message queue in long run if timer is started but never killed.

For example, application is running for more than few weeks continuously. Will it cause some unpredictable problems.


MFC Ribbon editor crash

$
0
0

Visual studio 2015 CP 2 crashes in the MFC ribbon editor whenever you try to insert a group control  into a panel with Justify Columns set to true, without saving any changes you may have made.  Running Windows 7 SP2 Enterprise, VS details below. Also, zero documentation on group controls, and very little documentation on this editor.  Needs more work, more documentation, and more testing.

Microsoft Visual Studio Professional 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01055

Installed Version: Professional

Visual Basic 2015   00325-60000-80195-AA437
Microsoft Visual Basic 2015

Visual C# 2015   00325-60000-80195-AA437
Microsoft Visual C# 2015

Visual C++ 2015   00325-60000-80195-AA437
Microsoft Visual C++ 2015

Application Insights Tools for Visual Studio Package   5.2.60328.3
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11106.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.7
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

InstallShield Limited Edition   
InstallShield. For more information visit the Flexera Software website at <http://www.FlexeraSoftware.com>. Copyright © 2015 Flexera Software LLC. All Rights Reserved.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.4.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.60311.1
Microsoft SQL Server Data Tools

TypeScript   1.8.30.0
TypeScript tools for Visual Studio

Visual Assist   
For more information about Visual Assist, see the Whole Tomato Software website at http://www.WholeTomato.com. Copyright (c) 1997-2016 Whole Tomato Software, Inc.

Visual Commander   2.3
For more information about Visual Commander, see the website at https://vlasovstudio.com/visual-commander/.
Copyright (c) 2013-2015 Vlasov Studio.

Visual Studio Tools for Universal Windows Apps   14.0.24720.00
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

VS 2015 C++/Cli Error C2976 and C3699

$
0
0

Hi today i load my project (writing  VS2012 C++/Cli) to VS 2015 ent  but in vs2015 i get 2 errors:

ErrorC2976'std::array': too few template arguments

ErrorC3699'^': cannot use this indirection on type 'std::array'

in VS2012 working but in vs2015 no. here my code:

 ref  struct item
 {
     int ItemNumber;
     String^ Name;
     array<Byte>^  img; //Error C2976 and Error C3699
};
how to fix? ty

(Solved)Sending messages to a text box problem.

$
0
0

Hi,

  I am a beginner in Visual C++, and I am facing a problem. I have a sample code, and I created an edit box, with an ID "IDC_EDIT1". I want to display a message on it, and I know there are two ways to do so, but I have problem to both.

Way 1 -- SetDlgItemText
I use the line SetDlgItemText ( ***, IDC_EDIT1, _T("Hello World"); I know *** is a HWND type thing, but I do not where to get its value and replace it with ***. I guess it is something like an identification to the dialogue? But I totally have no idea of what the value for it.

Way 2 -- Link it to a variable
I gave it a variable called "text". Then I use the lines,
test = "Hello"
UpdateData(False);
Then two errors show up. One, it said my test is not initialized; Two, it does not know what UpdateData is. I think I need to include some library or whatever so it recognizes UpdateData?
What is it about for the initialization problem is? I used the key F12 to trace to a line where this appears "CString text;", then I changed it into "CString text("123");", but the same error remains...

Raymond


VS2015 Error code : Error_C2976_'std::array': too few template arguments' along with C3699,2726,1903

$
0
0
                  

Hi,

I am facing this issue  Error Code 2976 and 3699when I migrate my project from VS2012 to VS2016.

Below is the line of code:

array<String^>^ requestArgs = nullptr;
       if (responseStr != "")
       {
        requestArgs = responseStr->Split(gcnew array<Char> { '|' });
       }

Please Assist Asap.

Help please with the Spell Checking API

$
0
0

I have a number of questions about the spell-checking API that was added in the Windows 8 SDK.

My application is built using Visual Studio 2010 with C++ (not managed) and MFC.  It currently supports Vista or later.  I want to add spell checking using the Windows 8 SDK spell checking API.  My idea is that I will say that my app runs under Vista and Windows 7, but that the spell checking feature requires Windows 8 or later.  Is that possible?  If so, how?  To try out the spell checking API (under Windows 10), I had to use one of the following bodges in my code:

#define MIN_NTDDI_VERSION NTDDI_WIN8
#include “spellcheck.h”

or

#define MIN_SPELLING_NTDDI 0

#include “spellcheck.h”


Both bodges worked.  The first one meant ignoring a warning message.  But presumably neither of these would work if I tried to run the same code under Vista or Windows 7?  Presumably the ‘right’ way to do it would be to define NTDDI_VERSION as NTDDI_WIN8 for my whole application – is that right?  But if I did that, presumably my code would then not run at all under Vista or Windows 7?  For that matter, if I simply build using the Windows 8 SDK, does that prevent my app from running under Vista?

Do I need to more the whole spell-checking module into a DLL?  Would even that work?

To try out the spell checking API under Windows 10, incidentally, I followed the instructions in https://blogs.msdn.microsoft.com/vcblog/2012/03/25/using-the-windows-software-development-kit-sdk-for-windows-8-consumer-preview-with-visual-studio-2010/.

One other question:  I used the ISpellCheckerFactory::IsSupported method to test for supported languages.  I tried using “en-gb” and “en-us” and to my surprise, both appeared to be supported.  Which languages should I expect the spelling api to support?   Is en-us always supported everywhere?  They’re not just supported because I have MS Word are they?

I want to use the spell checking API with CRichEditCtrl.  Is there an example of how to do this anywhere?  I’d like spell checking to run in the background – any suggestions about how to go about this?  Presumably one doesn’t want to spell check an entire document (which could be very big) in one go.  It might cause unacceptable delays.  But then how should one go about it?

Finally – if a user wants certain words to be permanently ignored, how should I handle that?  I know I can call the ISpellChecker::Ignore method, but that is for the current session only.  Would it make more sense to keep my own list of ignored words?  That seems a bit inefficient given that presumably I will ask the API to check a whole section of text, and I don’t want to have to keep ‘snipping out’ words that I know are OK?  Should I just ignore any words that it tells me about if there on my own list of words to ignore?  Is there a better way? 

Sorry – lots of questions.  But all help very much appreciated. 


Simon

Is multiple CFrameWndEx with Ribbons allowed for a MFC application?

$
0
0

Hi,

Our teams is working on a SDI MFC application. Our mainframe have one Ribbon, and we are trying to adopt ribbons to our additional frame windows.

After we change their base class from CFrameWnd to CFrameWndEx, they starts doing a registry read and write during creation and destruction which destroy our registry read/write logic (values changed got reset to the value in the registry). The other problem is the Ribbons seems to share a same registry location, e.g. once a ribbon is set to be minimized, the next time you open the application all the ribbons will get minimized.

Are there recommended ways to implement multiple CFrameWndEx with Ribbons to avoid those problems, or it's a bad practice to do that?

Thanks!

How do i decode using C++ ?

$
0
0

How do i decode the following encoded Registry value and extract using C or C++ ? 


JSON Example Issue with C++ REST SDK

$
0
0

I work on an MFC Doc/View application that is over 16 years old, so this JSON class is all new to me.  I have not worked with vectors or templates very much as MFC hides much of that.  I have seen this code in multiple places related to the C++ REST SDK, but when I copy it into the code I am working on the .cbegin) and .cend() are not understood.

    for (auto iterInner = jsonValue.cbegin(); iterInner != jsonValue.cend(); ++iterInner)
    {
      const json::value&propertyName = iterInner->first;
      const json::value&propertyValue = iterInner->second;

      /// Do stuff here

    }

The code I have added is correctly calling the REST API - status of 200 - and I have valid JSON returned.  If I call jsonValue.serialize() the resulting data is accurate.  I opened the json.h header file and I see that cbegin and cend are defined in the array class.

I can tokenize the string, but I would rather learn the JSON methods for parsing the data from the response.  The partial response is shown below.    Am I even trying to parse it correctly?

{

   "HasPromoSelected": true,

   "SelectedPromo": {

      "PromoKey": 21,

      "PromoName": "Test Promo",

     "Disbursements":[{

          "CostToCustomer":0,

          "DisbursementType": {

              "Description": "Test Card",

             "Name":"Test Card"

          },

         "ValueToCustomer":50}],

  }

}

Thank you in advance for your time.  I do appreciate the assistance.


Dumb question about upgrading from VS2008 to VS2013 - property sheet order

$
0
0

I just upgraded to VS2013 from VS2008.  I then opened one of my old projects and of course VS2013 automatically "upgraded" it.  But, I got a bunch of warnings about things being out of order with respect to the property sheets, of which I am only a little familiar.  The errors were like this:

All user macros reported below for configuration 'Debug|Win32' are used before their definition, which can cause undesirable build results; this is not supported in this release. You can resolve this by changing the inclusion order of the consuming property sheets and making sure they come after the property sheets defining the user macros.

followed by...

MSB4211: C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets (86,5); The property "TargetPlatformIdentifier" is being set to a value for the first time, but it was already consumed at "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Common.props (103,5)".

However, I cannot figure out how to "change the inclusion order of the consuming property sheets".  I have searched high and low but no joy.  I can't even see where the files mentioned are part of my project.  Can you help me understand what is going on?

Thanks very much!


Parse EBCDIC file line by line

$
0
0

Hi,

I am trying to parse an EBCDIC file line by line, appending each line to a string object using push_back. The issue is that my function seems to not be processing all lines of the file. It does not ever reach the end of the file and stops somewhere in between:

 int* AFP_Funcs::ParseAFP(char* AFPfile)
    {
        std::ifstream file(AFPfile);
		std::string str;
		std::string file_contents;
		std::string strTOhex;
		while (std::getline(file, str))
		{
		  file_contents += str;
		  file_contents.push_back('\n');
		}
		strTOhex = string_to_hex(file_contents);
		//getchar();
		return 0;
    }

Once I have parsed the entire file, I would like to then convert every character returned to hexadecimal with my string_to_hex function which is working, but I noticed that the entire file is not parsed.

I would like to attach the file in question, however there seems to not be a way to on this forum. Maybe in PM form.

Thanks.

Why is DirectXMath a step backwards from being able to do anything efficiently?

$
0
0

Case in point:

D3DXVECTOR3 out,temp,blank(0,0,0);
D3DXVec3Subtract(&temp,&in,&p->View);


XMFLOAT3 out,temp,blank(0,0,0); XMVector aVector1 = XMLoadFloat3(in);

XMVector aVector2 = XMLoadFloat3(p->View); VMVector temp2 = XMVectorSubtract(aVector1, aVector2);

XmStoreFloat3(temp, temp2);

That's just stupid.. stupid. We are going backwards and this is the 'new standard'? I can't write 2 lines without having to look up something. 2 lines becomes 6, 10 becomes like 30..

Why does XMStoreFloat3 exist, and why doesn't it even work the same as XMLoadFloat3 with a return value? It's just mixing random garbage.

Directxmath.h is garbage. Currently reverting back to D3DX10math or making my own math structs.

Discuss.






My MFC Application will blocking when Alt released( Windows 10 RS1 14367), Who can help me

$
0
0

Download URL: http://x-studio365.com/en-us

Software technology architecture: MFC + cocos2d-x, The child window 'cocos2d-x rendering" is create on subthread and has own message loop.

Steps: When focus on cocos2d-x rendering window, press the Alt, and after release (this process do not make any other operations) program will blocking.

details: 10586 version: after pressing Alt release, only the child thread rendering window will be stuck, do any other operations, such as mouse clicks, according to other keys, restore the child thread windo

Computer configuration:

Laptop,   lenovo Y700 CPU: Intel i7 6700 hq GPU: Intel HD 530

Desktop: CPU: Intel I7 4700 GPU: Intel HD 460


Viewing all 15302 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>