Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8800 > unrolled thread

Problems getting DLL Functioncalls to work properly

Started byGuido <guido.reichert@gmx.de>
First post2012-03-01 10:32 +0000
Last post2012-03-02 12:51 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Problems getting DLL Functioncalls to work properly Guido <guido.reichert@gmx.de> - 2012-03-01 10:32 +0000
    Re: Problems getting DLL Functioncalls to work properly Szabolcs <szhorvat@gmail.com> - 2012-03-02 12:48 +0000
    Re: Problems getting DLL Functioncalls to work properly "Oleksandr Rasputinov" <oleksandr_rasputinov@ymail.com> - 2012-03-02 12:51 +0000

#8800 — Problems getting DLL Functioncalls to work properly

FromGuido <guido.reichert@gmx.de>
Date2012-03-01 10:32 +0000
SubjectProblems getting DLL Functioncalls to work properly
Message-ID<jinj73$cr4$1@smc.vnet.net>
I am having trouble to get DLL function calls to work properly on my
system. To start with the examples in the help documentation do not
work:

In[3]:= Needs["NETLink`"]
In[6]:= NETLink[]
Out[6]= LinkObject["C:\\Program Files\\Wolfram \
Research\\Mathematica\\8.0\\SystemFiles\\Links\\NETLink\\\
InstallableNET.exe", 16, 8]

In[7]:= getTickCount =
 DefineDLLFunction["GetTickCount", "kernel32.dll", "int", {}]

Out[7]= Function[Null,
 If[NETLink`DLL`Private`checkArgCount["GetTickCount", {##1}, 0],
  Wolfram`NETLink`DynamicDLLNamespace`DLLWrapper4`GetTickCount[##1], \
$Failed], {HoldAll}]

Where is my mistake?

Thanks for helping in advance

Guido

[toc] | [next] | [standalone]


#8826

FromSzabolcs <szhorvat@gmail.com>
Date2012-03-02 12:48 +0000
Message-ID<jiqfin$2d$1@smc.vnet.net>
In reply to#8800
On Thursday, 1 March 2012 12:32:03 UTC+2, Guido  wrote:
> I am having trouble to get DLL function calls to work properly on my
> system. To start with the examples in the help documentation do not
> work:
>
> In[3]:= Needs["NETLink`"]
> In[6]:= NETLink[]
> Out[6]= LinkObject["C:\\Program Files\\Wolfram \
> Research\\Mathematica\\8.0\\SystemFiles\\Links\\NETLink\\\
> InstallableNET.exe", 16, 8]
>
> In[7]:= getTickCount =
>  DefineDLLFunction["GetTickCount", "kernel32.dll", "int", {}]
>
> Out[7]= Function[Null,
>  If[NETLink`DLL`Private`checkArgCount["GetTickCount", {##1}, 0],
>   Wolfram`NETLink`DynamicDLLNamespace`DLLWrapper4`GetTickCount[##1], \
> $Failed], {HoldAll}]
>
> Where is my mistake?
>

You are saying that the examples in the docs do not work, but you did not show what happens or what error you get when you try to call getTickCount[].  Have you tried calling it?  That $Failed symbol is part of the function definition and not an error indication.

[toc] | [prev] | [next] | [standalone]


#8830

From"Oleksandr Rasputinov" <oleksandr_rasputinov@ymail.com>
Date2012-03-02 12:51 +0000
Message-ID<jiqfog$5s$1@smc.vnet.net>
In reply to#8800
On Thu, 01 Mar 2012 10:32:03 -0000, Guido <guido.reichert@gmx.de> wrote:

> I am having trouble to get DLL function calls to work properly on my
> system. To start with the examples in the help documentation do not
> work:
>
> In[3]:= Needs["NETLink`"]
> In[6]:= NETLink[]
> Out[6]= LinkObject["C:\\Program Files\\Wolfram \
> Research\\Mathematica\\8.0\\SystemFiles\\Links\\NETLink\\\
> InstallableNET.exe", 16, 8]
>
> In[7]:= getTickCount =
>  DefineDLLFunction["GetTickCount", "kernel32.dll", "int", {}]
>
> Out[7]= Function[Null,
>  If[NETLink`DLL`Private`checkArgCount["GetTickCount", {##1}, 0],
>   Wolfram`NETLink`DynamicDLLNamespace`DLLWrapper4`GetTickCount[##1], \
> $Failed], {HoldAll}]
>
> Where is my mistake?
>
> Thanks for helping in advance
>
> Guido
>

 From these outputs it does not look like there is any mistake. (Evidently  
you have called InstallNET[], as is required, although this call is not  
shown above.) Does getTickCount[] not return the expected value?

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web