|
Re: Downloading and Displaying Stock Market Data
[Re: jcl]
#415325
01/17/13 13:04
01/17/13 13:04
|
Joined: Jan 2013
Posts: 11
DejaVu
OP
Newbie
|
OP
Newbie
Joined: Jan 2013
Posts: 11
|
That's complicated, what would you recommend me to do? I mean I did all that's recommended to do, can you give me some step-by-step tutorial of how to compile the program which will download the data and save it in good way to produce the database? What are .dll files used for?
EDIT: Please.
Last edited by DejaVu; 01/17/13 13:04.
A name means nothing on the battlefield. After a week no one has a name.
|
|
|
Re: Downloading and Displaying Stock Market Data
[Re: jcl]
#415373
01/17/13 20:32
01/17/13 20:32
|
Joined: Jan 2013
Posts: 11
DejaVu
OP
Newbie
|
OP
Newbie
Joined: Jan 2013
Posts: 11
|
Ok, I got to this: #include <iostream> #include <Windows.h> #include <conio.h>
using namespace std;
typedef int (*MsgFunction)(int);
HINSTANCE hinstDLL ;
int main() { MsgFunction MsgBox(0) ; hinstDLL = LoadLibraryA("FXCM.dll") ; if(hinstDLL != 0) { MsgBox = (MsgFunction)GetProcAddress(hinstDLL, "MsgBox"); } if(MsgBox == 0) { cout << "MsgBox is NULL \n"; }
int x = MsgBox(5); if(x == 5) { cout << "Message Displayed! \n" ; }
FreeLibrary(hinstDLL) ; return 0 ; getch() ; } Works, how do I call BrokerOpen function, because I get this after I try to run the file
A name means nothing on the battlefield. After a week no one has a name.
|
|
|
Re: Downloading and Displaying Stock Market Data
[Re: DejaVu]
#415410
01/18/13 09:10
01/18/13 09:10
|
Joined: Jul 2000
Posts: 27,987 Frankfurt
jcl
Chief Engineer
|
Chief Engineer
Joined: Jul 2000
Posts: 27,987
Frankfurt
|
For BrokerOpen you need a different function type: typedef int (*BROKER_OPEN)(char* Name,FARPROC fpError,FARPROC fpProgress); and then
BROKER_OPEN BrokerOpen = (BROKER_OPEN)GetProcAddress(h,"BrokerOpen");
if(BrokerOpen) {
char brokername[50] = "";
long version = (*BrokerOpen)(brokername,NULL,NULL);
}
You can see on the "Broker Plugin" page which functions you have and how they must be typedef'd. For your purpose you only need BrokerLogin, BrokerAsset, and BrokerHistory.
|
|
|
Re: Downloading and Displaying Stock Market Data
[Re: DejaVu]
#415415
01/18/13 11:15
01/18/13 11:15
|
Joined: Jan 2013
Posts: 11
DejaVu
OP
Newbie
|
OP
Newbie
Joined: Jan 2013
Posts: 11
|
#include <iostream> #include <Windows.h> #include <conio.h>
using namespace std;
typedef int (*MsgFunction)(int); typedef int (*BROKER_OPEN)(char* Name,FARPROC fpError,FARPROC fpProgress);
HINSTANCE hinstDLL ;
int main() { MsgFunction MsgBox(0) ; hinstDLL = LoadLibraryA("FXCM.dll") ; if(hinstDLL != 0) { MsgBox = (MsgFunction)GetProcAddress(hinstDLL, "MsgBox"); } if(MsgBox == 0) { cout << "MsgBox is NULL \n"; }
int x = MsgBox(5); BROKER_OPEN BrokerOpen = (BROKER_OPEN)GetProcAddress(hinstDLL,"BrokerOpen"); if(BrokerOpen) { char brokername[50] = ""; long version = (*BrokerOpen)(brokername,NULL,NULL); }
if(x == 5) { cout << "Message Displayed! \n" ; }
FreeLibrary(hinstDLL) ; return 0 ; getch() ; } I got problem with higlighted part, you wrote h but it didn't work, I have tried to put it into as a variable-didn't work, so I put hinstDLL and when I try to run it with FXCM.dll it gives me: "Message box is NULL". EDIT: When I keep it this way #include <iostream> #include <Windows.h> #include <conio.h>
using namespace std;
typedef int (*MsgFunction)(int); typedef int (*BROKER_OPEN)(char* Name,FARPROC fpError,FARPROC fpProgress);
HINSTANCE hinstDLL ;
int main() { MsgFunction MsgBox(0) ; hinstDLL = LoadLibraryA("FXCM.dll") ; if(hinstDLL != 0) { MsgBox = (MsgFunction)GetProcAddress(hinstDLL, "MsgBox"); } if(MsgBox == 0) { cout << "MsgBox is NULL \n"; }
int x = MsgBox(5); if(x == 5) { cout << "Message Displayed! \n" ; } BROKER_OPEN BrokerOpen = (BROKER_OPEN)GetProcAddress(h,"BrokerOpen"); if(BrokerOpen) { char brokername[50] = ""; long version = (*BrokerOpen)(brokername,NULL,NULL); }
FreeLibrary(hinstDLL) ; return 0 ; getch() ; } I get this: 1>------ Build started: Project: DLLtutApp, Configuration: Debug Win32 ------ 1> main.cpp 1>c:\users\master roshi\documents\visual studio 2010\projects\dlltutapp\dlltutapp\main.cpp(34): error C2065: 'h' : undeclared identifier ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Last edited by DejaVu; 01/18/13 18:32.
A name means nothing on the battlefield. After a week no one has a name.
|
|
|
Re: Downloading and Displaying Stock Market Data
[Re: jcl]
#415539
01/20/13 00:49
01/20/13 00:49
|
Joined: Jan 2013
Posts: 11
DejaVu
OP
Newbie
|
OP
Newbie
Joined: Jan 2013
Posts: 11
|
Okay, sorry, I thought it was ment to be added in. I'll work on it, as you've said, in terms of tutorials provided by website, is there everything I need?
A name means nothing on the battlefield. After a week no one has a name.
|
|
|
|