|
19. 07. 2007. | #1 |
dinosaurus
Master
Datum učlanjenja: 29.12.2005
Lokacija: Nova Engleska
Poruke: 636
Hvala: 79
263 "Hvala" u 66 poruka
|
Radi.
Kôd:
#include <windows.h> #include <vector> using namespace std; int main() { HINSTANCE hLibrary = ::LoadLibrary("C:\\Documents and Settings\\NTrifunovic\\My Documents\\Visual Studio 2005\\Projects\\consoletest\\fipewin.dll"); typedef int (CALLBACK* f_type)(char*, int); f_type get_system_fingerprint = (f_type) GetProcAddress(hLibrary, "fipe_GetSystemFingerprint"); int size = get_system_fingerprint(0, 0); vector<char> buf(size); get_system_fingerprint(&buf[0], size); } |
19. 07. 2007. | #2 |
VD IT Direktora
Invented the damn thing
Datum učlanjenja: 08.06.2005
Lokacija: Beograd
Poruke: 2.118
Hvala: 503
1.307 "Hvala" u 282 poruka
|
Radi i iz .NET-a. Nisam siguran da ne može lakše, ali:
Kôd:
using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; namespace ConsoleApplication1 { public class fipe { [DllImport(@"D:\Work\Javram\ConsoleApplication1\fipewin.dll", CallingConvention=CallingConvention.Cdecl)] public unsafe static extern int fipe_GetSystemFingerprint(byte *rStr, int rStrSize); } class Program { unsafe static void Main(string[] args) { String s = null; int size = 0; size = fipe.fipe_GetSystemFingerprint(null, 0); byte[] b = new byte[size]; fixed (byte* p = b) { fipe.fipe_GetSystemFingerprint(p, size); } s = Encoding.ASCII.GetString(b); Console.WriteLine(s); } } } |
19. 07. 2007. | #3 |
emperor Selassie
Grand Master
|
Ovo mi je prvi DLL koji pišem pa sam u početku pisao kako nije trebalo i onda nije radio u drugim programskim jezicima, međutim sad vidim da radi.
Hvala vam obojici puno! Poslednja izmena od Nemanja Avramović : 19. 07. 2007. u 15:49. |
|
|