I have created a c++ project, using cmake as a build system. It compiles successfully on windows (visual studio) and Linux (GCC).
On Linux platform, GCC does an explicit type conversion without any error, e.g.
from size_t to unsigned short but on windows it throws error.
How can I do the explicit type conversion using a cmake option on windows too?
Related
I have been using the Debenu PDFLibrary successfully for some time. I decided to update the library to the latest version (DebenuPDFLibrary64Lite1113.dll). That's when everything went sideways.
I followed the instructions for installing, including the registering of the DLL. The registration process did not produce an error. The registry contains the CLSID shown below.
My environment is 64 bit Windows 8.1 Pro with .NET 4.5.1 framework. All updates are installed. The development environment is Visual Basic .NET using VS 2013 Community Edition.
When I try to use the library as I have in the past, I get this error:
Retrieving the COM class factory for component with CLSID
{924F2468-6F4E-4E90-BCD3-A81D43ED8759} failed due to the following
error: 80040154 Class not registered (Exception from HRESULT:
0x80040154 (REGDB_E_CLASSNOTREG)).
Here is the code:
Try
PDFDoc = New PDFLibrary(STR_PDFLibrary)
Catch ex As InteropServices.COMException
_TerminalErrors.Add(String.Format("Error loading PDFLibrary{0}{1}{0}{2}", vbCrLf, ex.Message, ex.StackTrace))
Exit Function
End Try
I've looked at the questions on this error in StackOverflow but cannot figure out the way to get this to work.
It might be that you registered the 64-bit edition of the ActiveX but your project was set to x86 (32-bit).
You can try the following test:
Unregister both 32-bit and 64-bit versions of the Lite ActiveX
regsvr32 [path here]\DebenuPDFLibrary64Lite.dll /u
regsvr32 [path here]\DebenuPDFLibraryLite.dll /u
Register only the 64-bit version of the Lite ActiveX
regsvr32 [path here]\DebenuPDFLibrary64Lite.dll
Create a Visual Studio VB.NET project and set the platform to x86 (not AnyCPU or x64)
Run the app and see if it shows the same error message
If this test does show the same error message then there are two options for you:
Option 1: Register both the 32-bit and 64-bit versions of the Lite ActiveX
This will allow you to have any platform setting in your project (x86, AnyCPU or x64)
or
Option 2: Change the project settings to x64
The 32-bit version of the Lite ActiveX won't have to be registered but the application will only work on 64-bit systems.
I have a VB6 application that connects to a Type Library (.TLB). The .TLB is stored in the Syswow64 folder on my development PC (because it is a 64 bit machine), however it is stored in the System32 folder on the live server (because it is a 32 bit machine).
How do I change the reference to the System32 folder before/after compiling the VB application?
The Type Library exposes types in a VB.NET DLL.
You should recreate the type library in the application folder:
Start a command prompt with Visual Studio tools by going to Start=>All Programs=>Microsoft Visual Studio xx=>Visual Studio Tools=>Visual Studio Command Prompt (2010)
Use CD to get to the application folder (with the VB.NET DLL in it).
Type: REGASM <assemblyname.dll> /tlb:<assemblyname.tlb> /codebase
Now add the reference to VB6.
I have project I've made in visual studio that contains an executable and dll which it calls. Everything works fine when I build them for the 64 bit machine I have visual studio on, but when I change the platform to Win32 compile the executable and dll and attempt to run it on my win8 32 bit machines I get the following error two messages on (two different machines):
The program can't start because MSVCR110.dll is missing from your
computer. Try reinstalling the program to fix this problem.
and:
The procedure entry point
?in#?$codecvt#DDH#std##QBEHAAHPBD1AAPBDPAD3AAPAD#2 could not be
located in the dynamic link library.
I developed the project in visual studio 2010. That exe file is not supported for other PC's.
which dotnetframework to be installed? other than dotnetframework is there any other requirements needed?
Are you sure it's not the CPU type you specified during compiling (x86 vs x64 CPU). If you compiled in 64-bit and a user only has a 32-bit processor (x86), your code won't run.
The .Net Framework should work on any PC-based system, but be sure to include it in your deployment or setup package. (you can provide Excel, .NET Framework, and many other packages with your package.)
You should also try to find out what error messages your users are receiving -- which will point you in the right direction.
I've created a 32bit DLL in Borland C++ Builder XE2 no problem.
I was tasked to create a 64bit version as well. After researching the "hows" I came to know that Builder does not yet support 64bit compilations.
After some digging around it looked as though the only way to do this ( or any kind of 64bit compiling) was to use visual studio express command lines. Thus I tried the following commands to try to compile:
CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /x64
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cl.exe" -IC:\projects\dll -I"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\include\windows\vcl" -I"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\include\windows\rtl" -MD -LD C:\projects\dll\dll.cpp -FeMyDLL.dll
Running the above gives me the following error:
C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\include\windows\rtl\sysmac.h(162) : fatal error C1189: #error : "System.hpp/sysmac.h and related headers need __declspec(uuid(..)) and __uuidof support"
Mucking about on Google only gave me some posts on adding #define DECLSPEC_UUID(guid) which doesn't help at all.
So my question is, has anyone ever successfully compiled a Borland C++ project (or an application / DLL created in Borland) for 64 bit (plus a step-by-step on how)?
You cannot compile C++Builder RTL/VCL code with Visual Studio. You will have to either port the code to Visual C++ or other C++ compiler and use its frameworks instead of Embarcadero's, or else re-write the code in Delphi XE2 so you can continue using Embarcadero's RTL/VCL and the Delphi 64-bit compiler.