DLL Question

Posted By: Logitek

DLL Question - 11/15/12 10:49

Hello,

I don't know if this is the right place.
But I will ask.

I have tried to compile a DLL with this source: It should only read the documents path.

Code:
#define WIN32_LEAN_AND_MEAN		
#include <windows.h>
#include <shlobj.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <math.h.>
// engine specific header file
#define DLL_USE	
#include "adll.h"	


BOOL APIENTRY DllMain( HANDLE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved )
{
// make sure the library is linked
	engine_bind();
    return TRUE;
}

char path[MAX_PATH];
DLLFUNC char* getDocumentsPath(){
	SHGetSpecialFolderPathA(NULL,path,CSIDL_MYDOCUMENTS,0);
	return path;
}



I have tried to compile this with the codeblocks 3dgs plugin wizard and the Codeblocks Version 10.05 GNU CC Compiler

But I get always error messages.

Like:

SHGetSpecialFolderPathA(NULL,path,CSIDL_MYDOCUMENTS,0); was not declared in the scope

and also CSIDL_MYDOCUMENTS
was not declared in the scope.

Is there anyone that can compile this short script to a dll with A7? Or what is wrong?

Maybe you can help me.

Beside: I know the folderpath.dll but I only need the mydocuments folder and I use C-Script. So I would need this short dll.
Posted By: jcl

Re: DLL Question - 11/15/12 11:04

I am not familiar with Codeblocks. We're using VC++, so I can help you when you compile your DLL with that compiler. But maybe other users have experience with Codeblocks?
Posted By: Dico

Re: DLL Question - 11/15/12 11:28

i think u need to add lib to your project
Posted By: Logitek

Re: DLL Question - 11/15/12 11:48

And how should I do this? I have also no experience with Codeblocks.
Posted By: Dico

Re: DLL Question - 11/15/12 11:58

click right on your project ---> Build Option ---> Linker Setting ---> Add
Posted By: Logitek

Re: DLL Question - 11/15/12 12:11

I got the same error messages:

SHGetSpecialFolderPathA(NULL,path,CSIDL_MYDOCUMENTS,0); was not declared in the scope

and also CSIDL_MYDOCUMENTS was not declared in the scope.
Posted By: 3dgs_snake

Re: DLL Question - 11/15/12 12:13

Quote:

And how should I do this? I have also no experience with Codeblocks.


Why don't you use Visual Studio then laugh ? This way you will have more help. I have also tested codeblocks but I prefer Visual Studio for plugin development.
Posted By: Logitek

Re: DLL Question - 11/15/12 12:17

I have also Visual C++ 2010 Express. But never used.
Posted By: Logitek

Re: DLL Question - 11/15/12 13:19

Hey, I have used now Visual C++ and everything is working fine.
laugh

One question:

Is such a dll also compatible with windows xp, vista and 7 or will there maybe a problem?
Posted By: MasterQ32

Re: DLL Question - 11/15/12 13:47

first important thing: publish your dll with Release Build, not with Debug
second: yes it will be usable if you don't use "new" features and it's compiled with correct compiler settings (x86)
Posted By: Logitek

Re: DLL Question - 11/15/12 13:56

Yes, I have build it with the Release Build. Thank you.
© 2024 lite-C Forums