Thursday, 5 February 2015

CTreeCtrl SetCheck not working OnInitDialog() init fix C++


For example:-

HTREEITEM hItem = m_treeCtrl.InsertItem("test");
m_treeCtrl.SetCheck(hItem,TRUE);

doesn't check the checkboxes!

but if you unmodify and re-modify then it works fine:-

m_treeCtrl.ModifyStyle(TVS_CHECKBOXES, 0);
m_treeCtrl.ModifyStyle(0, TVS_CHECKBOXES);

HTREEITEM hItem = m_treeCtrl.InsertItem("test");
m_treeCtrl.SetCheck(hItem,TRUE);


Monday, 2 February 2015

How to fix the RC -nologo compiler error in Visual studio 2012/2013



open View -> Other Windows -> Property Manager
or View -> Property Manager
expand the Debug or Release.
double click on Microsoft.Cpp.Win32.user
go to VC++ Directories
rows which have been changed are bold. on all bold rows, click inside the text field, then on the Dropdown menu select inherit from parent or Project Defaults

do same for all include, libs etc.

save and re-compile. problem solved and solves it for any other projects too.

Monday, 21 April 2014

Hiding an MFC dialog box without taskbar / flickering etc

How to: Hiding an MFC dialog box without taskbar / flickering etc


If you show your dialog using CDialog::DoModal() the framework will make sure your dialog is shown. There is only one way to prevent a modal dialog from being shown:
In your MFC Project dialog e.g. CHiddenDialog.cpp
BEGIN_MESSAGE_MAP(CHiddenDialog, CDialog)
    ON_WM_WINDOWPOSCHANGING()
END_MESSAGE_MAP()


BOOL CHiddenDialog::OnInitDialog()
{
    CDialog::OnInitDialog();
    m_visible = FALSE;

    return TRUE;
}

void CHiddenDialog::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos) 
{
    if (!m_visible)
        lpwndpos->flags &= ~SWP_SHOWWINDOW;

    CDialog::OnWindowPosChanging(lpwndpos);
}

in your header file CHiddenDialog.h
void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);

Friday, 4 April 2014

No identities are available for signing XCode 5 fix

It's a simple fix once you know how.

  1. On the apple website go to Certificates, Identifiers & Profiles in the Developer Center.
  2. Create a new provisioning profile in Provisioning Profiles / Distribution
  3. Click download profile and open it on the Mac machine. (double click on the download).
  4. Restart XCode.
  5. In the build settings, select the 'iPhone Distribution' in the build settings. (Release)
  6. In the build settings, Provisioning profile select the new profile loaded above.
  7. Product menu-->Archive and follow the instructions.

Friday, 1 February 2013

"KERNELBASE,dll", error 126 possible fix



  • Cannot find import; DLL may be missing, corrupt, or wrong version File "KERNALBASE.dll," error 126
  • The procedure entry point_except_handler4_common could net be located in the dynamic link library msvcrt.dll

If you can find a mfc42.dll in that product installation folder try removing it. the problem is with the new dll version.

Friday, 4 January 2013

VC6 Debug left process open issue on Windows 7 64bit fix


This happens when stopping the process through the vc6 debugger.
Change the file: Common/MSDev98/Bin/TLLOC.dll   6.0.8168.0
To the updated version is 6.0.8168.292

This will fix the left open issue.

Wednesday, 2 January 2013

How to delay start a program and optionally wait for internet connection before starting.

A Common issue in windows 7 is that when booting up the programs can run before the internet connection is made which causes issues. this small dos program was written for MS Outlook but it can be used for any program or file.

download: http://www.traction-software.co.uk/downloads/delaystart.exe   (148kb) dos program and put it somewhere on your hard disk. e.g. c:\

type delaystart.exe   for parameters. e.g.

c:\delaystart.exe

usage:-
-d(delay in seconds)
-n wait for internet connection (upto 50 retries)
-f<filename>
-h hide program window
-m minimize program window


e.g. DelayStart.exe -d10 -f"c:\testfile.exe"       will wait 10 seconds and run the testfile.exe
e.g. DelayStart.exe -n -f"c:\testfile.exe"       will wait for the internet connection to be successful before starting testfile.exe   (will try upto 50 times, approx 1 second+ per try)
---- with any file ----
e.g. DelayStart.exe -n -f"c:\myfile.pdf"       will wait for the internet connection to be successful before opening myfile.pdf in the default viewer  (will try upto 50 times, approx 1 second+ per try)


For boot up.
In the windows Startup folder, remove the outlook shortcut item and add a new shortcut to the DelayStart.exe file.

in the properties, shortcut target enter:-
c:\DelayStart.exe -n -f"C:\Program Files (x86)\Microsoft Office\OFFICE11\OUTLOOK.EXE"

double click on it to test it.

then reboot to test it again.

you can minimize the program in properties also.

This program is free for any use, if you find it useful and wish to donate $1 or more by paypal then click here.

Thanks.