Re: So Delphi can't do this ...

From: Martin Harvey (Demon Account) (martin_at_pergolesi.demon.co.uk)
Date: 10/12/03


Date: Sun, 12 Oct 2003 19:08:39 +0100

On Sun, 12 Oct 2003 12:31:36 -0500, Brian Cook
<bcook@rowdydogsoftware[REMOVE].com> wrote:

>> The only thing that I can't figure out is that the structure is actually a
>> container to accept values from the calling app.
>> It's an import structure that receives a function ID and pointer.
>> Your example is setting the values not receiving the values.
>> How do I go about receiving values?
>
>The page where ImpStruct is located needs to be change to allow writing.
>The new example is below my signature.
>
>
>> > It does assuming the record alignment is correct; which is VERY likely.
>> All the data is double word aligned - the code has a #pragma pack(4) before
>> all the declarations.
>
>Then you're good-to-go.
>

Hang on - isn't this back to front?

If the structure is declared as exportable from the DLL, then he
doesn't want to define some memory that he can export as a function,
he wants to read and write it, having imported it from the DLL

In which case, it's just a matter of casing the return value of
GetProcAddress right?

Or am I being silly?

MH.



Relevant Pages

  • Re: How can I have a DLL write data to my applications form? (eg. DLLs and procedural type question
    ... Did you remember to use the ShareMem unit in both the DLL and the EXE? ... There was a comment explaining that at the top of your new DLL project. ... how to call the nested procedure pointer. ... declarations of the functions in both modules need to match. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Use existing C code in C# application
    ... way is to create a .NET Class Library using Managed C++ and wrap calls to ... "Win32 Project" and select DLL as the type of project. ... create a header file and wrap the exported function declarations as so: ... DllImport in your C# applications in order to call your exported function ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: [newbie]Calling eVc4++ dll from .NET application
    ... The OpenNETCF Smart Device Framework, found at www.opennetcf.org, has tons ... of platform invoke (P/Invoke) declarations that you might use as examples. ... > I've developed a very simple dll using eVc4++ ...
    (microsoft.public.windowsce.app.development)
  • Re: convert an MFC application to MFC DLL
    ... This suggests that there are too many global variables. ... All the header files which contain extern ... Once the variables are in the DLL, they cannot be accessed by the main program. ... The whole notion that there is a "single" main.cpp which contains the declarations of the ...
    (microsoft.public.vc.mfc)
  • Re: VB and Weather station
    ... > DLL but untill now witn any succes. ... >> Tim wrote: ... >>> I want to make my own interface for my Davis Avantage Pro 2 Weather ... the correct set of declarations in your VB program. ...
    (comp.lang.basic.visual.misc)