realbasic-nug
[Top] [All Lists]

Re: Windows Declare Help/Crash

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Windows Declare Help/Crash
From: Christian Miller <realbasic at nc dot rr dot com>
Date: Thu, 31 Mar 2005 11:48:26 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <BE71601F dot 65122%mars at realsoftware dot com>
On Mar 31, 2005, at 11:06 AM, Mars Saxman wrote:

realbasic at nc dot rr dot com wrote:

I am trying to convert a VB6 project to RB.  It seems to be working
except when it makes the following call:
Declare Function SetOptionValueA Lib "engine.dll"(ByRef Name  as
cstring, ByRef Value  as cstring) as integer

This seems strange. Why do you believe that these CString parameters need to
be passed ByRef?

The original declare in VB says so. :)  Here it is:
Public Declare Function SetOptionValueA Lib "engine.dll" (ByRef optionName As String, ByRef optionValue As String) As Long

To be honest, it doesn't look like any of the values are being used after they are returned. However, I believe that if you don't provide a variable to be written to when the declare wants one, "bad things will happen".

Christian
Pariahware, Inc. Custom Software
<pariahware at pariahware dot com>
<http://www.pariahware.com>
--
God loved you so much that He gave His only son Jesus. What have you done with God's gift?


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>