Questions tagged [declspec]

67 questions
1
vote
1 answer

Cannot pass AutoSeededRandomPool as parameter when using CryptoPP::RSA, error C2729

I am working with implement RSA using Crypto++. I am trying to generate a pair of RSA keys (public and private) to file like this. The code can run perfect when I put all in main. When I try to split it to a function and pass AutoSeededRandomPool…
Andiana
  • 1,912
  • 5
  • 37
  • 73
1
vote
2 answers

Cannot allocate memory dynamically in loop (a function eats all the memory)

When I run the code below, on the second iteration of the loop the whole OS hangs. If I open the task manager, it cleary shows that there's a huge memory leak. After I start the code execution, all the memory is gone in 4 seconds. Here's the…
Denis Yakovenko
  • 3,241
  • 6
  • 48
  • 82
1
vote
1 answer

Find the associated dll file to __declspec(dllexport)

I got this massive project with many classes with definitions in dll files. I need to extract a part of this project and create a new project from that part. I have managed to find some dll files by using the Code Map in Visual Studio but some…
Rasmus
  • 65
  • 2
  • 11
1
vote
1 answer

Including header files from libraries when building a new library

To be clear: I'm aware that the below example demonstrates a dll-dependancy, i.e. one library is not self-containe, but depends on another library to function. Let's say I'm creating a runtime library, Utility.dll, which contains various useful…
jensa
  • 2,792
  • 2
  • 21
  • 36
1
vote
0 answers

use of __declspec(dllexport)

I am making my .dll library implemented in OOP manner my macros are: #ifndef _SWC_ #define DLLINTERFACE __declspec(dllexport) #else #define DLLINTERFACE __declspec(dllimport) after I put DLLINTERFACE before a class name using some stds on it,…
mr5
  • 548
  • 1
  • 5
  • 14
1
vote
0 answers

C2487 with boost members

I try to reorganize our project from static libs into shared libraries of the subprojects. Well, using VS Compiler all exporting classes needs a _declspec(dllexport) and importing them needs _declspec(dllimport). Works fine. But I got troubles with…
550
  • 1,070
  • 1
  • 13
  • 28
1
vote
1 answer

how to pass dynamic value in __declspec(uuid(" ComObjectGUID ") )

In my code this works absolutely fine : class __declspec(uuid("842E12D3-1F2C-435D-8426-BE42150AF4DB")) guid; but instead of passing a staitc value I want to pass something like this, but it gives compilation error : string…
sanam_bl
  • 299
  • 1
  • 7
  • 14
1
vote
1 answer

Pygmalion transformation: using "#define DLL" as replacement for "extern "C" __declspec(dllexport)"

Is there a way to use a svelte #define to transform the unsightly ""extern \"C\" __declspec(dllexport)" into a single, enchanting term "DLL". That is: #define DLL "extern "C" __declspec(dllexport)" The problem, of course, is the embedded quote…
PaeneInsula
  • 2,010
  • 3
  • 31
  • 57
0
votes
3 answers

C++ __declspec( dllexport ) functions cannot access instance variables

I am trying to protect some C++ code by exporting as a DLL (on Windows/VS 2010). In the example below var is set in the superclass constructor, and the debugger shows it is definitely set to reference something. Test is constructed in the code that…
Paul Ridgway
  • 1,055
  • 2
  • 13
  • 23
0
votes
0 answers

Locating functions with IDIA SDK - strange results

I am trying to locate a specific function in a .pdb file. Originally I compiled a simple "hello, world" program, and analyzed the name of the functions using the IDiaSymbol::get_name method, but I couldn't locate my function. After this, I tried…
0
votes
1 answer

Calling c++ function (bcb6 dll/lib) function from 10.3 project

I've encountered a very confusing phenomenon trying to call a function of a borland c++ builder 6 dll defined as _declspec(dllexport) in combination with a nested struct pointer parameter. The struct declarations contain AnsiString, std::string and…
kvirk
  • 97
  • 1
  • 10
0
votes
0 answers

Is __declspec(dllexport) ignored if compiling a static library?

Currently I am taking an older static library I wrote, and trying to add functionality to allow it to be compiled as a .dll, (or .so). I've gone through and added a macro along the lines of: #define DLLEXPORT #ifdef SHARED #ifdef COMPILING …
kjhayes
  • 143
  • 7
0
votes
0 answers

Using __declspec results in "Error C2370 'In1': redefinition; different storage class"

I have a dll created using MSVC. The header file and a .def file are also present. Here is what is exported from the dll (simple.def): EXPORTS simple_initialize simple_step simple_terminate In1 Gain Increment I have a simple application that is…
0
votes
0 answers

About program export variables

The graphics card manufacturer has an optimization scheme. The following variables are exported from the program, and the program will be executed with an independent graphics card. For the program compiled by the new version of the bcc compiler,…
0
votes
0 answers

Preprocessor definition for __declspec(dllexport)

Is it possible to define this as a preprocessor definition? I'm trying to do this: #if defined _WIN32 #define DLL_EXPORT __declspec(dllexport) #else #define DLL_EXPORT #endif so that I can build this library for both Mac and Windows. There's a…