forked from pierr3/ModeS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ogruetzmann/Development
v 1.3.6e32
- Loading branch information
Showing
20 changed files
with
392 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
#include "stdafx.h" | ||
#include "Helpers.h" | ||
|
||
std::string LoadUpdateString(PluginData p) | ||
{ | ||
const std::string AGENT { "EuroScopeModeS/" + std::string { p.PLUGIN_VERSION } }; | ||
HINTERNET connect = InternetOpen(AGENT.c_str(), INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); | ||
if (!connect) { | ||
throw error { "Connection Failed. Error: " + std::to_string(GetLastError()) }; | ||
} | ||
|
||
HINTERNET OpenAddress = InternetOpenUrl(connect, p.UPDATE_URL, NULL, 0, INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_RELOAD, 0); | ||
if (!OpenAddress) { | ||
InternetCloseHandle(connect); | ||
throw error { "Failed to load URL. Error: " + std::to_string(GetLastError()) }; | ||
} | ||
|
||
char DataReceived[256]; | ||
DWORD NumberOfBytesRead { 0 }; | ||
std::string answer; | ||
while (InternetReadFile(OpenAddress, DataReceived, 256, &NumberOfBytesRead) && NumberOfBytesRead) | ||
answer.append(DataReceived, NumberOfBytesRead); | ||
|
||
InternetCloseHandle(OpenAddress); | ||
InternetCloseHandle(connect); | ||
return answer; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,21 @@ | ||
#include "stdafx.h" | ||
#include "ModeS.h" | ||
#include "ModeS2.h" | ||
#include "EuroScopePlugIn.h" | ||
|
||
|
||
CModeS * gpMyPlugin = NULL; | ||
CModeS * gpMyPlugin = NULL; | ||
|
||
//---EuroScopePlugInInit----------------------------------------------- | ||
|
||
void __declspec (dllexport) EuroScopePlugInInit(EuroScopePlugIn::CPlugIn ** ppPlugInInstance) | ||
void __declspec (dllexport) EuroScopePlugInInit(EuroScopePlugIn::CPlugIn ** ppPlugInInstance) | ||
{ | ||
//AFX_MANAGE_STATE(AfxGetStaticModuleState()) | ||
|
||
// create the instance | ||
* ppPlugInInstance = gpMyPlugin = new CModeS(); | ||
// create the instance | ||
*ppPlugInInstance = gpMyPlugin = new CModeS(); | ||
} | ||
|
||
|
||
//---EuroScopePlugInExit----------------------------------------------- | ||
|
||
void __declspec (dllexport) EuroScopePlugInExit(void) | ||
void __declspec (dllexport) EuroScopePlugInExit() | ||
{ | ||
//AFX_MANAGE_STATE(AfxGetStaticModuleState()) | ||
|
||
// delete the instance | ||
delete gpMyPlugin; | ||
// delete the instance | ||
delete gpMyPlugin; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
#pragma once | ||
#include "EuroScopePlugIn.h" | ||
#include "ModeS2.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.