dllexport

Symbol exporting problem using __declspec(dllexport)

I use __declspec(dllexport) with several methods in a library. But one of the symbols do not get exported properly. The value in question is called "restart". I've given the output from dumpbin.exe, below: 1 0 0002DB27 ev_err = @ILT+2850(_ev_err) 2 1 0002DADC m_foutput = @ILT+2775(_m_foutput) 3 2 0002D361 m_...

Exporting static data in a DLL

I have a DLL which contains a class with static members. I use __declspec(dllexport) in order to make use of this class's methods. But when I link it to another project and try to compile it, I get "unresolved external symbol" errors for the static data. e.g. In DLL, Test.h class __declspec(dllexport) Test{ protected: static int d;...

Unresolved external symbol

I have two WIN32 DLL projects in the solution, main.dll should call a function in mgn.dll. mgn.dll has mgn.h header file: #ifdef MGN_EXPORTS #define MGN_API __declspec(dllexport) #else #define MGN_API __declspec(dllimport) #endif extern "C" bool MGN_API AttachMGN(void); and mgn.cpp source file: #include "stdafx.h" #include "mgn.h" ...

Creating a C# DLL and using it from unmanaged C++

I have a native (unmanaged) C++ application (using wxWidgets for what it's worth). I'm considering a separate tool application to be written in C# which would contain winform-based dialogs. putting some of those dialogs in a separate DLL would be useful as I'd hope to be able to use them from my C++ app. But I have no idea how much mess...

I want to use some Matlab functions via .DLLs in a .NET program

I want to use some Matlab functions via .dlls and use them in C#, please let me know how to do that. ...

C++ DLL-Linking UnResolved Externals

I have a rather big Core project that I'm working with, I'm attempting to adapt it to use a DLL Engine I've built, I'm getting a bunch of errors like: unresolved external symbol "private: static class When including some of the headers from the Core in the DLL, the class is exported via __declspec(dllexport) but any header with static ...

How to wrap two unmannaged C++ functions into two managed C# functions?

I've got two unmanaged C++ functions, Compress and Decompress. The arguments and returns go as followed: unsigned char* Compress (unsigned char*,int) unsigned char* Decompress (unsigned char*,int) Where all uchars are arrays of uchars. Could someone please help me lay out a way to convert these into managed C# code using the Byte[] a...

How to take all types from PE file after parsing it in Managed C++(CLI)?

Hello, I need to extract the types from PE files. e.g if whole class exported , I should have all exported methods(whole signature including return type) and their types(i.e class as Type) OR IF whole class not exported but just functions exported, I should be able to get class as Type of those methods and all exported methods of that c...

DLL export of a static function

Hi all - I have the following static function: static inline HandVal StdDeck_StdRules_EVAL_N( StdDeck_CardMask cards, int n_cards ) Can I export this function in a DLL? If so, how? Thanks, Mike Background information: I'm doing this because the original source code came with a VS project designed to compile as a sta...

i am exporting dll but GetProcAddress returning 127 error ,how to resolve it ?

#include "Calc.h" #include<iostream> #include <windows.h> #include <WINERROR.H.> typedef void (WINAPI * PCTOR) (); int main() { HMODULE hMod = LoadLibrary (L"Calci.dll"); if (NULL == hMod) { printf ("LoadLibrary failed\n"); return 1; } CCalc *pCCalc = (CCalc *) malloc (sizeof (CCalc)); if (NULL ==...

VBA/excel to dll/exe for Java

Hi, I have an excel file with mannually input functions, which use an add-in from a third party. I want to use functionalities of the excel file in Java. I could think of two ways of doing it. code the functions in VBA, or VB with excel reference, then generate .dll or .exe files for Java to use. Feed data to excel file using jxl (wou...

Exporting C++ classes from DLL

Hi, I came across this article on Code Project that talks about using an abstract interface as an alternative to exporting an entire class from a C++ DLL to avoid name mangling issues. The author has a Release() method in his interface definition that is supposed to be called by the user to free the class object's resources after using i...

Windows dll exports when the function doesn't exist (or doesn't seem to exist)

If you inspect a dll using depends.exe (Dependency Walker) it shows you the functions that the dll exports. In Windows 98, when I look at user32.dll, it lists both MessageBoxA and MessageBoxW. Similarly, kernel32.dll lists both GetModuleFileNameA and GetModuleFileNameW. MSDN descriptions for these two functions state that MessageBox is ...

TortoiseGit export like TortoiseSvn export?

How do you export a GIT file map so you just keep the local files without GIT files? The tortoiseGIT export keeps some GIT files hanging around (and only does a zip export), and the 'delete (keep local)' option isn't helping either it seems. ...

Creating a class with static pointers to explicitly loaded DLL functions

Hello all, I want to have multiple instances of a DLLInterface class but as each object will have pointers to the same DLL functions I want these to be static. The below code doesn't compile. (I do have a reason for needing multiple instances containing the same pointers which the stripped down code below doesn't illustrate.) //Heade...

How to amend DLLs

Hello experts, We are using an external Dlls as : [DllImport("DemoExport.dll")] public static extern string GetDBConnection(string sDBName); [DllImport("DemoExport.dll")] public static extern int CreateEmptyDBFromDB(string SourceDBName, string DestinationDBName); [DllImport("DemoExport.dll")] Now, we want to add new m...

A warning with building 64bit dll

dll export header extern "C" void _declspec(dllexport) __stdcall foo(); .def file EXPORTS foo @1 When I build the dll by 64bit build config, I meet this warning. warning LNK4197: export 'foo' specified multiple times; using first specification But If I build the dll by 32bit build config, the warning never occurs. Wha...

How Can I call a C++ Win32 DLL from another C++ win32 Console Application

What is my main concern is , I am able to write a C++ dll using VC++ . Now the dll is present in the Debug folder. How can I use my DLL in other C++ Console Application. How to add reference or link the DLL to the application. Another point, While creating a DLL , The VC++ wizard gives me thre option: An Empty DLL project A Simple DL...

Missing entry point for x64 DLL project

I create a simple dll project with visual studio 2010 wizard, haven't filled any code. When I build it on Win32 platform, everything works fine. The problem is when I switch to x64 platform, there is Link error. 2>LINK : fatal error LNK1561: entry point must be defined The export marco has been define in the stdafx.h like: #define A...

Linker error with debug build with different compiler versions

Hello, We have a DLL, built with MS Visual Studio 2010, in release mode. We provide this DLL to different customers, along with a .lib file. The functions in the DLL are exported with: extern "C" __declspec(dllexport) int analyze(int id); Our customers have two applications that makes use of this DLL. Both of these applications im...