Latest Entries »

target audience:

    people w/ no control over the DLL-source, unable to change behavior of DLL
    people who don’t want to pass an input-parameter to the DLL, which will be filled w/ the result in most other cases
    people who want to call a callback-function/sub inside Access

recommended reading:
http://msdn.microsoft.com/en-us/library/ms811463 or
http://oreilly.com/catalog/win32api/chapter/ch06.html

more reading:
http://blogs.msdn.com/b/ericlippert/archive/2003/09/12/52976.aspx
http://www.codeproject.com/KB/string/bstrsproject1.aspx

my working sample:

Option Compare Database
Option Explicit

Declare Sub WebGISConn_init Lib "P:\doswin\LDA\IPFLink\20110920\IPFLink.dll" Alias "IPFLink_init" (ByVal WebGISConn_CallBack As Long)
Declare Sub WebGISConn_showFeaturesInIMS Lib "P:\doswin\LDA\IPFLink\20110920\IPFLink.dll" Alias "IPFLink_showFeatureIDStringWithInterfaceInIMS" (ByVal feats As String, ByVal interf As String)

Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)
Declare Function lstrlenA Lib "kernel32" (ByVal lpString As Long) As Long
'
' testwrapper for easy call from "immediate window"
'
Public Sub testWebGIS()
    Call initWebGIS
    Call openWebGIS(428300001)
End Sub
'
' this SUB will be called from an external DLL
' e.g. clicked on a button in firefox w/ webgis
'
Public Sub WebGISConn_CallBack(ByVal interf As Long, ByVal feats As Long)
    
    Dim idList As String
    Dim layerInterface As String
        
    On Error Resume Next
    
    Debug.Print "dll is calling ... " & LPSTRtoBSTR(interf) & LPSTRtoBSTR(feats)
    '
    ' TODO: open form w/ data
    '
End Sub
'
' open object in browser w/ webgis
'
Public Sub openWebGIS(ByRef Id As Variant)
    Dim idList As String
    Dim layerInterface As String
   
    idList = CStr(Id)
    layerInterface = "LDA_obertaegigeDenkmale"
        
    Call WebGISConn_showFeaturesInIMS(idList, layerInterface)
End Sub
'
' init DLL
' register access-callbackfunction
'
Public Sub initWebGIS()
    Call WebGISConn_init(AddressOf WebGISConn_CallBack)
End Sub

'
' convert C-null-terminated string from DLL to vba BSTR string
'
Function LPSTRtoBSTR(ByVal lpsz As Long) As String
 
' Input: a valid LPSTR pointer lpsz
' Output: a sBSTR with the same character array
 
Dim cChars As Long
 
' Get number of characters in lpsz
cChars = lstrlenA(lpsz)
 
' Initialize string
LPSTRtoBSTR = String$(cChars, 0)
 
' Copy string
CopyMemory ByVal StrPtr(LPSTRtoBSTR), ByVal lpsz, cChars
 
' Convert to Unicode
LPSTRtoBSTR = Trim0(StrConv(LPSTRtoBSTR, vbUnicode))
 
End Function

Public Function Trim0(sName As String) As String
   ' Right trim string at first null.
   Dim x As Integer
   x = InStr(sName, vbNullChar)
   If x > 0 Then Trim0 = Left$(sName, x - 1) Else Trim0 = sName
End Function

w/ XAMPP 1.7.4, Symfony 2.0.1

http://localhost/Symfony/web/config.php gives us:


Recommendations
...
1 .Install and enable a PHP accelerator like APC (highly recommended).
2. Install and enable the intl extension.
3. Set short_open_tag to off in php.ini*.

solution:
(1) install corresponding php_apc.dll, add extension=php_apc.dll to php.ini
(2) mod_intl.dll exist, enable it in php.ini, but you need to have to copy all icu*36.dll files from your-xampp-path\php to your-xampp-path\apache\bin
(3) bad default-xampp-php.ini, “short_open_tag” is set twice – once “off” and once “on” two lines later, comment the latter out

http://localhost/Symfony/web/config.php is still not satisfied:


Recommendations
...
1. Upgrade your intl extension with a newer ICU version (4+).

damn … I’m just one minute away from deinstalling xampp and take full control

after switching to ActivePerl on XAMPP (Windows) I thought the server was ready for a simple Bugzilla:Win32Install

but after updating all perl-modules and installing the required and optional modules (if available for win32) checksetup.pl failed

#perl checksetup.pl
...
Invalid version format (negative version number) at Bugzilla/Install/Requirements.pm line ...

it’s a known bug and it’s already fixed and committed and should be included in future version (> 4.0.2).
until then you have to patch it yourself with: patch, v1 (925 bytes, patch)

- tested with xampp 1.7.4
- install activeperl (e.g. 5.12.4.1205) to c:\usr
- open a shell c:\usr\bin
- add corresponding repo and install corresponding mod_perl.so (only needed to run as module)


#ppm repo add UWinnipeg http://cpan.uwinnipeg.ca/PPMPackages/12xx/
#ppm install mod_perl

- if running as module copy new mod_perl.so to your-xampp-apache-path\modules
- edit apache.conf add “ScriptInterpreterSource Registry-Strict”

<Directory "C:/dev/xampp/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks Includes ExecCGI

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all
    
    ScriptInterpreterSource Registry-Strict

</Directory>

- edit your-xammp-apache-path\extra\httpd_perl.conf
- comment out “PerlPostConfigRequire”-line
- if running as non-module comment out LoadFile … n’ LoadModule … lines
- if running as module correct path/filename

LoadFile "C:/usr/bin/perl512.dll"
LoadModule perl_module modules/mod_perl.so
#PerlPostConfigRequire "C:/dev/xampp/apache/conf/extra/startup.pl"
...

- add following registry entry (you may use apache_cgi.reg):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command]
@="C:\\usr\\bin\\perl.exe -T"

- restart apache
- test perl via your fav. www-browser and a file w/ following content

#!/usr/bin/perl
print "Content-type:text/html\n\n";
print "hello world";

- optional install HTML::Perlinfo

  #ppm install HTML-Perlinfo

- test with your fav. www-browser and a file w/ following content

#!/usr/bin/perl

use HTML::Perlinfo;
use CGI qw(header);

$q = new CGI;
print $q->header;

$p = new HTML::Perlinfo;
$p->info_general;
$p->info_variables;
$p->info_modules;
$p->info_license;

  • tested w/ windows 7 RC 7100 x64
  • longer “readme.txt” w/ advice for v64, se7en64 (see below)
  • see download section


and remember for all 64-versions of vista and se7en:

- turn off  ”digital driver signature enforcement” in bootmenu, every time you boot, se7en still complains (first) time with a popup “unsigned driver could not be loaded … blabla” but driver is loaded and running

- or use Driver Signature Enforcement Overrider (http://www.ngohq.com/home.php?page=dseo)

  • v64sp1 and svr08-64 didn´t accept my last *.inf
  • rewrote inf from scratch
  • new inf works also with win xp sp 3 build 5508
  • should also work with svr08-32, vista32(sp1), w2k
  • see download section
  • v64 didn´t accept my old *.inf for x64
  • so here a updated one w/ driver (only amd64)
  • see download section
  • another Sega Saturn news …
  • now I have a “REAL” PRO ACTION REPLAY with USB-port from pinchy, thx.
  • because of lack of a windows x64 driver for Cypress EZ-USB FX2 for my AMD64 system
  • I build a windows x64 driver for Cypress EZ-USB FX2 for e.g.: Cypress EZ-USB FX2 (68613) – EEPROM missing
  • includes a rebuild for windows xp sp2 32bit with latest ddk, maybe also working with w2k, wxp sp1, wxp
  • both w/ and w/o hack for large transfer
  • see download section

with all the Sega Saturn stuff, with silent release of TyRaNiD’s debugger

http://www.schemionneck.de/d500/tlbblog/download/