Article View: borland.public.cppbuilder.nativeapi
Article #7217Re: Calling one app's function from another app
From: Greg Bullock
Date: Thu, 03 Mar 2005 21:15
Date: Thu, 03 Mar 2005 21:15
45 lines
2472 bytes
2472 bytes
Thanks very much, Gambit. I'll use Automation or RPC, as you recommend. The exported function uses some objects with C++Builder language extensions (e.g., "__published") which are off-limits to the other application. These objects are also used elsewhere in the exporting application, so I felt the best way to let both applications link to the same function is to export the critical function from that application. Thanks for pointing me to Automation and RPC. Regards. Greg "Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message news:42267292@newsgroups.borland.com... > > "Greg Bullock" <greg dot bullock at atk dot com> wrote in message > news:4226686a$1@newsgroups.borland.com... > >> AppOne exports a function declared as follows: >> >> TMyStruct __stdcall __declspec(dllimport) GetMyStruct( >> const char *StrA, >> const char *StrB, >> const SYSTEMTIME& DateTime); > > That is not an export. That is an import. > >> AppTwo attempts to call this function using code something >> like the following: > > I do not suggest you do it that way. Why do you need applications to call > each other's functions in the first place? That is not a very good > design. > Shared code should be placed into a DLL instead. Otherwise, you should > use > Automation or RPC to allow applications to call each others functions in a > safe manner. > > > Gambit > >
Technical Details
Message-ID:
<42277e66$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!newshosting.com!nx02.iad01.newshosting.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.usenet.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4226686a$1@newsgroups.borland.com> <42267292@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ce3b76f66924fcaa X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Greg Bullock" <greg dot bullock at atk dot com> Newsgroups: borland.public.cppbuilder.nativeapi References: <4226686a$1@newsgroups.borland.com> <42267292@newsgroups.borland.com> Subject: Re: Calling one app's function from another app Date: Thu, 3 Mar 2005 13:15:15 -0800 Lines: 47 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 138.64.190.39 Message-ID: <42277e66$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1109884518 138.64.190.39 (3 Mar 2005 13:15:18 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!newshosting.com!nx02.iad01.newshosting.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.usenet.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail