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

Flag to detect V140_XP binary

$
0
0

What is/are the flag(s) in the image that determine whether a image (*.DLL, *.EXE) are compiled/linked for V140_XP Windows operations?   Seems like a 4 byte (DWORD?) difference.   I would like update my file version/properties reporting tools since we might now have to have two sets of compiled code, one for legacy XP/2003 customers and one for newer OS only machines.  Adds complication in a few areas and I would like to reduce support-related issues.

Thanks.


Hector Santos, CTO Santronics Software, Inc. http://www.santronics.com


C program in Visual Studio 2015: _wfindfirsti64() / _wfindnexti64() returns 'ä' in file name as 'õ'

$
0
0

I'm using Visual Studio Community 2015 on Windows 10 x64.

C code (not C++):

#define _CRT_SECURE_NO_WARNINGS

#include <wchar.h>    // wprintf()
#include <io.h>        // _wfindfirsti64(), _wfindnexti64(), _findclose()
#include <stdlib.h>    // _MAX_PATH = 260

int wmain(int argc, wchar_t *argv[])
{
struct _wfinddatai64_t fi;
long ffh = _wfindfirsti64(L"*", &fi);
if (ffh == -1)
    return 1;
do
    if ((fi.attrib & _A_SUBDIR) == 0)
        wprintf(L"%s\n", fi.name);
while (_wfindnexti64(ffh, &fi) != -1);
_findclose(ffh);
return 0;
}//end wmain()
dir /b output:
Arvo Pärt.txt
ff.exe
ff.ilk
ff.pdb
My program output:
Arvo Põrt.txt
ff.exe
ff.ilk
ff.pdb

How to get window size

$
0
0

In my VC++ MFC CAD program, I have a device context (CDC*). How do I determine the current size (extent) of the window? So that I can skip the objects that I am drawing that are outside of my viewing window.

Thank you,

 

Is it possible to get a version of Visual Studio for free?

$
0
0

M trying to learn programming, and want to learn VC++.

I have some basic knowledge of C++ (but cannot develop Windows Programs, only console programs that run in a DOS-like window). I want to learn some real graphical programming. Is it possible to get a version of Visual Studio for free (legal)? It's purely for learning to program, not for commercial purposes.

If yes, please give me a direct download link/ instructions on how to download and activate.

I'd also appreciate if someone can point to some beginner-friendly tutorials on how to program on VC++.

MODERATORS: This is my first post in this community. Feel free to move the post to the appropriate category if I'm posting in a wrong forum. Thank you.

Help starting up!

$
0
0

Hello Community!

Im starting to program again and found a project I want to complete. I believe its pretty easy but I have forgotten libraries and the use of some tools using VS. I am not asking for someone to do this for me but someone to refer me to useful information to help me complete the project. I am a fast learner and like going straight to the point. Here is a brief description of what my program should do: 

- Enter the directory path and filename to an input file of any type
- Enter the directory path to locate the output file
- Enter a pass phrase
- Select an encryption, or a decryption, operation on the input file
- Results from encryption/decryption operation should be stored at the output file location 

Please share any link to useful libraries, functions descriptions and other tools in VS that you guys think could help me.

Thanks :) 

Enabling C4311 on VS2010 x64 builds without use of /Wp64?

$
0
0

From SO:

We got hit by a bug that would have been found if C4311 had been active:

Compiler Warning (level 1) C4311 [VS.100]

'variable' : pointer truncation from 'type' to 'type'

This warning detects 64-bit portability issues. For example, if code is compiled on a 64-bit platform, the value of a pointer (64 bits) will be truncated if it is assigned to an int (32 bits).

This warning is only issued when /Wp64 is used. [so true] See /Wp64 for more information.

Unfortunately it seems (see below for background) that to get C4311 Imust provide /Wp64to my x64 build -- which results in warning D9035: option 'Wp64' has been deprecated (...) for every project in my solution (extremely annoying).

So is there a way to either:

  • Enable C4311 without /Wp64 on VS2010?
  • or silence D9035?

Background

The MSDN docs for /Wp64 seem to be totally off for VS2010 in that C4311 is only ever active if you specify/Wp64in the x64(!!) build.

/Wp64 (Detect 64-Bit Portability Issues) [VS.100]

By default, the /Wp64 compiler option is off in the Visual C++ 32-bit compiler andon in the Visual C++ 64-bit compiler. [seem to be wrong]

... Instead of using this option and keyword to detect 64-bit portability issues, use a Visual C++ compiler that targets a 64-bit platform. ...[nopes, doesn't work for me]

... you can just disable /Wp64 in your 32-bit compilations because the 64-bit compiler will detect all issues. ...[I'm fine with disabling for Win32, but the x64 compiler just won't catch any C42311 without me telling him/Wp64]

Another user confirms this @Why is /Wp64 deprecated?:

/Wp64 on 64-bit builds is extremely useful. The documentation (http://msdn.microsoft.com/en-us/library/vstudio/yt4xw8fh.aspx) claims that it is on by default in 64-bit builds, but this is not true. Compiler warnings C4311 and C4312 are only emitted if /Wp64 is explicitly set. Those two warnings indicate when a 32-bit value is put into a pointer, or vice-versa.

How to enable tooltips on CToolBar in CWnd?

$
0
0

The Visual C++ app's main window is CWnd-based (i e, derived directly from CWnd). In this window, I create a toolbar:

        pFitToolBar = new CFitToolBar;
        pFitToolBar->CreateEx(this, TBSTYLE_TOOLTIPS, WS_VISIBLE | WS_CHILD | WS_BORDER | CBRS_TOOLTIPS, CRect(0, 0, 0, 0), IDR_FitToolBar);
        pFitToolBar->MoveWindow(ToolBar_Left, ToolBar_Top, ToolBarW - 9, ToolBarH - 3);
        pFitToolBar->LoadToolBar(IDR_FitToolBar);
        pFitToolBar->SetBarStyle(CBRS_TOOLTIPS | CBRS_ALIGN_TOP | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT);

This works as expected: the toolbar is created, visible, and the buttons send command messages.

I have used the resource editor to set a text for tooltip for every button in the toolbar, in Properties/Prompt, for example, "I prompt\nShow information". There is no status line in the main window.

No tooltips appear, though, when I pass the mouse over the toolbar buttons. What do I need to do to get the tooltips to show?

64-bit Windows 7 Pro; VS2015 update 2

Application crash on deleting the std::set instance

$
0
0

Hi,

During fuzz testing of our application, crash is seen occasionally on set<> instance deletion. Below is the sample call stack:

099dc920 07238507 00000008 00000000 07a0a5c4 myDll!std::_Tree<std::_Tset_traits<unsigned long,std::less<unsigned long>,std::allocator<unsigned long>,0> >::_Erase+0x9 [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xtree @ 1167]
099dc940 07238748 099dc964 0798b308 00000000 myDll!std::_Tree<std::_Tset_traits<unsigned long,std::less<unsigned long>,std::allocator<unsigned long>,0> >::erase+0x57 [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xtree @ 937]
099dc97c 0723881c 94241a3c 07a0a5c0 07a0a5c0 myDll!std::_Tree<std::_Tset_traits<unsigned long,std::less<unsigned long>,std::allocator<unsigned long>,0> >::~_Tree<std::_Tset_traits<unsigned long,std::less<unsigned long>,std::allocator<unsigned long>,0> >+0x48 [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xtree @ 540]
099dc9a0 072388bb 083ebdd8 099dca18 0722f3ea myDll!myClass::~myClass+0x5c 

099dc9ac 0722f3ea 00000001 94241984 00000000 myDll!myClass::`scalar deleting destructor'+0xb

The issue happens only during fuzz test and occasionally. 

We figured out that the memory allocated by the set<> constructor has been overwritten but not able to figure out who is corrupting the memory. [As the issue happens sporadically and there is a limitation of only 4 active breakpoints]

Our myObject object has the VMT for myClass stored at offset 0x00000000 of the instance, but the embedded set<> object inside the myClass does not, because it was not allocated/constructed with operator new, but instead, as an embedded field. 

Because our myClass destructor doesn't zap its (set<>) memory, is it possible that the allocations made inside the embedded set<> object in the myClass object body could be lost by an inappropriate call to the myClass destructor via the VMT..?

During fuzz test, our object is created and deleted in each thread. When the same memory is used for the second time, crash is seen. For Ex:

Creating myObject=82e59f0 set<>=82c8c60 by thrd=c54

Delete myObject=82e59f0 set<>=82c8c60 by thrd=c54

Creating myObject=82e59f0 set<>=84a30f8 by thrd=14c8

Delete myObject=82e59f0 set<>=84a30f8 by thrd=14c8

Could you please suggest what could be the root cause for the crash.?

As there is change in xtree between VS 9.0 and VS 10.0, is the crash on ~_Tree, a known bug in VS 9.0..?

Thanks in advance.



Calculator help, MFC

$
0
0

So I am making a calculator in C++ and I am running into problems, I have just started c++ but have a good grasp of how coding work, I have done a lot of coding previous to this but c++ is just a whole different ball game.

So i have a dialog that has buttons inside of it and i have them all set up in the code for OnBnClicked.

I also have that when yo press any of the number buttons that they show up in the Edit Control window which is great.

But say if i want to ADD two different numbers together what code can i add to the OnBnClickedButtonAdd and OnBnClickedButtonEquals.

I also have a variables set up for catching Sum1 and Sum2(m_NumSet1 & m_NumSet2) so they can be Subtracted, Multiplied or what ever by each other.

If someone can help me with the code to place into the OnBnClickedButtonAdd and OnBnClickedButtonEquals so i can get a simple sum to work, I will try figure out how to do it for the rest of the of Multiply and all that good stuff.

Hope someone can help, Thanks in advance.

-SD2020

LNK1346 Error Signing Assembly

$
0
0

Error message from Visual Studio 2015 when building my application in Release mode.

LNK1346 ALINK operation failed (80040436) : Error signing assembly -- The process cannot access the file because it is being used by another process.  : failed to close the assembly module

The assembly that can not be signed is a Visual C++ wrapper around a native C++ dll and is accessed by a Visual Basic application. 

The assembly builds and is signed and runs in Debug mode. 

Current workarounds: To solve the problem I usual restart VS if this fails restarting my computer usual work.  On some cases the only thing that always works is to download the solution from TFS and overwrite the local version.

How to profile compile time issues?

$
0
0

I'm looking for ideas on how to profile system resource utilization to determine the root cause of long C++ compile times .

I'm trying to figure out where it's spending all its time.  My CPU usage seems to be low 20% spiking up to 60%.  And disk usage seems to be low 5% spiking up to 30%.  I was expecting one or the other to be railed but neither seems to be maxed out.

What's the right way to determine what the bottleneck is?

Obviously I've employed many smart techniques to reduce compile time already.  But I don't see a system diagnostic that shows max utilization of some resource during a compile, so I'm a bit confused how to make accurate measurements of performance and system resource utilization.  What's the right way to observe these things?  Which system monitoring tool will show me what's being utilized while I'm compiling my C++ code with Visual Studio?

IE attachEvent on object tag causes memory corruption

$
0
0

I've an ActiveX Control (embedded with <object/>) within an embedded IE7/8 HTML page. The <object/> has the following dispinterface event:  [id(1)] HRESULT MessageReceived([in] BSTR id, [in] BSTR json);.

On Windows the event is registered with OCX.attachEvent("MessageReceived", onMessageReceivedFunc).

 

function onMessageReceivedFunc(id, json) {
 alert("messageReceived id=" + id + ", json=" + json);
}


Following code fires the event in the HTML page.

 

HRESULT Fire_MessageReceived(BSTR id, BSTR json)
 {
 CComVariant varResult;
 T* pT = static_cast<T*>(this);
 int nConnectionIndex;
 CComVariant* pvars = new CComVariant[2];
 int nConnections = m_vec.GetSize();
 for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
 {
 pT->Lock();
 CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
 pT->Unlock();
 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
 if (pDispatch != NULL)
 {
 VariantClear(&varResult);

 pvars[1] = id;
 pvars[0] = json;

 DISPPARAMS disp = { pvars, NULL, 2, 0 };
 pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
 }
 }
 delete[] pvars; // -> Memory Corruption here!
 return varResult.scode;
 }

After I enabled gflags.exe with application verifier, the following strange behaviour occur:
After Invoke() that is executing the JavaScript callback, the BSTR from pvars[1] is copied to pvars[0] for some unknown reason!? The delete[] of pvars causes a double free of the same string then which ends in a heap corruption.

Does anybody has an idea whats going on here? Is this a IE bug or is there a trick within the OCX Implementation that I'm missing?

If I use the <script/> tag like:
<script for="OCX" event="MessageReceived(id, json)" language="JavaScript" type="text/javascript">
 window.onMessageReceivedFunc(windowId, json);</script>

... the strange copy operation does not occur.

The following code also seem to be ok due to the fact that the caller of Fire_MessageReceived() is responsible for freeing the BSTRs.

 
 HRESULT Fire_MessageReceived(BSTR srcWindowId, BSTR json)
 {
 CComVariant varResult;
 T* pT = static_cast<T*>(this);
 int nConnectionIndex;
 VARIANT pvars[2];
 int nConnections = m_vec.GetSize();
 for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
 {
 pT->Lock();
 CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
 pT->Unlock();
 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
 if (pDispatch != NULL)
 {
 VariantClear(&varResult);

 pvars[1].vt = VT_BSTR;
 pvars[1].bstrVal = srcWindowId;
 pvars[0].vt = VT_BSTR;
 pvars[0].bstrVal = json;

 DISPPARAMS disp = { pvars, NULL, 2, 0 };
 pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
 }
 }
 return varResult.scode;
 }

Thanks!

_wgetenv_s fails to return some unicode environment variables in console apps (main, not wmain)

$
0
0

Hi,

with MS Visual Studio 2015 (Microsoft (R) C/C++-Optimierungscompiler Version 19.00.23918 für x86) we ran into an issue with unicode environment and _wgetenv_s:

The env contains

JAPAN=2007年10月7日

set via Control Panel.

_wgetenv_s() returns 

2007?10?7? 

as result for JAPAN.

This looks like an ANSI conversion happened.

In GetEnvironmentStringsW the env looks good. In _wenviron it is already broken. So this seems to happen during the initialization of the optional _wenviron.

When replacing main() with wmain() it works as expected.

With earlier versions (VS2009 and VS2013) this works also as expected.

Is this a compiler bug?

Example Code: 

#include <stdio.h>
#include <stdlib.h>

static void wprintenv(wchar_t **envp, FILE* fhandle) {
  if (envp) {
    for ( ; *envp != NULL; envp++) {
      fprintf(fhandle, "  '%S'\n", *envp);
    }
  }
}

int main(int argc, char** argv) {
  FILE* fhandle = fopen ("/temp/log.txt", "wb");
  // The GetEnvironmentStringsW result is OK
  // LPTCH xxx = GetEnvironmentStringsW();

  // Make a wgetenv call to initialize _wenviron
  size_t required_size;
  _wgetenv_s(&required_size, NULL, 0, L"DUMMY");

  // _wenviron has broken Data
  wprintenv(_wenviron, fhandle);
  return 0;
}


error MES4175

$
0
0

Hi, I am a very new to learn C++, I got a problem when I run a very sample code (input and output some words),I got the following error when compiling it.

MSB4175 The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program File(x86)MSBuild\14.0\bin\Microsoft.Build. Tasks. Core.dll". Access to the path 'C:\Users\Yaoyu Ding'\AppData\Local\Temp\wmsicswq.dll' is denied.

I installed VS 2015 and was wondering whether something wrong with configuration ?

I will be so appreciate if some one could help me !

Virtual COM ports in Windows 10: Does EV_TXEMPTY fire?

$
0
0

The EV_TXEMPTY signal appears as expected following a write to a hardware serial port under Windows 10.

I have never yet seen the EV_TXEMPTY signal fire after a write to a virtual serial port associated with a Bluetooth dongle.

Is this signal not implemented for virtual serial ports?


MFC dialog issue...

$
0
0

I have been converting a MDI application into a multiple top-level document application.  I have essentially removed the CMDIFrameWnd, converted the CMDIChildWnd's into CFrameWnd's, and added code to maintain a list of top-level frames to the application.  It essentially works the way the MFC AppWizard code works for multiple top-level document application with the exception that I swap out m_pMainWnd in the frame windows' OnActivate() handler and only exit when all frame windows have closed.  All of that seems to work fine.

However, existing code to open dialogs from a MFC DLL seems to have broken and it's not clear why.

We have a DLL with an exported function that looks like...

int PerformRegistration(CRegistrationInfo& InInfo)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	CRegistrationDlg RegDlg;
	RegDlg.SetRegistrationInfo(InInfo);
	RegDlg.DoModal();
	return 1;
}

Calling this function causes an assertion in WinCore.cpp (asserting that the window handle is in the AFX thread state's CWnd map).  I know that, typically, this is a problem with passing MFC objects across threads.  However, on the main GUI thread exists, so it isn't a threading problem.  I have also read that this has been a bug in MFC, however, none of the workarounds make a difference (setting the thread state's m_pRoutingFrame to NULL, for example).

The call stack from WinDbg looks like:

00 005eee78 5d1e1566 mfc120ud!CWnd::AssertValid+0x150 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 978]
01 005eee84 5d1e7486 mfc120ud!CView::AssertValid+0x16 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\viewcore.cpp @ 518]
02 005eee90 5d1e9166 mfc120ud!CFormView::AssertValid+0x16 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\viewform.cpp @ 324]
*** WARNING: Unable to verify checksum for xxxxx.exe
03 005eee9c 1fc9e4c4 mfc120ud!CHtmlView::AssertValid+0x16 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\viewhtml.cpp @ 122]
04 005eeef4 5d153573 xxxxx!xxxxx::AssertValid+0x14 [xxxxx.cpp @ 279]
05 005eef20 5d1f14fe mfc120ud!AfxAssertValidObject+0x183 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\objcore.cpp @ 106]
06 005eef40 6534e440 mfc120ud!CHtmlControlSite::XDocHostUIHandler::UpdateUI+0x3e [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\viewhtml.cpp @ 330]
07 005eef54 6327cf48 ieframe!CDocObjectHost::UpdateUI+0x30
08 005eef70 6327a562 mshtml!CDoc::OnUpdateUI+0x69
09 005ef110 6327a108 mshtml!CDoc::OnWindowMessage+0x3a2
0a 005ef140 73fd84f3 mshtml!CServer::WndProc+0x58
0b 005ef16c 73fb6c40 USER32!_InternalCallWinProc+0x2b
0c 005ef214 73fb6541 USER32!UserCallWinProcCheckWow+0x1f0
0d 005ef280 73fb6300 USER32!DispatchMessageWorker+0x231
0e 005ef28c 5d1da9d9 USER32!DispatchMessageW+0x10
0f 005ef2b0 5d1dbdb3 mfc120ud!AfxInternalPumpMessage+0x129 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 181]
10 005ef2bc 5d1dab49 mfc120ud!CWinThread::PumpMessage+0x13 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 900]
11 005ef2cc 5d213b52 mfc120ud!AfxPumpMessage+0x29 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 190]
12 005ef2f8 5d0f8021 mfc120ud!CWnd::RunModalLoop+0x232 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 4644]
13 005ef310 5d0f826a mfc120ud!CWnd::CreateRunDlgIndirect+0x71 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dlgcore.cpp @ 470]
*** WARNING: Unable to verify checksum for xxxxx.dll
14 005ef38c 0117a645 mfc120ud!CDialog::DoModal+0x1fa [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dlgcore.cpp @ 633]
15 005ef7ac 1fc320fa xxxxx!PerformRegistration+0x85 [xxxxx.cpp @ 720]

I tried creating a simple test multiple top-level document application and was not able to reproduce the problem, so it is kind of hard to track down the fundamental difference between the two applications.  But, it seems like this does have to be somehow related to the changes I've made.

To make it even more weird, I can get it to fail in a different place as well.  The application has a "welcome" view (the CHtmlView up there in the stack trace).  If I open a document, it closes the welcome view and opens a new document frame.  If I call the same function from the document frame, I receive an assertion in WinCore again, but this time the assertion is that the CWnd* in the map does not match the the view's pointer.

That stack trace looks like:

00 005ee1f0 5d1e1566 mfc120ud!CWnd::AssertValid+0x16c [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 980]
*** WARNING: Unable to verify checksum for xxxxx.exe
01 005ee1fc 1feed944 mfc120ud!CView::AssertValid+0x16 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\viewcore.cpp @ 518]
02 005ee254 5d153573 xxxxx!xxxxx::AssertValid+0x14 [xxxxx.cpp @ 13190]
03 005ee280 5d11cf45 mfc120ud!AfxAssertValidObject+0x183 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\objcore.cpp @ 106]
04 005ee2ac 1fea0854 mfc120ud!CDocument::AssertValid+0x75 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\doccore.cpp @ 1713]
05 005ee304 1fe7be94 xxxxx!xxxxx::AssertValid+0x14 [xxxxx.cpp @ 9232]
06 005ee35c 5d153573 xxxxx!xxxxx::AssertValid+0x14 [xxxxx.cpp @ 2260]
07 005ee388 5d087467 mfc120ud!AfxAssertValidObject+0x183 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\objcore.cpp @ 106]
08 005ee408 5d086ed7 mfc120ud!_AfxDispatchCmdMsg+0x27 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\cmdtarg.cpp @ 51]
09 005ee47c 5d11ee57 mfc120ud!CCmdTarget::OnCmdMsg+0x367 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\cmdtarg.cpp @ 373]
0a 005ee49c 5d1e1ba7 mfc120ud!CDocument::OnCmdMsg+0x27 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\doccore.cpp @ 1012]
0b 005ee4e4 5d23ed2e mfc120ud!CView::OnCmdMsg+0xa7 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\viewcore.cpp @ 172]
0c 005ee544 1fd08a14 mfc120ud!CFrameWnd::OnCmdMsg+0x7e [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\winfrm.cpp @ 980]
0d 005ee5ac 1fbd99ad xxxxx!xxxxx::OnCmdMsg+0x24 [xxxxx.cpp @ 3305]
0e 005ee65c 5c84d991 xxxxx!xxxxx::UpdateProperty+0x10d [xxxxx.cpp @ 232]
0f 005ee680 5c8627bd UIRibbon!CControlUser::_UpdatePropertyFromHandler+0x31
10 005ee6c4 5c899476 UIRibbon!CGenericControlUser::FEnabledImpl+0x3d
11 005ee6d8 5c84a80a UIRibbon!CGenericDataSource::FEnabled+0x26
12 005ee6f0 5c849a23 UIRibbon!OfficeSpace::DataSourceBase::GetValue+0x9a
13 005ee710 5c849cf9 UIRibbon!CGenericDataSource::GetValue+0x43
14 005ee734 5c84a951 UIRibbon!OfficeSpace::DataSource::GetValue+0x99
15 005ee754 5c848ebc UIRibbon!OfficeSpace::FSControl::GetValue+0xc1
16 005ee778 5c84ae72 UIRibbon!OfficeSpace::Data::FSControlSP::GetEnabled+0x3c
17 005ee788 5c84ad6a UIRibbon!OfficeSpace::FSControl::FEnabled+0x22
18 005ee7a4 5c84c7ea UIRibbon!OfficeSpace::FSControl::OnPropertyChanged+0x7a
19 005ee7dc 5c8883a5 UIRibbon!FlexUI::PropertyChangeListenerManager::OnPropertyChanged+0x7a
1a 005ee7f0 5c88808d UIRibbon!CGenericControlUser::_OnPropertyChanged+0x15
1b 005ee81c 5c86e6cd UIRibbon!CGenericControlUser::InvalidateUICommand+0x9d
1c 005ee868 5c84c9fc UIRibbon!COfficeSpaceUser::InvalidateUICommandInternal+0xb8
1d 005ee898 5c84cb0f UIRibbon!COfficeSpaceUser::OnUpdate+0x6c
1e 005ee8bc 5c86276a UIRibbon!COfficeSpaceUser::FrameListenerWndProc+0x5f
1f 005ee8e8 5c862053 UIRibbon!COfficeSpaceUser::s_FrameListenerWndProc+0x8a
20 005ee92c 73fd84f3 UIRibbon!WndBridge::RawWndProc+0x93
21 005ee958 73fb6c40 USER32!_InternalCallWinProc+0x2b
22 005eea00 73fb6820 USER32!UserCallWinProcCheckWow+0x1f0
23 005eea60 73fbd169 USER32!DispatchClientMessage+0xf0
24 005eeaa0 77268e56 USER32!__fnDWORD+0x49
25 005eead8 73fd897c ntdll!KiUserCallbackDispatcher+0x36
26 005eeadc 73fb6289 USER32!NtUserMessageCall+0xc
27 005eeb40 73fb5ee3 USER32!SendMessageWorker+0x339
28 005eeb78 5c8825b1 USER32!SendMessageW+0x143
29 005eeb90 73fd84f3 UIRibbon!COfficeSpaceUser::s_TimerProc+0x21
2a 005eebbc 73fb44f7 USER32!_InternalCallWinProc+0x2b
2b 005eec50 73fb661f USER32!UserCallWinProc+0x105
2c 005eecb4 73fb6300 USER32!DispatchMessageWorker+0x30f
2d 005eecc0 5d1da9d9 USER32!DispatchMessageW+0x10
2e 005eece4 5d1dbdb3 mfc120ud!AfxInternalPumpMessage+0x129 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 181]
2f 005eecf0 5d1dab49 mfc120ud!CWinThread::PumpMessage+0x13 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 900]
30 005eed00 5d213b52 mfc120ud!AfxPumpMessage+0x29 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 190]
31 005eed2c 5d0f8021 mfc120ud!CWnd::RunModalLoop+0x232 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 4644]
32 005eed44 5d0f826a mfc120ud!CWnd::CreateRunDlgIndirect+0x71 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dlgcore.cpp @ 470]
*** WARNING: Unable to verify checksum for C:\Users\randy\Projects\polysmith\PS-7494\WinDebug\PolyDbEx.dll
33 005eedc0 0111a645 mfc120ud!CDialog::DoModal+0x1fa [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dlgcore.cpp @ 633]
34 005ef1e0 1fc320fa xxxxx!PerformRegistration+0x85 [xxxxx.cpp @ 720]



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 check both projects and it use .net version 4.0
I had look 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.


Visual Studio 2015 cross platform c++ hangs after build in vslog!VSResponsiveness::Detours

$
0
0

I have a Visual Studio 2015 Professional Update 2 crossplatform c++ solution with shared, android and ios projects. It looks like the projects build successfully, but then Visual Studio hangs. I am unable to cancel the build or restart visual studio. I have to kill the devenv process, then open it again.

In windbg here is the call stack::

ChildEBP RetAddr  Args to Child              
0018f7f0 754da4fa 00000001 0018f9c4 00000001 ntdll!NtWaitForMultipleObjects+0xc
0018f984 7447c47b 00000001 0018f9c4 00000000 KERNELBASE!WaitForMultipleObjectsEx+0x10a
0018f9ec 6d3e10f7 00000000 00000000 ffffffff user32!MsgWaitForMultipleObjectsEx+0x17b
0018fa10 65038c36 00000000 00000000 ffffffff vslog!VSResponsiveness::Detours::DetourMsgWaitForMultipleObjectsEx+0x45
0018fa58 64ef72d5 e7ef8255 00000000 02882970 msenv!CMsoCMHandler::EnvironmentMsgLoop+0x15b
0018fa80 64ef722b 00000001 ffffffff e7ef8215 msenv!CMsoCMHandler::FPushMessageLoop+0x105
0018fac0 64ef716f 00000001 22123638 00000364 msenv!SCM::FPushMessageLoop+0xb9
0018fae0 64ef7136 02882974 029a9a18 ffffffff msenv!SCM_MsoCompMgr::FPushMessageLoop+0x2a
0018fb0c 64ef7086 ffffffff e7ef8375 00000000 msenv!CMsoComponent::PushMsgLoop+0x2e
0018fba0 64fe23b3 e7ef831d 00000000 64eb0000 msenv!VStudioMainLogged+0x5bd
0018fbc8 2f11fed2 00785bb0 46c46c87 00000000 msenv!VStudioMain+0x7c
0018fc08 2f11faaa 46c46e6f 74b9aba0 2f12fa50 devenv!util_CallVsMain+0xde
0018fee0 2f1336e3 00000000 2f16a570 003c6000 devenv!CDevEnvAppId::Run+0xbb5
0018ff08 2f133803 2f110000 00000000 00765255 devenv!WinMain+0xbd
0018ff54 74b938f4 003c6000 74b938d0 1d11fde1 devenv!__scrt_common_main_seh+0xfd
0018ff68 77455de3 003c6000 1e9d6f34 00000000 kernel32!BaseThreadInitThunk+0x24
0018ffb0 77455dae ffffffff 7747b7b0 00000000 ntdll!__RtlUserThreadStart+0x2f
0018ffc0 00000000 2f130fe2 003c6000 00000000 ntdll!_RtlUserThreadStart+0x1b

Just a curiosity about `typedef T1 fmtflags;` in the C++ Standard

$
0
0

In [ios.base] in c++1z, one can find the following:

typedef T1 fmtflags;

Then under [iostream.format.overview], under the title Header <iomanip> synopsis, I found this:

namespace std {
  // types T1, T2, ... are unspecified implementation types
  T1 resetiosflags(ios_base::fmtflags mask);
  T2 setiosflags  (ios_base::fmtflags mask);
  T3 setbase(int base);
  template<charT> T4 setfill(charT c);
  T5 setprecision(int n);
  T6 setw(int n);
  ...
}

Then I looked into the <iomanip> header file in VS2015 and I found this:

// INSTANTIATIONS
_MRTIMP2 _Smanip<ios_base::fmtflags> __cdecl resetiosflags(ios_base::fmtflags);
_MRTIMP2 _Smanip<ios_base::fmtflags> __cdecl setiosflags(ios_base::fmtflags);
_MRTIMP2 _Smanip<int> __cdecl setbase(int);
_MRTIMP2 _Smanip<streamsize> __cdecl setprecision(streamsize);
_MRTIMP2 _Smanip<streamsize> __cdecl setw(streamsize);
But I still have no idea what T1 stands for in VS2015.

Trouble binding a custom datasource to a C# forms application

$
0
0

I've created an object that I'll generate 4 instances of. These 4 will then act as repositories for data coming from the network from 4 custom devices on the network. The Forms app that I've built has 4 panels for each of the four objects.  I call the constructor and create one instance so I know the object is good. How do I at design time link the instance of the object to a specific value of the instance that I've created.

Here's a chunk of code ...

    public class mano
    {
        private string _strIpAddress;
        private int _intPort;
        private int _intPressure;

        public mano(string inIpAddress, int inPort)
        {
            strIpAddress = inIpAddress;
            intPort = inPort;
        }

        ~mano() { }

        public string strIpAddress
        {
            get { return _strIpAddress; }
            set { _strIpAddress = value; }
        }
        public int intPort
        {
            get { return _intPort; }
            set { _intPort = value; }
        }

        public int intPressure
        {
            get { return _intPressure; }
            set { _intPressure = value; }
        }

I have a checkbox on the form that activates things and starts by creating the instance ...

    public partial class Mano16 : Form
    {
        public Mano16()
        {
            InitializeComponent();
            manometer Manon1 = new mano("179.0.0.1", 5555);
        }

        private void chkBxMB1_CheckedChanged(object sender, EventArgs e)
...

So I want to point to Manon1 as my data source but not much luck finding it. I've poked around on the MSDN site and here but I'm not seeing what is probably right in front of me.













namespace

Mano2016

{

   

publicclassmanometer


    {

       

privatestring_strIpAddress;

       

privateint_intPort;

       

privateint_intPressure;

       

privateint_intRate;

       

privatefloat_fltCmdPress;

       

privatefloat_fltCmdRate;

       

privatefloat_fltBattState;

       

privatelong_lngPackets;

       

privatestring_strActCommand;

       

privatestring_strPendCommand;

       

privateint_intActRate;

       

publicmanometer()

       

            :

this("", 0){

        }

       

publicmanometer(stringinIpAddress,intinPort)

        {

            strIpAddress = inIpAddress;

            intPort = inPort;

            intRate = 0;

            lngPackets = 0;

            strActCommand =

"Idle";

        }

        ~manometer() { }

       

publicstringstrIpAddress

        {

           

get{return_strIpAddress; }

           

set{ _strIpAddress =value; }

        }

       

publicintintPort

        {

           

get{return_intPort; }

           

set{ _intPort =value; }

        }

       

publicintintPressure

        {

           

get{return_intPressure; }

           

set{ _intPressure =value; }

        }

Viewing all 15302 articles
Browse latest View live


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