Jump to content

DLLCall(): How to use it correctly for BLAT.DLL?


rudi
 Share

Recommended Posts

Hi.

This is my first try to use DLLCall() :), so pls be patient >_<

The latest version of blat can be found here.

I've found a web page describing the use of BLAT.DLL for VB and V-Foxpro6 here.

So I tried this one, which doesn't work. The LOG file isn't created at all, so I suspect, that the DLL call itself doesn't work?

$teststring='-server 10.27.1.5 -f sender@foo.com -to admin@bar.com -bodyF c:\somebody.txt -subject "just a long subject with spaces" -priority 1 -attach C:\WINDOWS\system32\cmd.exe'

$debug = " -debug -log c:\blatdebug.log"

; this doesn't seem to work at all.
BlatCall($teststring & $debug)

; this one works.
BlatExe($teststring & $debug)


Func BlatExe($CMDstring)
    $result=RunWait("C:\temp\blat\blat262\full\blat.exe " & $CMDstring)
    MsgBox(0,"Exit Code",$result)
    Run ("notepad c:\blatdebug.log")
EndFunc



Func BlatCall($CMDstring)
    $BlatDLL="C:\temp\blat\blat262\full\blat.dll"
    $result=DllCall($BlatDLL,"int","send","str",$CMDstring)
    MsgBox(0,"Exit Code",$result)
    Run ("notepad c:\blatdebug.log")
EndFunc

What do I miss?

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

Hi.

This is my first try to use DLLCall() :), so pls be patient >_<

The latest version of blat can be found here.

I've found a web page describing the use of BLAT.DLL for VB and V-Foxpro6 here.

So I tried this one, which doesn't work. The LOG file isn't created at all, so I suspect, that the DLL call itself doesn't work?

$teststring='-server 10.27.1.5 -f sender@foo.com -to admin@bar.com -bodyF c:\somebody.txt -subject "just a long subject with spaces" -priority 1 -attach C:\WINDOWS\system32\cmd.exe'

$debug = " -debug -log c:\blatdebug.log"

; this doesn't seem to work at all.
BlatCall($teststring & $debug)

; this one works.
BlatExe($teststring & $debug)


Func BlatExe($CMDstring)
    $result=RunWait("C:\temp\blat\blat262\full\blat.exe " & $CMDstring)
    MsgBox(0,"Exit Code",$result)
    Run ("notepad c:\blatdebug.log")
EndFunc



Func BlatCall($CMDstring)
    $BlatDLL="C:\temp\blat\blat262\full\blat.dll"
    $result=DllCall($BlatDLL,"int","send","str",$CMDstring)
    MsgBox(0,"Exit Code",$result)
    Run ("notepad c:\blatdebug.log")
EndFunc

I see fascists...

Link to comment
Share on other sites

two things

DllCall returns an array

DllCall function names are case sensitive

Thanks, it's working now.

I'm 100% sure that I've replied to your post before. Mentioning the question, that the case sensitivity of DLLCall() could be described in the description box on top of the help file for DLLCall() :)

Well, anyhow: >_< Thanks for pointing me to the right direction :idiot:

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

Thanks, it's working now.

Well, anyhow: :idiot: Thanks for pointing me to the right direction :P

Regards, Rudi.

glad to help

I'm 100% sure that I've replied to your post before. Mentioning the question, that the case sensitivity of DLLCall() could be described in the description

box on top of the help file for DLLCall() :)

maybe you did, and they changed something in the Matrix >_<

I see fascists...

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...