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

WaitForSingleObject returns after 2 seconds event if SetEvent() is invoked.

$
0
0

I have two applications in which APP_A writes some data to shared memory and APP_B reads the data from the same.  I have two auto reset events(global events)  Event_A and Event_B to synchronize shared memory access.It works as follows

1. APP_A waits for Event_A for 2 seconds timeout.(Initially state set)

2. APP_B waits for Event_B for INFINITE timeout.

3. When applications start, APP_A wait is returned since it is initially set.

4. Once returned, it writes data to shared memory and sets Event_B.

5. Now APP_B wait is returned. It reads data from shared memory and sets Event_A.

In issue scenario, there so many applications (say100) instead of APP_A and each requests to write to shared memory 10000 times. Thus many applications are waiting for Event_A.

The issue is each time Event_A is set, one of APP_X wait returns and some applications got timeout?


Thanks, Renjith V R


Deadlock on CRT locale

$
0
0
Discussing application bug: 
Rarely most application threads stuck on identically repeated deadlock. Deadlock reproduced about once a month on Windows XP and latter.
Essential about our large project:
Project builded as release target when bug was reproduced at customers machines.
Application compiled with /EHa consequently catch block with ellipsis (...) could sometimes hide access violations and other system exceptions.
(Please, don't discuss good or bad practise catch block with ellipsis).
Project consist of pure, pure CLR and mixed CLR assemblies (C++; C#; C++\CLI).
MSVS 2013
Most application threads use thread local C locale mode.

WinDbg dump info, most essential see at link:
http://pastebin.com/FsYvAafV
Full stack traces see at link:
http://pastebin.com/aASJE7NB
Full dump see at link (70Mb): 
https://drive.google.com/file/d/0B3jDtpEHildYbndoODRKa09IRTg/view?usp=sharing

Most threads waiting on CRT locale critical section ("_mlock(_SETLOCALE_LOCK)" code on CRT sources), e.g. thread with WinDbg_ID=44. 
Other threads waiting on loader critical section, e.g. thread with WinDbg_ID=23.
Probably 23 thread entered internally at CRT sources to CRT locale critical section and didn't left it. 
44 thread enter to loader critical section before _CRTDLL_INIT/dllmain and waiting for crt-locale critical section at _CRTDLL_INIT/dllmain while execute DLL_THREAD_ATTACH.
dllmain is default generated.
Locale critical section was must left, because _munlock(_SETLOCALE_LOCK) should be at __finally block at CRT sources.
Probably occurred some system exception after enter at CRT locale critical section and when _munlock wasn't left CRT locale critical section.
Sort of unusual: 3 modules at process:
 msvcr80.dll - loaded by sqlncli10.dll
 msvcr120.dll 
 msvcr120_clr0400.dll 
 
Is anyone have some ideas or explanations?
Is it possible to call from single thread a CRT locale functions from a different CRT versions? That probably corrupt the thread local CRT locale data memory because of a CRT difference. And some system exception was occurred after enter to the CRT locale critical section. Is it real?
Is it possible to skip __finally block? Skipping scenario?

Setting Breakpoints on a Memory Allocation Number

$
0
0

In the web page: http://msdn.microsoft.com/en-us/library/x98tx3cf.aspx for Visual Studio 2013, the page describes Setting Breakpoints on a Memory Allocation Number. 

The text is out-of-date with respect to Visual Studio 2013. 

Does Visual Studio 2013 still support setting break points on memory allocation number?

Low Level Terminal I/O

$
0
0
Hi,
I am trying to read and write from a serial port.

I found functions such as _open() and _close() and was successful in opening and closing the port.

 I couldn't find any functions for setting terminal parameters such as baudrate, parity,databits at the low level.

Can I set the parameters using DCB structure?  or are there different functions for low level?


Also,  SetCommState()  takes HANDLE as a parameter.

So I am in search of functions which would take and return INT as a parameter instead of a HANDLE.

Any documentation,links etc etc??

Advice on speeding up Animations in vc++

$
0
0
So I'm here trying to set up a little side-project where I basically need many little rectangular regions to spawn on screen  and blit on them a semi-transparent bitmap and subsequently make few animations on runtime that touch their alpha channel and part of the blitted image color.

As the poor inexperienced winAPI user I am, first thing that crossed my mind was to use plain GDI/GDI+ to do all the work, expecting it to be fast enough to handle at least 30 fps.

It seems that DrawImage alone, while using the overload that picks an ImageAttribute with a simple matrix set in it, can't handle more than 7-9 fps in my system, this excludes many of the other drawings/tweaks that should be handled

I can't use AlphaBlend and plain GDI since i'm enabling the DWMBlurBehind function and it blends with on-screen pixels making every portion of the region brighter

Second approach would be to make each rectangular region as a different and separate WS_EX_TOOLWINDOW | WS_EX_LAYERED window, and UpdateLayeredWindow my way up to the desired effect, this would anyway be unmanageable since 50+ windows sitting on screen are definitely not the most elegant approach I should go for (or not?)

Is this the opportunity to try and learn DirectX ? Is it suited for what i'm trying to do ? Does it blends well with DWMEnableBlurBehind function ?

What other alternatives I could take in consideration to make drawings/animations faster than whatever I can achieve with plain GDI+ ?

running program compatibilty

$
0
0
I have installed visual studio 2013 on windows8 64bit OS. I want to run 32 bit OS code on it but it gives error "'\Debug\MNist.pch' precompiled header file is from previous version of the compiler, or the precompiled header is C++ and you are missing it from C(or vice versa)".

Balloon tip for CEdit

$
0
0

hi,

In my dialog I have a grid and one of its cells is a CEdit field.

Using CEdit::ShowBalloonTip() I put a warning message out to the user.

After pressing any key, the warning is gone but I miss the focus. Unless, I do a mouse click on a specific grid cell.

MyDialog::PreTranslateMessage() doesn't propagate messages to my grid, because not in focus.

Is there a way to determine, that Balloon tip is now gone, so I can set my focus back to the grid?

thanks,

Alex

Problem in program compatibility

$
0
0
I am running 64 bit operating system and have visual studio 2013. I want to run 32 bit operation system code on it. but it gives me error can any one help me how to run it on 64 bit . the error is "'Debug\MNist.pch' precompiled header file is from the previous version of the compiler, or the precompiled header is C++ and you are using it from C(or vise virsa)".

Appearance of tooltips defined with CMFCRibbonGallery::SetItemToolTip()

$
0
0

I use

CMFCRibbonGallery::SetItemToolTip();

to set tool tips on gallery items in drop-down galleries.

Their appearance, however, is very iffy.   They don't always get drawn properly, for example in the top half of the attached image.   A bit of muse wiggling (off and back onto the gallery item) can often fix this, but it's irritating to have to do it.

Is there a work-around?

[I'm using VS 2013 community, and update 5 has not fixed it.]

Dave

Incorrect and correct tooltip appearance


David Webber Author of Mozart music notation software http://www.mozart.co.uk

Locating Menu Item Map Value for Context Sensitive Help

$
0
0

I converted an old VS 5.0 project in VS 2013. Got it running and converted the old WinHelp system to HTML Help.

The original help map values for menu items and dialog boxes worked fine from the old help project files so my topics display fine.

example entries from map:

#define HID_SPLASH                              0x17C2B
#define HID_GRAPH_GRAPHTICKS_ON                 0x17C2D
#define HID_GRAPH_GRAPHTICKS_OFF                0x17C2E
#define HID_GRAPH_GRAPHTICKS_SIZE_X1            0x17C2F
#define HID_GRAPH_GRAPHTICKS_SIZE_X2            0x17C30
#define HID_GRAPH_GRAPHTICKS_SIZE_X3            0x17C31
#define HID_GRAPH_GRAPHTICKS_SIZE_X4            0x17C32
#define HID_GRAPH_GRAPHTICKS_SIZE_X5            0x17C33

Each HID_  command is mapped to a unique HEX command identifier supplied by the application which indexes to an alias to identify the correct topic file.

I have created a new menu item and I cannot locate the correct HEX command identifier to map the new menu HID_ to an alias. The properties tab for the new menu item does not list it.

Any ideas on where it is located?

Tks

Why does the application which used PPL(Parallel Patterns Library) crash on Windows 2000 compatibile mode ?

$
0
0

Here is very simple application.

#include "stdafx.h"
#include <ppl.h>
typedef void* (*Tmemcpy)(void*, const void*, size_t);
static void* mt_copy(void* d, const void* s, size_t size, Tmemcpy mF)
{
    size_t bs = (size / 2) & ~31; // Make size a multiple of 32 bytes
    const size_t os[] = { 0, bs, size };
    Concurrency::parallel_for(0, 2, [d, s, &os, mF](int i)
    {
        mF((char*)d + offsets[i], (const char*)s + offsets[i], offsets[i + 1] - offsets[i]);
    });
    return d;
}
int APIENTRY _tWinMain(HINSTANCE hI,
                     HINSTANCE hP,
                     LPTSTR    lpe,
                     int       nC)
{
    char test1[512];
    mt_copy(test1, "xx",4, memcpy);
    return 0;
}

Windows 7 SP1

1. compile it.
2. set Windows 2000 compatibility mode.
3. execute it.
4. always is crashes.

Windows 8.1

1. compile it.
2. set Windows XP compatibility mode.
3. edit with registry "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers". change "WINXPSP3" to "WIN2000"
4. execute it.
5. always it crashes.

VC++2013 Update 5 RC has  also  same problem.

Why do VC++2013 and VC++2015 check version Windows 2000 ?

It is very strange.

error LNK2019: unresolved external symbol

$
0
0

I am using Microsoft Visual Studio  2008. I am building it in release mode. My project will get past the compile stage ,but when it starts linking i will get the below errors

 

1>seniorgui.obj : error LNK2019: unresolved external symbol _getBusProtocolErrorText referenced in function "void __cdecl openProtocol(void)" (?openProtocol@@YAXXZ)

1>seniorgui.obj : error LNK2019: unresolved external symbol "public: int __thiscall MbusTcpMasterProtocol::openProtocol(unsigned short const * const)" (?openProtocol@MbusTcpMasterProtocol@@QAEHQBG@Z) referenced in function "void __cdecl openProtocol(void)" (?openProtocol@@YAXXZ)

1>seniorgui.obj : error LNK2019: unresolved external symbol "public: virtual int __thiscall MbusTcpMasterProtocol::isOpen(void)" (?isOpen@MbusTcpMasterProtocol@@UAEHXZ) referenced in function "void __cdecl isOpen(void)" (?isOpen@@YAXXZ)

1>seniorgui.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall MbusTcpMasterProtocol::closeProtocol(void)" (?closeProtocol@MbusTcpMasterProtocol@@UAEXXZ) referenced in function "void __cdecl closeProtocol(void)" (?closeProtocol@@YAXXZ)

1>seniorgui.obj : error LNK2019: unresolved external symbol "public: __thiscall MbusTcpMasterProtocol::MbusTcpMasterProtocol(void)" (??0MbusTcpMasterProtocol@@QAE@XZ) referenced in function "void __cdecl `dynamic initializer for 'mbusProtocol''(void)" (??__EmbusProtocol@@YAXXZ)

1>seniorgui.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall MbusTcpMasterProtocol::~MbusTcpMasterProtocol(void)" (??1MbusTcpMasterProtocol@@UAE@XZ) referenced in function "void __cdecl `dynamic atexit destructor for 'mbusProtocol''(void)" (??__FmbusProtocol@@YAXXZ)

Any help that can be provided is very welcome . I have been trying to figure it out for a while now. If you need my whole project just ask. I will zip it up and send it

 

My code where i am implementing this is

// Platform header
#include <stdio.h>
#include <stdlib.h>
#include "seniorgui.h"
#include "iconArea.h"// Include FieldTalk package header
#include "MbusTcpMasterProtocol.hpp"

#include <QtGui>
#include <QDesktopServices>
#include <iostream>
#include <fstream>//#include <tchar.h>

#include <QUrl>usingnamespace std;/*****************************************************************************
* Gobal data
*****************************************************************************/

#if defined (_UNICODE)
TCHAR *hostName = L"127.0.0.1";
#elsechar *hostName = "127.0.0.1";
#endif
MbusTcpMasterProtocol mbusProtocol;


seniorGui::seniorGui(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{

	previewArea = new iconArea();
	centralWidget = new QWidget;
	setCentralWidget(centralWidget);

	QTimer *countdown = new QTimer;

	QGridLayout *mainLayout = new QGridLayout;
	mainLayout->addWidget(previewArea, 0, 0, 0, 0);
	centralWidget->setLayout(mainLayout);

	createActions();
	createMenus();
	createToolBars();
	createStatusBar();

	setWindowTitle(tr("ModBus TCP/IP Senior Gui"));
	resize(minimumSizeHint());

}

void seniorGui::closeEvent(QCloseEvent *event)
{

}

void seniorGui::about()
{
	QMessageBox::about(this, tr("About Application"),
		tr("This is a <b>Application</b> that will use""ModBus TCP/IP to connect and control several devices"));
}void seniorGui::createActions()
{
	connectAct = new QAction(QIcon("connect.png"), tr("&Connect"), this);
	connectAct->setStatusTip(tr("Connect to IP Address"));
	connect(connectAct, SIGNAL(clicked()), this, SLOT(openProtocol()));

	helpAct = new QAction(QIcon("help.gif"), tr("&help"), this);
	helpAct->setStatusTip(tr("Let's Help you out"));//connect(helpAct, SIGNAL(clicked()), this, SLOT(helpFile()));

	qtAct = new QAction(QIcon("qt.png"), tr("&Qt"), this);
	qtAct->setStatusTip(tr("Learn more about Qt"));
	connect(qtAct, SIGNAL(clicked()), this, SLOT(qtHelp()));

	disconnectAct = new QAction(QIcon("Disconnect.png"), tr("&Disconnect"), this);
	disconnectAct->setStatusTip(tr("Disconnecting from Module"));
	connect(disconnectAct, SIGNAL(clicked()), this, SLOT(closeProtocol()));

	checkAct = new QAction(QIcon("check.png"), tr("&Check"), this);
	disconnectAct->setStatusTip(tr("Disconnecting from Module"));
	connect(checkAct, SIGNAL(clicked()), this, SLOT(isOpen()));

	timer1Act = new QAction(QIcon("timer.png"), tr("&Timer 1"), this);
	timer1Act->setStatusTip(tr("Getting Data from Button1"));
	connect(checkAct, SIGNAL(clicked()), this, SLOT(timer()));

	timer2Act = new QAction(QIcon("timer.png"), tr("&Timer 2"), this);
	timer2Act->setStatusTip(tr("Getting Data from Button3"));
	connect(checkAct, SIGNAL(clicked()), this, SLOT(timer()));

	timer3Act = new QAction(QIcon("timer.png"), tr("&Timer 3"), this);
	timer3Act->setStatusTip(tr("Getting Data from Button3"));
	connect(checkAct, SIGNAL(clicked()), this, SLOT(timer()));

	timer4Act = new QAction(QIcon("timer.png"), tr("&Timer 4"), this);
	timer4Act->setStatusTip(tr("Getting Data from Button4"));
	connect(checkAct, SIGNAL(clicked()), this, SLOT(timer()));

	timer5Act = new QAction(QIcon("timer.png"), tr("&Timer 5"), this);
	timer5Act->setStatusTip(tr("Getting Data from Button5"));
	connect(checkAct, SIGNAL(clicked()), this, SLOT(timer()));

	timer6Act = new QAction(QIcon("timer.png"), tr("&Timer 6"), this);
	timer6Act->setStatusTip(tr("Getting Data from Button6"));
	connect(checkAct, SIGNAL(clicked()), this, SLOT(timer()));

}

void seniorGui::createToolBars()
{
	fileToolBar = addToolBar(tr("Connect"));
	fileToolBar->addAction(connectAct);
	fileToolBar->addAction(disconnectAct);
	fileToolBar->addAction(checkAct);


	fileToolBar = addToolBar(tr("Help"));
	fileToolBar->addAction(helpAct);
	fileToolBar->addAction(qtAct);


}
void seniorGui::createMenus()
{
	fileMenu = menuBar()->addMenu(tr("&File"));
	fileMenu->addAction(connectAct);
	fileMenu->addAction(disconnectAct);
	fileMenu->addAction(checkAct);


	fileMenu = menuBar()->addMenu(tr("Read Data"));
	fileMenu->addAction(timer1Act);
	fileMenu->addAction(timer2Act);
	fileMenu->addAction(timer3Act);
	fileMenu->addAction(timer4Act);
	fileMenu->addAction(timer5Act);
	fileMenu->addAction(timer6Act);


	fileMenu = menuBar()->addMenu(tr("&Help"));
	fileMenu->addAction(helpAct);
	fileMenu->addAction(qtAct);
}void openProtocol()
{int result;

	result = mbusProtocol.openProtocol(hostName);
	if (result != FTALK_SUCCESS)
	{
		fprintf(stderr, "Error opening protocol: %s!\n",
			getBusProtocolErrorText(result));
		exit(EXIT_FAILURE);
	}
}void isOpen()
{int result;

	result = mbusProtocol.isOpen();
	if (result != FTALK_SUCCESS)
	{

		exit(EXIT_FAILURE);
	}

}

/**
* Closes protocol
*/void closeProtocol()
{
	mbusProtocol.closeProtocol();
}void seniorGui::timer()
{
	count = 60000;while (count > 0)
	{//mbusProtocol.readCoils();// read data from device
		count--;
	}if(count <=0)
	{
		ofstream *dataFile = new ofstream;
		dataFile->open("data.txt");
		dataFile->close();//export data to text file
	}


}

void seniorGui::createStatusBar()
{
	statusBar()->showMessage(tr("Ready"));
}


 

I took some pictures of my linker properties screen

 

How to change the font size of editbox control on runtime (MFC)?

$
0
0

Hi, I am a junior on MFC programming.

My question is very simple. I have a editbox and slider control on a dialog box.

When the changes of slider notify, then the font size of edit box have to be large or be small.

How can I do this?

Here's sample code but it did not work correctly.

    LOGFONT lf;                        // Used to create the CFont.

    CFont *currentFont = GetFont();
    currentFont->GetLogFont(&lf);
    lf.lfHeight = pixelHeight;
    font_.DeleteObject();
    font_.CreateFontIndirect(&lf);    // Create the font.

    // Use the font to paint a control.
    SetFont(&font_);

CDHtmlDialog with toolbar

$
0
0

Hi,

I would like to have my toolbar in dialog app based CDHtmlDialog class.

I added the toolbar in CDialog but thesame code doesn't work in CDHtmlDialog.

How can I add the toolbar in CDHtmlDialog ?

Thanks for your time.

WMI/SecurityCenter2 does not displays the product version in Win 7

$
0
0

Hi All,
I am trying to find all the installed AntiVirus their  status and its product version in Win 7 machine using c++ code.  Pre Vista OS on using WMI/SecurityCenter it detects the product version. How this can be achieved using WMI/SecurityCenter2 in WIn 7. As WMI/SecurityCenter2 does not detects the installed products version.  However WMI/SecurityCenter2 gives the information of pathToSignedProductExe using this path and GetFileVersionInfo() and VerQueryValue()detects the version info  but it does not gives correct information. Eg:-  The product version detected for Avast  using above method is 10.2.2218.942 whereas when I go and select about Avast from system tray icon it displays 2015.10.2.2218. Almost same is the case with Macafee  Antivirus product. Anyone having idea how to get the exact version displayed by the AntiVirus. Please share how we can get the exact version displayed in the about.



Wrong CListCtrl items drawing

$
0
0

I have my CListCtrlEx derived from CListCtrl. This list have style LVS_REPORT, LVS_OWNERDRAWFIXED and LVS_EX_GRIDLINES. I have added possibility to change font for this list. This works fine, but there is one bad thing - if I change font and before that I have not been scrolling list, then all list items redraws right, but if I have done scrolling before font changing, then list items redraws a little bit upper or lower than list grid horizontal lines, i. e. items text becomes overlapped by grid lines.

Here is how I changing list font:

LRESULT CListCtrlEx::OnSetFont(WPARAM wParam, LPARAM) { LRESULT res = Default(); CRect rc; GetWindowRect(&rc); WINDOWPOS wp; wp.hwnd = m_hWnd; wp.cx = rc.Width(); wp.cy = rc.Height(); wp.flags = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOZORDER; SendMessage(WM_WINDOWPOSCHANGED, 0, (LPARAM)&wp); return res; } void CListCtrlEx::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) { HDC hDC = ::GetDC(NULL); CFont* pFont = GetFont(); HFONT hFontOld = (HFONT)SelectObject(hDC, pFont->GetSafeHandle()); CRect rect; DrawText(hDC, _T(" "), 1, rect, DT_SINGLELINE | DT_CALCRECT); lpMeasureItemStruct->itemHeight = rect.bottom - rect.top; SelectObject(hDC, hFontOld); ::ReleaseDC(NULL, hDC); }

How to use APDU commands to communicate with smart card using SCardTransmit.

$
0
0

Hello,

I want to use APDU commands to retrieve simple ATR of a Smartcard.

here i want more information on APDU commands, how to use it to do various operation with smartcard.

Please let me know, any sample or link or pointer over this.

Thank in advance.

I have written small program, but it's returning error code as 22 or 1783 @SCardTransmit function.

DWORD ret;
SCARDCONTEXT m_ContextHandle;
SCARDHANDLE  m_CardHandle;
DWORDm_ActiveProtocol;

char* Readername = "OMNIKEY CardMan 3x21 0";


/*Retrieve Context of smart card*/
ret = SCardEstablishContext(SCARD_SCOPE_SYSTEM, 
NULL, 
NULL, 
&m_ContextHandle);

if (ret != SCARD_S_SUCCESS) 
{
return false;
}



ret = SCardConnect(m_ContextHandle, 
(LPCSTR)Readername, 
SCARD_SHARE_SHARED, 
SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1, 
&m_CardHandle, 
&m_ActiveProtocol);
if (ret != SCARD_S_SUCCESS) 
{
return false;
}

DWORD dwSendLength, dwRecvLength;
SCARD_IO_REQUEST pioRecvPci;
BYTE pbRecvBuffer[1024];
BYTE pbSendBuffer[] = { 0xC0, 0xA4, 0x00, 0x00, 0x02, 0x3F, 0x00 };

BYTE cmd1[] = { 0x00, 0xA4, 0x04, 0x00, 0x0A, 0xA0,
0x00, 0x00, 0x00, 0x62, 0x03, 0x01, 0x0C, 0x06, 0x01 };

dwSendLength = sizeof(pbSendBuffer);
dwRecvLength = sizeof(pbRecvBuffer);

ret = SCardTransmit(m_CardHandle, SCARD_PCI_T1, pbSendBuffer, sizeof(pbSendBuffer),
NULL, pbRecvBuffer, &dwRecvLength);
if (ret != SCARD_S_SUCCESS) 
{

return false;
}


Regards,

Rohan Mohite


Best Regards, Rohan Jayraj Mohite.

scan for folders

$
0
0

I was wondering rather than scanning for files, scan for only directories

the idea i was considering, is like the DOS tree command, but I wanted to output something in legall HTML, which I could use for a human friendly site map.

ideas?


M5A99FX

Hardcore Games Legendary is the Only Way to Play!
Vegan Advocate How can you be an environmentalist and still eat meat?

Problem with System Metrics SM_CXSIZEFRAME + SM_CXPADDEDBORDER in Windows 10 Preview (Build 10041)

$
0
0

Maybe this forum is the wrong place to ask something about Windows 10 Preview, but I did not find a dedicated place to reportprogramming problems as opposed to user problems:

I program/maintain a 32-bit desktop (WIN32 API) application and try it now on Windows 10 Preview build 10041. I calculate the size of a window border with the help of the GetSystemMetrics function, using the constants SM_CXSIZEFRAME and SM_CXPADDEDBORDER.

Originally, I only used SM_CXSIZEFRAME. This returned 4 pixels instead of the expected 8 pixels that I got on all previous windows versions up to Windows 8.1. Then I learned that already since Windows Vista one is expected to add the value of SM_CXPADDEDBORDER to get the full border size. (SM_CXSIZEFRAME alone only continued to work on Vista and beyond thanks to a little compatibility hack by Microsoft, with SM_CXSIZEFRAME still returning the full border size and SM_CXPADDEDBORDER returning yet 0, at least for 32-bit programs like mine.)

Assuming that Microsoft finally switched off that compatibility measure on Windows 10 I query and add SM_CXPADDEDBORDER now as well. Unfortunately this does not solve my problem, as that system metric returns 0.

Just to be on the sure side, I declared my program to support Windows 10 by using an embedded manifest and using the corresponding <compatibility> / <supportedOS> line with the Windows 10 GUID - this did not help either.

As querying and adding those two system metric values is rather trivial (no need to include code in this question, I think), I don't have the slightest idea whatI could do wrong here, this looks like Preview bug affecting 32-bit programs to me...

How to display document in popup when iconic?

$
0
0
I have a MFC MDI app where a user opens and operates on many files at a time. Lots of times they minimize a lot of "documents" and its very hard to determine which is which document by the minimize view (caption bar) so what I would like to do is if the document is iconic popup a small windows and display the document, if they click the restore/maximize or the popup the document is restored. Any one know of any code, example to do this?

Thanks
Viewing all 15302 articles
Browse latest View live


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