dll

calling a c++ code from C# in x64 all arguments shift by one

假如想象 提交于 2020-01-02 08:11:54
问题 my c++ dll: int test2::CallMe(int y) { return y; } c# code: [DllImport("test2.dll",CharSet = CharSet.Anci)] private static extern int CallMe(int y); Console.WriteLine(CallMe(7)); if the dll and the test program are compiled in x86 i get a print: 7 but if i compile them at X64 for c++ and X64 or any CPU for c# the print is: 0 Any suggestion? edit: the problem is the call, because in debugger i see that the CPP receives 0 , or null in case of struct. edit 2: the functions are exported using a

calling a c++ code from C# in x64 all arguments shift by one

余生长醉 提交于 2020-01-02 08:11:23
问题 my c++ dll: int test2::CallMe(int y) { return y; } c# code: [DllImport("test2.dll",CharSet = CharSet.Anci)] private static extern int CallMe(int y); Console.WriteLine(CallMe(7)); if the dll and the test program are compiled in x86 i get a print: 7 but if i compile them at X64 for c++ and X64 or any CPU for c# the print is: 0 Any suggestion? edit: the problem is the call, because in debugger i see that the CPP receives 0 , or null in case of struct. edit 2: the functions are exported using a

Java 3D Hello World - Jar freeze

社会主义新天地 提交于 2020-01-02 07:30:13
问题 Hi guys I'm following this tutorial to build my first Java 3D application. I included in my project the java3D libraries and my DllLoader class that extracts (from the classpath to the jar's location) and loads the j3dcore-ogl.dll : public class DllLoader { private DllLoader() { } public static void extractAndLoad(String dll) throws IOException { int aux = dll.lastIndexOf('/'); if (aux == -1) { aux = dll.lastIndexOf('\\'); } File dllCopy = new File((aux == -1) ? dll : dll.substring(aux + 1));

Python DLL import error when importing vtk

巧了我就是萌 提交于 2020-01-02 07:29:41
问题 I need to use the VTK library (with version 5.10 because I am working on an existing code) in python on my Windows 10 machine but I can not manage to import it without DLLImport error: Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import vtk Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\vtk\__init__.py", line

C++ : Finding out decorated names

冷暖自知 提交于 2020-01-02 05:42:06
问题 How can I find out the decorated name that will be asigned to each method name ? I'm trying to find out what the decorated name is , so that I may export it , in a DLL . 回答1: .DEF file are still being used? Forget .DEF files. They are a thing of the past. Export your functions, be them C functions or C++ symbols, through __declspec(dllimport/dllexport). If you really need undecorated names, use as suggested by Greg Hewgill, the __declspec(dllimport/dllexport) keywords, combined with extern "C

How can i build project in visual studio 2012 on both way(dll and lib) together

送分小仙女□ 提交于 2020-01-02 05:02:23
问题 I managed to set up build project in dll mode and in library mode but not together: for build in dll: project->properties->Configuration Type: Dynamic Library (.dll) project->properties->Target Extension: .dll for build in library: project->properties->Configuration Type: Static library (.lib) project->properties->Target Extension: .lib it is possible to build both of them together? 回答1: Yes, you can have single project that can be used for .dll and .lib. Steps to be followed: Visual Studio

Reference project “readonly” in Visual Studio?

試著忘記壹切 提交于 2020-01-02 04:42:47
问题 I have two applications in two solutions in VS2008 that share a common dll, the dll-code is included as a project in the first applications solution. Is it possible to allow the second solution to reference the dll project "readonly"? I want whoever opens the second solution to be able to step into the dll during debugging but not be able to change the code. 回答1: I would simply build against the dll+pdb. The pdb is enough to step into code, without ever being able to edit it. You can enable

Use .Net (C#) dll in Python script

 ̄綄美尐妖づ 提交于 2020-01-02 04:35:08
问题 I'm attempting to port a simple C# command-line utility to Python. The C# program uses a custom .Net dll called foobar.dll that interfaces with some lab equipment via I2C. The usage of the dll in the C# code is as follows: fooBar.fooProvider provider = new foobar.fooProvider() fooBar.fooBarLib fooLib = new foobar.fooBarLib(provider, 0x80) # used below ... numFloat = fooLib.GetSomething() # more python ... fooLib.SetSomething(NumberAsAFloat) I thought about simply using ctypes to access the

renaming a third party dll in .net

 ̄綄美尐妖づ 提交于 2020-01-02 03:53:26
问题 I have created one tool using console application named "DocumentHashcode" in which I am using third party DLL - DocumentFormat.OpenXml.dll . When I'm going to deploy it, I am using DocumentHashcode.exe and DocumentFormat.OpenXml.dll for running the application. I want to rename DocumentFormat.OpenXml.dll to CATBldHashCodeSupporterDll.dll . Can anyone advise how to achieve this? 回答1: You need to manually load the assembly. The simplest way is to load it before the JITer tries to load the

How to use COM dll in my C++ program

走远了吗. 提交于 2020-01-02 02:55:09
问题 I wish to use a COM dll in my C++ library. The way I figured going about it, is to #import the dll's .tlb file, which I did : #import "mycom.tlb" no_namespace The problem is , I don't quite know where to place this declaration. should it be inside the H file or the CPP file? or maybe the stdafx.h file? I tried placing it in the .cpp file , just for testing. in the H file I have this member declared : ILogicSecuredPtr m_pbLogic; (where ILogicSecured is the interface I want to work with in my