Jump to content

piccaso

MVPs
  • Posts

    872
  • Joined

  • Last visited

1 Follower

About piccaso

  • Birthday 08/30/1981

Profile Information

  • Member Title
    Rock me, Amadeus!
  • Location
    Austria, Vienna

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

piccaso's Achievements

Universalist

Universalist (7/7)

0

Reputation

  1. nah, could be better latest version is here: http://therap.svn.sourceforge.net/viewvc/t...20by%20Piccaso/
  2. Check out PcHelpware Its a free component (dll) from the ultravnc devs. iirc i posted an example on theyr forums on how to use it with autoit...
  3. replace 'long_ptr' with 'long*' and it will work again
  4. here's a concept that should work... #include<sqlite.au3> $ppszRow = ;mysql_fetch_row(res) $uiLen = ;mysql_num_fields(res) dim $aRow[$uiLen],$vPointers = DllStructCreate("ptr[" & $uiLen & "]",$ppszRow) Do $uiLen -= 1 $aRow[$uiLen] = _szStringRead(DllStructGetData($vPointers,1,$uiLen+1)) Until $uiLen = 0 Func _szStringRead($pszString, $uiLen = -1) Local $aStrLen, $vszString If $pszString = 0 Then Return "" If $uiLen < 1 Then $aStrLen = DllCall("msvcrt.dll", "int:cdecl", "strlen", "ptr", $pszString) If @error Then Return SetError(1, 0, "") $uiLen = $aStrLen[0] + 1 EndIf $vszString = DllStructCreate("char[" & $uiLen & "]", $pszString) If @error Then Return SetError(2, 0, "") Return SetError(0, $iLen, DllStructGetData($vszString, 1)) EndFunc
  5. http://msdn2.microsoft.com/ if you seek information on some particular function you can also use google: site:microsoft.com <function>
  6. Thank you Valik. I got it to work on other compilers too, but for some reason borlands still requires stdio.h to be included. Probably my mistake, i'm more familiar with C, not much into that '++' The only reason for using C++ was to get the typeof(T).name() functionality...
  7. I was tired of searching and translating headers to find the right DllCall/DllStruct type to use so i made 2 Macros to help with that: t(<Type>) Displays Size and Primitive typeType can be a Type, Constant or an existing variable. c(<Constant>) Translates constants into AutoIt Code Tested with Gnu c++ 3.x, Borland C++ 5.5.1, MSVC8 Here is the source with some examples: // Headers reqired by Macros #include <typeinfo> // typeid #include <cstdio> // printf #ifdef __GNUG__ #include <cstdlib> // free #include <cstring> // strlen #include <cxxabi.h> // abi::__cxa_demangle #endif // __GNUG__ // Macros #define c(c) std::printf("Global Const $%s = 0x%X\n",#c,c); #define _s(s) std::printf("sizeof(%s) = %d (0x%X) Bytes, %d Bit",#s,sizeof(s),sizeof(s),sizeof(s)*8) #ifdef __GNUG__ // Workaroud for crappy g++ typeid(T).name() #define t(t) _s(t);__demangle(typeid(typeof(t)*).name(),#t); void __demangle(const char * type, char*s){ int st; size_t n; char* unm = abi::__cxa_demangle(type,NULL,0,&st); if (unm != NULL){ n = strlen(unm);unm[n-1]=0; printf(", Primitive: %s\n",unm); free(unm); } else printf("\ntype: %s error: %d unmangled: %s\n",s,st,type); } #else // __GNUG__ #define t(t) _s(t);std::printf(", Primitive: %s\n",typeid(t).name()); #endif // NOT __GNUG__ /////////////////////// // Include headers here /////////////////////// #include <windows.h> int main (){ ////////////////// // Use Macros Here ////////////////// t(size_t); t(LPDWORD); t(HRESULT); t(LRESULT); t(ATOM); t(HGDIOBJ); t(LPWSTR); // Display primitive of constants t(STD_INPUT_HANDLE); t(INVALID_HANDLE_VALUE); t(TIME_ZONE_ID_INVALID); // Display primitive of variables PFLOAT pf; t(pf); // Translating Constants c(STATUS_WAIT_0); c(STATUS_ABANDONED_WAIT_0) c(STATUS_USER_APC); c(STATUS_TIMEOUT); c(STATUS_PENDING); return 0; } This does not only work with windows header, and its pretty usefull if you are translating from headers like libcurl which some macro maniac wrote. Most of the windows types are easily identified by their naming but still some of them might be confusing. For example: I would think that 'HRESULT' is a handle and use 'ptr' or 'hwnd' which might work but in order to be correct it should be 'long'. If someone of you has similar tricks or improvement ideas on this one please post them
  8. looks like a pointer to me... typedef DBFInfo * DBFHandle; But we're both right
  9. DllCall returns an Array (your first post doesn't look like you realised that) try this: $dll = DllOpen("shapelib.dll") Dim $lRet,$sPath,$hDBF $sPath = @ScriptDir & "\test" $hDBF = DllCall($dll, "ptr", "DBFCreate", "str", $sPath) $lRet = DllCall($dll, "int", "DBFAddField", "ptr", $hDBF[0], "str", "name", "int", 1, "int", 10, "int", 0) DllCall($dll, "int", "DBFWriteIntegerAttribute","ptr", $hDBF[0], "int", 0, "int", 0, "int", 10) DllCall($dll, "none", "DBFClose", "ptr", $hDBF[0]) DllClose($dll)
  10. Welcome to the forums But this part of the forum if for reporting AutoIt Bug's, so next time please post into 'General Help and Support'. Depending on what you want to assign to this variable it might be one of these: $VarSoft = "WinActivate(""Setup"")" $VarSoft = WinActivate("Setup")
  11. that's because AutoitX is a dynamic library, you cant use it as a static library.
  12. i have no idea what OPC is but try this: $oOpc = ObjCreate("OPC.Automation") if @error Then Exit -1 $aServers = $oOpc.GetOPCServers() for $i = 0 to UBound($aServers) ConsoleWrite($aServers[$i] & @CRLF) Next Dont forget to register the dll before doing that
  13. Did you try setting up a Hook which 'eats' certain scan codes?
×
×
  • Create New...