Skip to content
This repository was archived by the owner on Oct 16, 2022. It is now read-only.

Commit c8974de

Browse files
Some Changes
1 parent fa8f8f3 commit c8974de

File tree

7 files changed

+39
-16
lines changed

7 files changed

+39
-16
lines changed

Readme.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
+----------------------+
2+
|Shark String Converter|
3+
+----------------------+
4+
5+
To use this, you need to include the file SharkStringConverter.h and add SharkStringConverter.dll to the files to link.
6+
7+
There are 2 secure functions:
8+
#--------------------------------------#
9+
# #
10+
#| char * stringtochar(std::string); #
11+
#| std::string chartostring(char*); #
12+
# #
13+
#--------------------------------------#
14+
15+
The function
16+
| char * stringtochar(std::string);
17+
convert the std::string to char*. the char* has the [lenght of the string +2] but only the [lenght of the string +1] will copyed to the new char.
18+
19+
After use the char* you should free the memory with the free function of | #include <stdlib.h>
20+
21+
22+
23+
24+
The function
25+
| std::string chartostring(char*);
26+
does that what is says, it convert a char to a string
27+
28+
� Sharkbyteprojects

SharkStringConverter.sln

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SharkStringConverter", "Sha
77
EndProject
88
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test", "Test\Test.vcxproj", "{3BF93258-F47F-4D68-97CE-13233D309632}"
99
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{967BF83A-68FD-4C14-ABAB-C463C8BF2AC5}"
11+
ProjectSection(SolutionItems) = preProject
12+
Readme.txt = Readme.txt
13+
EndProjectSection
14+
EndProject
1015
Global
1116
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1217
Debug|x64 = Debug|x64

SharkStringConverter/SharkStringConverter.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
// SharkStringConverter.cpp : Hiermit werden die exportierten Funktionen für die DLL definiert.
2-
//
3-
41
#include "pch.h"
52
#include "framework.h"
63
#include "SharkStringConverter.h"
74
using namespace std;
85

9-
SHARKSTRINGCONVERTER_API char * stringtochar(string stri)
6+
SHARKSTRINGCONVERTER_API char* stringtochar(string stri)
107
{
118
int lengthd = stri.length() + 1;
12-
char* content{ (char*)malloc(lengthd) };
9+
char* content{ (char*)malloc(lengthd + 1) };
1310
if (content == nullptr || content == NULL) {
1411
throw ("Malloc Err");
1512
return (char*)"";
1613
}
17-
strcpy_s(content,(rsize_t)lengthd, stri.c_str());
14+
strcpy_s(content, (rsize_t)lengthd, stri.c_str());
1815
return content;
1916
}
2017
SHARKSTRINGCONVERTER_API string chartostring(char* stri)

SharkStringConverter/dllmain.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// dllmain.cpp : Definiert den Einstiegspunkt für die DLL-Anwendung.
21
#include "pch.h"
32

43
BOOL APIENTRY DllMain( HMODULE hModule,

SharkStringConverter/framework.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#pragma once
22

3-
#define WIN32_LEAN_AND_MEAN // Selten verwendete Komponenten aus Windows-Headern ausschließen
4-
// Windows-Headerdateien
3+
#define WIN32_LEAN_AND_MEAN
54
#include <windows.h>
65
#include <stdlib.h>
76
#include <sstream>

SharkStringConverter/pch.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
// pch.cpp: Quelldatei, die dem vorkompilierten Header entspricht
2-
3-
#include "pch.h"
4-
5-
// Bei der Verwendung vorkompilierter Header ist diese Quelldatei für eine erfolgreiche Kompilierung erforderlich.
1+
#include "pch.h"

SharkStringConverter/pch.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef PCH_H
22
#define PCH_H
33

4-
// Fügen Sie hier Header hinzu, die vorkompiliert werden sollen.
54
#include "framework.h"
65

7-
#endif //PCH_H
6+
#endif

0 commit comments

Comments
 (0)