How do I read from a version resource in Visual C++

This is an edited version of my original answer. bool GetProductAndVersion(CStringA & strProductName, CStringA & strProductVersion) { // get the filename of the executable containing the version resource TCHAR szFilename[MAX_PATH + 1] = {0}; if (GetModuleFileName(NULL, szFilename, MAX_PATH) == 0) { TRACE(“GetModuleFileName failed with error %d\n”, GetLastError()); return false; } // allocate a block of … Read more

How do I find out which JAXP implementation is in use and where it was loaded from?

It is quite difficult to predict what concrete JAXP factory implementation will be loaded without actually creating an instance because the process for selecting an implementation. From the Official JAXP FAQ (Question 14): When an application wants to create a new JAXP DocumentBuilderFactory instance, it calls the staic method DocumentBuilderFactory.newInstance(). This causes a search for … Read more

How to synchronise the publish version to the assembly version in a .NET ClickOnce application?

sylvanaar’s last line looks like the way to go, in my experience; but with the caveat that it is only available to deployed versions of the application. For debugging purposes, you might want something like: static internal string GetVersion() { if (ApplicationDeployment.IsNetworkDeployed) { return ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString(); } return “Debug”; }

How to determine Delphi Application Version

Here is how I do it. I put this in almost all of my small utilities: procedure GetBuildInfo(var V1, V2, V3, V4: word); var VerInfoSize, VerValueSize, Dummy: DWORD; VerInfo: Pointer; VerValue: PVSFixedFileInfo; begin VerInfoSize := GetFileVersionInfoSize(PChar(ParamStr(0)), Dummy); if VerInfoSize > 0 then begin GetMem(VerInfo, VerInfoSize); try if GetFileVersionInfo(PChar(ParamStr(0)), 0, VerInfoSize, VerInfo) then begin VerQueryValue(VerInfo, ‘\’, … Read more

Java API to find out the JDK version a class file is compiled for?

import java.io.*; public class ClassVersionChecker { public static void main(String[] args) throws IOException { for (int i = 0; i < args.length; i++) checkClassVersion(args[i]); } private static void checkClassVersion(String filename) throws IOException { DataInputStream in = new DataInputStream (new FileInputStream(filename)); int magic = in.readInt(); if(magic != 0xcafebabe) { System.out.println(filename + ” is not a valid … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)