can anyone help me figure out how to use dll in c++ using visual studio?

Nestharus

o-o
Reaction score
84
I got it working : )


Ok, here are the steps I took
#1: Configuration Properties -> Environment
PATH=<path to dll>

#2: C/C++ -> General -> Additional Include Directories
include path to header file (in src)

#3: Link -> General -> Additional Library Directories
Include path to .lib file (in bin)

#4: Link -> Input -> Additional Dependencies
Include lib file in bin

#5:
Include this in any file where you are using StormLib stuff
#include "StormLib.h"


And that is all. You don't need the dll to be in the same directory as exe and you don't need any of the files to be in the project. I got it to compile with methods in there with 0 errors ; )
 

Sevion

The DIY Ninja
Reaction score
413
Too bad the Create method isn't creating anything

Code:
#include "StdAfx.h"
#include "StormLib.h"

int Test()
{
	int result = 0;
	HANDLE *mpq = 0;
	result = SFileCreateArchive("test", MPQ_CREATE_ARCHIVE_V1, HASH_TABLE_SIZE_MIN, mpq);
	if (result == 0)
		result = GetLastError();
	SFileCloseArchive(mpq);
	delete mpq;
	return result;
}

Fails to produce anything. "result" ends up being 0 and then 87 after getting the error code.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top