Add project files.
This commit is contained in:
parent
911e8c20b8
commit
98ce055ab5
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 16
|
||||||
|
VisualStudioVersion = 16.0.31911.196
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TCPSender", "TCPSender\TCPSender.vcxproj", "{420274EF-2DFC-446E-94BA-88DEA9E512DE}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{420274EF-2DFC-446E-94BA-88DEA9E512DE}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{420274EF-2DFC-446E-94BA-88DEA9E512DE}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{420274EF-2DFC-446E-94BA-88DEA9E512DE}.Debug|x86.ActiveCfg = Release|Win32
|
||||||
|
{420274EF-2DFC-446E-94BA-88DEA9E512DE}.Debug|x86.Build.0 = Release|Win32
|
||||||
|
{420274EF-2DFC-446E-94BA-88DEA9E512DE}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{420274EF-2DFC-446E-94BA-88DEA9E512DE}.Release|x64.Build.0 = Release|x64
|
||||||
|
{420274EF-2DFC-446E-94BA-88DEA9E512DE}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{420274EF-2DFC-446E-94BA-88DEA9E512DE}.Release|x86.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {4F4DD1E2-D760-4E9A-9C7D-F45DAF63775D}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#include <windows.h>
|
||||||
|
#include <cstdint>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
|
struct InfoForExtension
|
||||||
|
{
|
||||||
|
const char* name;
|
||||||
|
int64_t value;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SentenceInfo
|
||||||
|
{
|
||||||
|
const InfoForExtension* infoArray;
|
||||||
|
int64_t operator[](std::string propertyName)
|
||||||
|
{
|
||||||
|
for (auto info = infoArray; info->name; ++info) // nullptr name marks end of info array
|
||||||
|
if (propertyName == info->name) return info->value;
|
||||||
|
return *(int*)0xcccc = 0; // gives better error message than alternatives
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SKIP {};
|
||||||
|
inline void Skip() { throw SKIP(); }
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
#include "extension.h"
|
||||||
|
|
||||||
|
bool ProcessSentence(std::wstring& sentence, SentenceInfo sentenceInfo);
|
||||||
|
|
||||||
|
/*
|
||||||
|
You shouldn't mess with this or even look at it unless you're certain you know what you're doing.
|
||||||
|
Param sentence: pointer to sentence received by Textractor (UTF-16).
|
||||||
|
This can be modified. Textractor uses the modified sentence for future processing and display. If empty (starts with null terminator), Textractor will destroy it.
|
||||||
|
Textractor will display the sentence after all extensions have had a chance to process and/or modify it.
|
||||||
|
The buffer is allocated using HeapAlloc(). If you want to make it larger, please use HeapReAlloc().
|
||||||
|
Param sentenceInfo: pointer to array containing misc info about the sentence. End of array is marked with name being nullptr.
|
||||||
|
Return value: the buffer used for the sentence. Remember to return a new pointer if HeapReAlloc() gave you one.
|
||||||
|
This function may be run concurrently with itself: please make sure it's thread safe.
|
||||||
|
It will not be run concurrently with DllMain.
|
||||||
|
*/
|
||||||
|
extern "C" __declspec(dllexport) wchar_t* OnNewSentence(wchar_t* sentence, const InfoForExtension* sentenceInfo)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
std::wstring sentenceCopy(sentence);
|
||||||
|
int oldSize = sentenceCopy.size();
|
||||||
|
if (ProcessSentence(sentenceCopy, SentenceInfo{ sentenceInfo }))
|
||||||
|
{
|
||||||
|
if (sentenceCopy.size() > oldSize) sentence = (wchar_t*)HeapReAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, sentence, (sentenceCopy.size() + 1) * sizeof(wchar_t));
|
||||||
|
wcscpy_s(sentence, sentenceCopy.size() + 1, sentenceCopy.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (SKIP)
|
||||||
|
{
|
||||||
|
*sentence = L'\0';
|
||||||
|
}
|
||||||
|
return sentence;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,341 @@
|
||||||
|
// TODO
|
||||||
|
// Button Connect/Disconnect instead of retry
|
||||||
|
// Persistence
|
||||||
|
#include "extension.h"
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
#include <codecvt>
|
||||||
|
#include <condition_variable>
|
||||||
|
#include <deque>
|
||||||
|
#include <locale>
|
||||||
|
#include <mutex>
|
||||||
|
#include <string>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <winsock2.h>
|
||||||
|
#include <ws2tcpip.h>
|
||||||
|
#include <strsafe.h>
|
||||||
|
|
||||||
|
using std::lock_guard;
|
||||||
|
using std::mutex;
|
||||||
|
using std::string;
|
||||||
|
using std::wstring;
|
||||||
|
using std::wstring_convert;
|
||||||
|
using std::codecvt_utf8_utf16;
|
||||||
|
|
||||||
|
#pragma comment (lib, "Ws2_32.lib")
|
||||||
|
#pragma comment (lib, "Mswsock.lib")
|
||||||
|
#pragma comment (lib, "AdvApi32.lib")
|
||||||
|
|
||||||
|
#define MSG_Q_CAP 10
|
||||||
|
#define CONFIG_APP_NAME L"TCPSend"
|
||||||
|
#define CONFIG_ENTRY_REMOTE L"Remote"
|
||||||
|
#define CONFIG_FILE_NAME L"Textractor.ini"
|
||||||
|
|
||||||
|
std::thread comm_thread;
|
||||||
|
std::atomic<bool> comm_thread_run;
|
||||||
|
std::atomic<bool> sock_reconnect;
|
||||||
|
std::deque<wstring> msg_q;
|
||||||
|
mutex msg_q_mut;
|
||||||
|
std::condition_variable msg_q_cv;
|
||||||
|
|
||||||
|
SOCKET _connect();
|
||||||
|
wstring remote = L"localhost:30501";
|
||||||
|
bool _send(SOCKET &, string const &);
|
||||||
|
|
||||||
|
wstring config_file_path;
|
||||||
|
|
||||||
|
HWND hwnd = NULL;
|
||||||
|
|
||||||
|
wstring getEditBoxText(HWND hndl, int item) {
|
||||||
|
if (hwnd == NULL)
|
||||||
|
return L"";
|
||||||
|
|
||||||
|
int len = GetWindowTextLength(GetDlgItem(hndl, item));
|
||||||
|
if (len == 0)
|
||||||
|
return L"";
|
||||||
|
|
||||||
|
wchar_t* buf = (wchar_t*)GlobalAlloc(GPTR, (len + 1) * sizeof(wchar_t));
|
||||||
|
if (buf == NULL)
|
||||||
|
return L"";
|
||||||
|
|
||||||
|
GetDlgItemText(hndl, item, buf, len + 1);
|
||||||
|
|
||||||
|
wstring tmp = wstring{ buf };
|
||||||
|
GlobalFree(buf);
|
||||||
|
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
void log(string const& msg) {
|
||||||
|
if (hwnd == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
wstring cur = getEditBoxText(hwnd, IDC_LOG);
|
||||||
|
if (cur.length() > 0)
|
||||||
|
cur += L"\r\n";
|
||||||
|
|
||||||
|
wstring tmp =
|
||||||
|
cur + wstring_convert<codecvt_utf8_utf16<wchar_t>>().from_bytes(msg);
|
||||||
|
SetDlgItemText(hwnd, IDC_LOG, tmp.c_str());
|
||||||
|
SendMessage(GetDlgItem(hwnd, IDC_LOG), EM_LINESCROLL, 0, INT_MAX);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connect to remote and wait for messages in queue to send until comm_thread_run is false
|
||||||
|
*/
|
||||||
|
void comm_loop()
|
||||||
|
{
|
||||||
|
using namespace std::chrono_literals;
|
||||||
|
WSADATA wsaData;
|
||||||
|
|
||||||
|
log("Starting comm loop");
|
||||||
|
|
||||||
|
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
|
||||||
|
log("Could not initialize WSA. Exit");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SOCKET sock = _connect();
|
||||||
|
|
||||||
|
comm_thread_run = true;
|
||||||
|
while (comm_thread_run) {
|
||||||
|
if (sock == INVALID_SOCKET) {
|
||||||
|
log("Connection failed. Retrying soon.");
|
||||||
|
std::this_thread::sleep_for(1000ms);
|
||||||
|
sock = _connect();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (sock_reconnect) {
|
||||||
|
log("Reconnecting");
|
||||||
|
closesocket(sock);
|
||||||
|
sock = _connect();
|
||||||
|
sock_reconnect = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_lock<mutex> lk{msg_q_mut};
|
||||||
|
if (msg_q.empty()) {
|
||||||
|
msg_q_cv.wait(lk);
|
||||||
|
} else {
|
||||||
|
// Remove first element, unlock, push back on error
|
||||||
|
wstring msg = msg_q.front();
|
||||||
|
msg_q.pop_front();
|
||||||
|
lk.unlock();
|
||||||
|
|
||||||
|
string msg_utf8 =
|
||||||
|
wstring_convert<codecvt_utf8_utf16<wchar_t>>{}.to_bytes(msg);
|
||||||
|
log("Sending '" + msg_utf8 + "'");
|
||||||
|
|
||||||
|
if (!_send(sock, msg_utf8)) {
|
||||||
|
log("Error sending");
|
||||||
|
closesocket(sock);
|
||||||
|
sock = INVALID_SOCKET;
|
||||||
|
lk.lock();
|
||||||
|
if (msg_q.size() < MSG_Q_CAP)
|
||||||
|
msg_q.push_front(msg);
|
||||||
|
lk.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log("Comm cleanup and exit");
|
||||||
|
|
||||||
|
closesocket(sock);
|
||||||
|
WSACleanup();
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL CALLBACK DialogProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
switch (message)
|
||||||
|
{
|
||||||
|
case WM_INITDIALOG:
|
||||||
|
{
|
||||||
|
SetDlgItemText(hWnd, IDC_REMOTE, remote.c_str());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
case WM_COMMAND:
|
||||||
|
{
|
||||||
|
switch (LOWORD(wParam))
|
||||||
|
{
|
||||||
|
case IDC_BTN_SUBMIT:
|
||||||
|
{
|
||||||
|
remote = getEditBoxText(hWnd, IDC_REMOTE);
|
||||||
|
sock_reconnect = true;
|
||||||
|
msg_q_cv.notify_one();
|
||||||
|
|
||||||
|
bool succ = WritePrivateProfileString(
|
||||||
|
CONFIG_APP_NAME, CONFIG_ENTRY_REMOTE, remote.c_str(), config_file_path.c_str());
|
||||||
|
if (!succ) {
|
||||||
|
LPVOID lpMsgBuf;
|
||||||
|
DWORD dw = GetLastError();
|
||||||
|
FormatMessage(
|
||||||
|
FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||||
|
FORMAT_MESSAGE_FROM_SYSTEM |
|
||||||
|
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||||
|
NULL,
|
||||||
|
dw,
|
||||||
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||||
|
(LPTSTR)&lpMsgBuf,
|
||||||
|
0, NULL);
|
||||||
|
MessageBox(NULL, (LPCTSTR)lpMsgBuf, TEXT("Error"), MB_OK);
|
||||||
|
log("Error setting config");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL WINAPI DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
|
||||||
|
{
|
||||||
|
switch (ul_reason_for_call)
|
||||||
|
{
|
||||||
|
case DLL_PROCESS_ATTACH:
|
||||||
|
{
|
||||||
|
wchar_t* buf;
|
||||||
|
|
||||||
|
// Get config
|
||||||
|
int buf_sz = (GetCurrentDirectory(0, NULL) + 1) * sizeof(wchar_t);
|
||||||
|
buf = (wchar_t*)GlobalAlloc(GPTR, buf_sz);
|
||||||
|
if (buf == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
GetCurrentDirectory(buf_sz, buf);
|
||||||
|
|
||||||
|
config_file_path = wstring{buf} + CONFIG_FILE_NAME;
|
||||||
|
GlobalFree(buf);
|
||||||
|
|
||||||
|
buf = (wchar_t*)GlobalAlloc(GPTR, 1000 * sizeof(wchar_t));
|
||||||
|
if (buf == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
GetPrivateProfileString(
|
||||||
|
CONFIG_APP_NAME, CONFIG_ENTRY_REMOTE, remote.c_str(), buf, 1000, config_file_path.c_str());
|
||||||
|
|
||||||
|
remote = wstring{buf};
|
||||||
|
GlobalFree(buf);
|
||||||
|
|
||||||
|
// Create window
|
||||||
|
hwnd = CreateDialogParam(hModule, MAKEINTRESOURCE(IDD_DIALOG1),
|
||||||
|
FindWindow(NULL, L"Textractor"), DialogProc, 0);
|
||||||
|
|
||||||
|
if (hwnd == NULL) {
|
||||||
|
MessageBox(NULL, L"Could not open plugin dialog", L"Error", 0);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start communication thread
|
||||||
|
comm_thread = std::thread{comm_loop};
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DLL_PROCESS_DETACH:
|
||||||
|
{
|
||||||
|
comm_thread_run = false;
|
||||||
|
msg_q_cv.notify_one();
|
||||||
|
if (comm_thread.joinable())
|
||||||
|
comm_thread.join();
|
||||||
|
|
||||||
|
if (hwnd != NULL)
|
||||||
|
CloseWindow(hwnd);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
SOCKET _connect() {
|
||||||
|
SOCKET sock;
|
||||||
|
struct addrinfo* result = NULL,
|
||||||
|
* ptr = NULL,
|
||||||
|
hints;
|
||||||
|
ZeroMemory(&hints, sizeof(hints));
|
||||||
|
hints.ai_family = AF_UNSPEC;
|
||||||
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
|
hints.ai_protocol = IPPROTO_TCP;
|
||||||
|
|
||||||
|
string remote_ch =
|
||||||
|
wstring_convert<codecvt_utf8_utf16<wchar_t>>{}.to_bytes(remote);
|
||||||
|
|
||||||
|
log("Connecting to " + remote_ch);
|
||||||
|
|
||||||
|
string::size_type pos = remote_ch.rfind(":");
|
||||||
|
string port = pos == string::npos ? "30501" : remote_ch.substr(pos + 1);
|
||||||
|
int res = getaddrinfo(remote_ch.substr(0, pos).c_str(), port.c_str(), &hints, &result);
|
||||||
|
if (res != 0) {
|
||||||
|
return INVALID_SOCKET;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ptr = result; ptr != NULL; ptr = ptr->ai_next) {
|
||||||
|
sock = socket(ptr->ai_family, ptr->ai_socktype, ptr->ai_protocol);
|
||||||
|
if (sock == INVALID_SOCKET) {
|
||||||
|
return sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
res = connect(sock, ptr->ai_addr, (int)ptr->ai_addrlen);
|
||||||
|
if (res == SOCKET_ERROR) {
|
||||||
|
closesocket(sock);
|
||||||
|
sock = INVALID_SOCKET;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
freeaddrinfo(result);
|
||||||
|
|
||||||
|
if (sock != INVALID_SOCKET)
|
||||||
|
log("Connection success");
|
||||||
|
|
||||||
|
return sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _send(SOCKET &sock, string const &msg) {
|
||||||
|
size_t len = msg.length();
|
||||||
|
size_t buf_len = len + 4;
|
||||||
|
char* buf = new char[buf_len + 1];
|
||||||
|
|
||||||
|
strcpy_s(buf + 4, buf_len - 4 + 1, msg.c_str());
|
||||||
|
*((uint32_t*)buf) = len;
|
||||||
|
|
||||||
|
for (size_t sent = 0, ret = 0; sent < buf_len; sent += ret) {
|
||||||
|
ret = send(sock, buf + sent, buf_len - sent, 0);
|
||||||
|
if (ret == SOCKET_ERROR) {
|
||||||
|
delete[] buf;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete[] buf;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Param sentence: sentence received by Textractor (UTF-16). Can be modified, Textractor will receive this modification only if true is returned.
|
||||||
|
Param sentenceInfo: contains miscellaneous info about the sentence (see README).
|
||||||
|
Return value: whether the sentence was modified.
|
||||||
|
Textractor will display the sentence after all extensions have had a chance to process and/or modify it.
|
||||||
|
The sentence will be destroyed if it is empty or if you call Skip().
|
||||||
|
This function may be run concurrently with itself: please make sure it's thread safe.
|
||||||
|
It will not be run concurrently with DllMain.
|
||||||
|
*/
|
||||||
|
bool ProcessSentence(wstring & sentence, SentenceInfo sentenceInfo)
|
||||||
|
{
|
||||||
|
if (sentenceInfo["current select"]) {
|
||||||
|
lock_guard<mutex> lock{ msg_q_mut };
|
||||||
|
|
||||||
|
if (msg_q.size() >= MSG_Q_CAP)
|
||||||
|
msg_q.pop_front();
|
||||||
|
|
||||||
|
msg_q.push_back(wstring{ sentence });
|
||||||
|
msg_q_cv.notify_one();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,168 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="ExtensionImpl.cpp" />
|
||||||
|
<ClCompile Include="TCPSender.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="resource.rc" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="Extension.h" />
|
||||||
|
<ClInclude Include="resource.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<VCProjectVersion>16.0</VCProjectVersion>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<ProjectGuid>{420274ef-2dfc-446e-94ba-88dea9e512de}</ProjectGuid>
|
||||||
|
<RootNamespace>TCPSender</RootNamespace>
|
||||||
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="Shared">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<TargetName>$(ProjectName)</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;TCPSENDER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableUAC>false</EnableUAC>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;TCPSENDER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableUAC>false</EnableUAC>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;TCPSENDER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableUAC>false</EnableUAC>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;TCPSENDER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableUAC>false</EnableUAC>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="ExtensionImpl.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="TCPSender.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="resource.rc">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="Extension.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="resource.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,105 @@
|
||||||
|
// Microsoft Visual C++ generated resource script.
|
||||||
|
//
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
|
//
|
||||||
|
#include <windows.h>
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// English (United States) resources
|
||||||
|
|
||||||
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
|
#pragma code_page(1252)
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// TEXTINCLUDE
|
||||||
|
//
|
||||||
|
|
||||||
|
1 TEXTINCLUDE
|
||||||
|
BEGIN
|
||||||
|
"resource.h\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
2 TEXTINCLUDE
|
||||||
|
BEGIN
|
||||||
|
"#include <windows.h>\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
3 TEXTINCLUDE
|
||||||
|
BEGIN
|
||||||
|
"\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Dialog
|
||||||
|
//
|
||||||
|
|
||||||
|
IDD_DIALOG1 DIALOGEX 0, 0, 309, 177
|
||||||
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION
|
||||||
|
CAPTION "Dialog"
|
||||||
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
|
BEGIN
|
||||||
|
EDITTEXT IDC_REMOTE,7,7,228,14,ES_AUTOHSCROLL
|
||||||
|
PUSHBUTTON "Connect",IDC_BTN_SUBMIT,252,7,50,14,BS_CENTER
|
||||||
|
EDITTEXT IDC_LOG,7,31,295,139,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// DESIGNINFO
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
GUIDELINES DESIGNINFO
|
||||||
|
BEGIN
|
||||||
|
IDD_DIALOG1, DIALOG
|
||||||
|
BEGIN
|
||||||
|
LEFTMARGIN, 7
|
||||||
|
RIGHTMARGIN, 302
|
||||||
|
TOPMARGIN, 7
|
||||||
|
BOTTOMMARGIN, 170
|
||||||
|
END
|
||||||
|
END
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// AFX_DIALOG_LAYOUT
|
||||||
|
//
|
||||||
|
|
||||||
|
IDD_DIALOG1 AFX_DIALOG_LAYOUT
|
||||||
|
BEGIN
|
||||||
|
0
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // English (United States) resources
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
||||||
Loading…
Reference in New Issue