Fletcher Johnson wrote on 2011-09-06: 
>  Hi all,
> 
> 
>  Long time, no chat..
> 
> 
>  I am working on a VFP project that requires that I pass a struct.  For my
>  current problem, it wants an array of structs that simply have 2 doubles.
> 
> 
>  I seem to remember there being a fairly straightforward way to create a
>  variable that, to the COM objects method, looks like a struct, when, in
>  fact, it is a string of values patched together.
> 
> 
>  So the code in .net might look like
> 
> 
>  Dim pt(2) as somestruct
>  
>  Pt(0).x = 123.9876
>  
>  Pt(0).y = 456.789
>  
>  Pt(1).x = 123.1
>  
>  Pt(1).y = 789
> 
> 
>  Comobj.SomeSillyMethod(pt)
> 
> 
>  And the structure looks something like:
>  
>  Structure Somestruct
>    Double x
>    
>    Double y
> 
> 
>  I assume I should be able to use a VFP array, but not sure how to model
the
>  struct.
> 
> 
>  I am also not sure how to do it so that it sees it as a double and not a
>  decimal or some other data type.
> 
> 
>  Any and all ideas are welcome!
> 
> 
>  Take care,
> 
> 
>  Fletcher
>  
>  (who lurks here when time permits or problems require)
> 
> 
>  Fletcher Johnson
>  

Fletcher,

You cannot use the VFP Array. 

BINTOC(xValue, "4RS")+BINTOC(yValue, "4RS") should give you the structure. 

The DECLARE of the API will need to have that parameter be STRING.

If you need the information back, because it's an in/out parameter, it may
work. 

When I worked with the ShellExecuteEx() API, it worked fine. When I worked
with AllocateAndInitializeSid() and CheckTokenMembership() I needed to
allocate memory and free it with HeapAlloc(), HeapFree(). When I initialized
the allocated memory, I used SYS(2600). API's are a fun puzzle (for some).


Tracy Pearson
PowerChurch Software


_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/001101cc6cd9$701fff70$505ffe50$@powerchurch.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to