Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4585232
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:27:57+00:00 2026-05-21T21:27:57+00:00

I need to use external dll to communicate with digital camera and I found

  • 0

I need to use external dll to communicate with digital camera and I found program with appropriate dll that enable communication.In dll description I found function that suits my needs. DLL Header Looks like this ….

//-------------------------------------------------------------------
// ReleaseShutter()
// Inputs:
//   timeOutInSecs   timeout in secs to wait for picture to be
//                   taken and downloaded (max 60 secs)
//   pszFilename     option string in which to store the name of the
//                   saved image. Set to NULL if not required
//   numChars        length of pszFilename if defined
//
// Returns://   0 - Success, image saved
//   1 - PSRemote is not running
//   2 - PSRemote is running but camera is not connected
//   3 - Camera is busy
//   4 - Timeout waiting for image to be saved
//   5 - Error releasing shutter
//
// Description:
//   Take a picture and optionally wait for it to be saved to disk.
//
//--------------------------------------------------------------------
PSRemoteLIB_API int __stdcall ReleaseShutter( int timeoutInSecs,
                            char* Filename,int   numChars  );

Ok, I load dll, use function , get Result status and external program takes a picture but I CAN NOT GET FILENAME BACK!!!! Here is my code

procedure TForm1.Button2Click(Sender: TObject);
var   Status: Integer;
Name1: PChar;
DLLHandle: Thandle;
TakePic: Function (T: Integer; Nam: Pchar;Num:Integer):Integer; {$IFDEF WIN32} stdcall; {$ENDIF}

 begin  DLLHandle := LoadLibrary('PSRemoteLib.dll');
   if DLLHandle >= 32 then { success }
     begin   
      Name1:=stralloc(1024);
      TakePic := GetProcAddress(DLLHandle, 'ReleaseShutter');
      Status:=TakePic(60,Name1,SizeOf(Name1));
      label1.Caption:=intTostr(Status);
      label2.Caption:=Name1;
      FreeLibrary(DLLHandle);
     end
   else     MessageDlg('Error: could not find PSRemoteLib.dll', mtError, [mbOk], 0);
  StrDispose(Name1);
end;

I try PChar PWidechar and everything that I found on net but nothing !!!

What I do wrong ???? In the sample .exe that comes with dll and runs in cmd mode this works fine !!!! Program takes picture and report filename ????I have a sample source code and looks like this

        case 0: // success            if (filename && strlen(filename))            
{
                cout << "Success, image saved as: " << filename << endl;            
}
            else            
{
                cout << "Success, image saved on CF card?" << endl;            
}
            break;
        case 1:            cerr << "PSRemote is not running" << endl;
            break;
        case 2:            cerr << "Camera is not connected" << endl;
            break;
        case 3:            cerr << "Camera is busy" << endl;
            break;
        case 4:            cerr << "Timeout waiting for image to be saved" << endl;
            break;
        default:
            cerr << "ERROR: unexpected return status: " << status << endl;        
}

}
    return nRetCode;
}

PLEASE HELP I NEED THIS !!!

PS also in dll I have similar function

{///----------------------------------------------------------------------- }
{/// GetOutputPath() }
{/// Inputs: }
{/// pszPathname string in which to store the pathname of the }
{/// directory currently being used to save images }
{/// numChars length of pszPathname }
{/// }
{/// Returns: }
{/// 0 - Success, pathname returned in pszPathname }
{/// 1 - PSRemote is not running }
{/// 4 - Some other error }
{/// }
{/// Description: }
{/// Returns the full pathname of the directory used for saving images. }
{/// This is the base directory as specified by SetOutputPath() plus }
{/// any separate directories for year, month or day if selected in }
{/// preferences. }
{/// }
{///----------------------------------------------------------------------- }
var
  GetOutputPath: function(pszPathname: PChar; 
                          numChars: var Integer): SREMOTELIB_API INT __STDCALL cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; 

ANd again get status(integer) back but not Pathname ?????

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T21:27:58+00:00Added an answer on May 21, 2026 at 9:27 pm

    The function wants to get a char buffer. This means you have to allocate this like

    Name1 : array[MAX_PATH+1] of AnsiChar;
    

    MAX_PATH is defined in the unit Windows and should be big enough. AnsiChar is for all Delphi versions the equvalent for the C++ char

    In the call you have to set the pointer to the buffer and the maximum number of characters

    Status := TakePic(60,Name1,MAX_PATH);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an application using labview and need to use external code. I
Wnen I use external resources such as files or DB connection I need to
I need to assign some tags to my posts (for external use), but I
I need to use sed to convert all occurences of ##XXX## to ${XXX} .
I need to use an alias in the WHERE clause, but It keeps telling
I need to use NSImage which appears need to be imported from <AppKit/AppKit.h> .
I need to use a many to many relationship in my project and since
I need to use sendmail from Macs in an office. At the moment, I
I need to use a byte array as a profile property in a website.
I need to use a datetime.strptime on the text which looks like follows. Some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.