msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Accessing main application from ActiveX dll

 
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE
Author Message
Dresik



Joined: 04 Oct 2007
Posts: 2

PostPosted: Wed Sep 29, 2004 6:14 am    Post subject: Accessing main application from ActiveX dll Reply with quote

Message-ID:
Path: NOSPAMgadka.pl
Lines: 8
References:
X-Newsreader: Yanoff 1.5.4 PalmPilot

Hi,
I just wrote my first activex dll. Everything seems to be
working fine, I am able to call dll's procedures from within main
application. The problem is, this dll is intended as a plug-in,
therefore i'd like to let dll access main program's objects'
properties, I just have to know what is going on inside the main
application to allow the plug-in to react correctly. How do you
access external program's properties, events or methods from
activex dll's code?

--

regards
Dresik

Archived from group: microsoft>public>vb>ole
Back to top
View user's profile Send private message
Tony Proctor



Joined: 04 Oct 2007
Posts: 1051

PostPosted: Wed Sep 29, 2004 5:53 pm    Post subject: Re: Accessing main application from ActiveX dll Reply with quote

This is not directly possible under Windows. Some other (UNIX-) systems can
do it but it's generally clumsy to achieve, and not very portable (i.e. all
sorts of special linker options).

The traditional approach is to build all the stuff that your add-in needs to
call back into a DLL of it's own, and reduce your main program to a stub
that simply calls into that support DLL. Your add-in and support DLL can
then reference each other.

That would be the portable way. However, I've also solved this using the
simpler approach of changing the project type of the main application from
'Standard EXE' to 'ActiveX EXE', and setting the Component->Start Mode
project property to Standalone. The EXE will then require a Sub Main() entry
point, but it can host public classes for your add-in whereas a Standard EXE
cannot.

Tony Proctor

"Dresik" wrote in message$ls2$2@inews.gazeta.pl...
> Message-ID:
> Path: NOSPAMgadka.pl
> Lines: 8
> References:
> X-Newsreader: Yanoff 1.5.4 PalmPilot
>
> Hi,
> I just wrote my first activex dll. Everything seems to be
> working fine, I am able to call dll's procedures from within main
> application. The problem is, this dll is intended as a plug-in,
> therefore i'd like to let dll access main program's objects'
> properties, I just have to know what is going on inside the main
> application to allow the plug-in to react correctly. How do you
> access external program's properties, events or methods from
> activex dll's code?
>
> --
>
> regards
> Dresik
>

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group