Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
Get MyDocuments path? #265848
05/14/09 16:13
05/14/09 16:13
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Is it possible to get the MyDocuments Path into a string? And if so, how? Please don't post guesses. I really need a working example.

Re: Get MyDocuments path? [Re: oliver2s] #265867
05/14/09 17:44
05/14/09 17:44
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Get MyDocuments path? [Re: WretchedSid] #265870
05/14/09 18:02
05/14/09 18:02
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
@sylar the link is the one for windows mobile wink
normal version:
http://msdn.microsoft.com/en-us/library/bb762204(VS.85).aspx
csidl list:
http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx

here is a quick and dirty dll that gets documents paths:
http://www.quadraxas.com/out/documents_path_dll.rar

dll source:
Code:
#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
#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	// always define before including adll.h
#include "adll.h"	

///////////////////////////////////////////////////////////////////////
// the following function MUST be defined in your DLL

// DLL main entry point - normally this needs not to be changed
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;
}


updated: it was getting allusers/documents, now it returns teh path of user's my documents folder



Last edited by Quadraxas; 05/14/09 18:13.

3333333333
Re: Get MyDocuments path? [Re: Quad] #265877
05/14/09 19:53
05/14/09 19:53
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Thank you for your effort Quadraxas. When I run your example script I get a "Empty prototype called in Lite-C" error. What could be the reason?

Re: Get MyDocuments path? [Re: oliver2s] #265878
05/14/09 19:54
05/14/09 19:54
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
you extracted the dll too?


3333333333
Re: Get MyDocuments path? [Re: Quad] #265881
05/14/09 19:59
05/14/09 19:59
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Yes, but it seems the engine can't open the dll, whether in the acknex_plugin folder nor in the work folder of the example script.

Re: Get MyDocuments path? [Re: oliver2s] #265882
05/14/09 20:01
05/14/09 20:01
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
strange it runs just fine on me, can ayone else try it?

also are you using 7.77, and you are not seeing this right?


you may also try defining a PRAGMA_PLUGIN

Last edited by Quadraxas; 05/14/09 20:11.

3333333333
Re: Get MyDocuments path? [Re: Quad] #265919
05/15/09 05:35
05/15/09 05:35
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Not working, because the DLL isn't opened. Don't know why.
EDIT: I'm using A7.77 Commercial.

Last edited by Cowabanga; 05/15/09 05:36.
Re: Get MyDocuments path? [Re: Cowabanga] #265923
05/15/09 05:56
05/15/09 05:56
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
If I copy copy other DLLs in the work folder they get opened, but your's doesn't. Really strange. I have no I idea what could cause this problem.

Re: Get MyDocuments path? [Re: oliver2s] #265934
05/15/09 07:03
05/15/09 07:03
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
i dont think that it's needed but a c++ redist package may help...
http://www.microsoft.com/downloads/detai...;displaylang=en


3333333333
Page 1 of 3 1 2 3

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1