Note that there are some explanatory texts on larger screens.

plurals
  1. POError LNK2019 when using GetFileVersionInfoSize()
    primarykey
    data
    text
    <p>I just included this bit in my already working code, but I am getting an LNK2019 error. I'll paste the error after pasting the code.</p> <p>The Class CAboutDlg has:</p> <pre><code>public: CStatic m_VersionInfoCtrl; virtual BOOL OnInitDialog(); }; </code></pre> <p>The Function itself:</p> <pre><code>BOOL CAboutDlg::OnInitDialog() { CDialog::OnInitDialog(); CString inFileName = AfxGetApp()-&gt;m_pszExeName; inFileName += ".exe"; void * theVersionInfo; void * theFixedInfo; unsigned long aVersionInfoSize = GetFileVersionInfoSize ( inFileName , &amp;aVersionInfoSize); CString returnString; if (aVersionInfoSize) { theVersionInfo = new char [aVersionInfoSize]; GetFileVersionInfo ( inFileName, 0 , aVersionInfoSize, theVersionInfo) ; unsigned int aSize = 0; VerQueryValue( theVersionInfo , "\\" , &amp;theFixedInfo , &amp;aSize); if (theFixedInfo) { VS_FIXEDFILEINFO * aInfo = (VS_FIXEDFILEINFO *) theFixedInfo; DWORD dwMajorVersionMsb = HIWORD( aInfo-&gt;dwFileVersionMS ); DWORD dwMajorVersionLsb = LOWORD( aInfo-&gt;dwFileVersionMS ); DWORD dwMinorVersionMsb = HIWORD( aInfo-&gt;dwFileVersionLS ); DWORD dwMinorVersionLsb = LOWORD( aInfo-&gt;dwFileVersionLS ); returnString.Format("Version %d . %d . %d. %d",dwMajorVersionMsb,dwMajorVersionLsb,dwMinorVersionMsb,dwMinorVersionLsb); //memcpy(sVer,returnString.GetBuffer(),returnString.GetLength()+1); } delete theVersionInfo; } m_VersionInfoCtrl.SetWindowText(returnString); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } </code></pre> <p>....</p> <p>Its giving me the following three errors:</p> <pre><code>1.RangemasterGenerator error LNK2019: unresolved external symbol _VerQueryValueA@16 referenced in function "public: virtual int __thiscall CAboutDlg::OnInitDialog(void)" (?OnInitDialog@CAboutDlg@@UAEHXZ) 2.RangemasterGenerator error LNK2019: unresolved external symbol _GetFileVersionInfoA@16 referenced in function "public: virtual int __thiscall CAboutDlg::OnInitDialog(void)" (?OnInitDialog@CAboutDlg@@UAEHXZ) 3.RangemasterGenerator error LNK2019: unresolved external symbol _GetFileVersionInfoSizeA@8 referenced in function "public: virtual int __thiscall CAboutDlg::OnInitDialog(void)" (?OnInitDialog@CAboutDlg@@UAEHXZ) </code></pre> <p>... I am not able to understand what the problem is. Can anyone help please. Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload