Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 03:37

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



C++ Dll mit AutoIt callen --> Return String bzw. Char

Discussion on C++ Dll mit AutoIt callen --> Return String bzw. Char within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2010
Posts: 62
Received Thanks: 4
C++ Dll mit AutoIt callen --> Return String bzw. Char

Sers Com,
Nicht Funktionierendes Beispiel:

AutoIt:
Code:
$string="h"
$Returned=DllCall("Dll-Test.dll","char:cdecl","string","char",$string)
MsgBox(0,"DLL-Test",$Returned)
C++ Dll:
Code:
extern "C" 
{
    std::string __declspec (dllexport) MyString (string a)
    {
        return a;
    }
}
Jetzt bekomme ich aber immer 0 zurück wenn ich mein AutoIt Skript ausführe, mit nem Integer/Double/Float etc. funktioniert alles wenn ich diese returne..

Funktionierendes Beispiel:

AutoIt:
Code:
$a=10
$b=5
$add=DllCall("DLLTutorial.dll","double:cdecl","add","double",$a, "double", $b)
MsgBox(0,"DLL-Test",$a&"+"&$b& " is:"&$add[0])
C++ Dll:
Code:
extern "C" double __declspec(dllexport) add (double a, double b)
{
    return a+b;
}
Vllt. könnte mir jemand sagen wie ich das schaffe einen String oder einen Char zurückzugeben?

Lg
Mr. Pancake-Trader is offline  
Old 01/19/2011, 17:10   #2
 
elite*gold: 0
Join Date: Jul 2010
Posts: 62
Received Thanks: 4
Weis den niemand wie man sowas zurückgeben kann?

---> #Push# <---
Mr. Pancake-Trader is offline  
Old 01/19/2011, 17:42   #3
 
xNopex's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 827
Received Thanks: 471
Frage dich selber folgendes:
Zu std::string: Kann AutoIt mit einer Instanz einer C++ - Klasse umgehen?
Zu char*: Kann AutoIt mit einer Speicheradresse umgehen?
xNopex is offline  
Old 01/19/2011, 18:25   #4
 
elite*gold: 0
Join Date: Jul 2010
Posts: 62
Received Thanks: 4
Stimmt, aber gibt es den keine Möglchkeit das AutoIt "beizubringen"? Weil ich möchte eig. nicht nen Char in seinen Ascii Code konvertieren und wieder zurück..

€: @xNopex, hattest du nicht mal ein andres Forum? Wos auch um C++ ging? oder verwechsel ich dich da?
Mr. Pancake-Trader is offline  
Old 01/21/2011, 16:08   #5
 
HardCore.1337's Avatar
 
elite*gold: 1
Join Date: Feb 2009
Posts: 1,726
Received Thanks: 729
Code:
MsgBox(0,"DLL-Test",$Returned[0])
HardCore.1337 is offline  
Old 01/22/2011, 11:05   #6
 
elite*gold: 0
Join Date: Jul 2010
Posts: 62
Received Thanks: 4
Code:
C:\Dokumente und Einstellungen\Administrator\Desktop\Dll Test.au3 (3) : ==> Subscript used with non-Array variable.:
Habe ich auch schon versucht
Das funktioniert nur wenn etwas zurückgegeben wird, nur bei nem String/Char als Rückgabewert funzt das net..
Bei nem Integer, Double usw. geht das natürlich, und es kommt kein Fehler.
Mr. Pancake-Trader is offline  
Reply

Tags
autoit, c++, dll, return, string


Similar Threads Similar Threads
(cSro )WTS Char with 550k sp on Kings Return
07/25/2010 - Silkroad Online Trading - 0 Replies
Hi, i want to sell account with 550k sp, all stats on str. Server Kings return. i can give gold for extra price. more info [email protected]
[C++] char[] to string conversion
07/23/2010 - C/C++ - 2 Replies
hi, I have a problem with conversion char to string. char GetUnitName() { char cUnitName; memcpy(cUnitName,(void*)0x007E7A38,16); return cUnitName;
autoit binary to string??
02/09/2010 - AutoIt - 10 Replies
hey also ich will ne exe in nen source code zurück konvertieren (wenn das überhaupt geht mit autoit) mein bisheriger code^^



All times are GMT +1. The time now is 03:38.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.