For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > January 2006 > Can a dll make a call to the program calling the dll?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Can a dll make a call to the program calling the dll?
David V. Fansler

2006-01-27, 6:56 pm

I am trying to make a contribution to an open program that was written in
VB6. The main part of the program sets up a flexgrid, which gets filled with
values of 1 or 0. The program then uses wmp to output the data to a dll
which then outputs the data to a bit on the parallel printer port. I am
trying to read data back in from the printer port (which I can do) and then
set, or clear the value in the grid.

In the main program, this is done with a function that a call to it looks
like:
CometMod.currentSong.setCell(MusicGrid,.row.col,1) (the 1 to set, a 0 to
clear).

Trying to call this function from the dll gives me and error 434 "object
required". I have a feeling I can not call the function from the dll. Is
this a correct assumption, if not what am I doing wrong. If I can not call
the function how can I modify the grid from the dll?
Thanks,
David
Saga

2006-01-27, 6:56 pm

Raise an event from the DLL, then call your proc from there.

Regards
Saga


"David V. Fansler" <David V. Fansler@discussions.microsoft.com> wrote in
message news:2D595357-4369-4048-B3FF-DCAC0FFEBD73@microsoft.com...
>I am trying to make a contribution to an open program that was written
>in
> VB6. The main part of the program sets up a flexgrid, which gets
> filled with
> values of 1 or 0. The program then uses wmp to output the data to a
> dll
> which then outputs the data to a bit on the parallel printer port. I
> am
> trying to read data back in from the printer port (which I can do) and
> then
> set, or clear the value in the grid.
>
> In the main program, this is done with a function that a call to it
> looks
> like:
> CometMod.currentSong.setCell(MusicGrid,.row.col,1) (the 1 to set, a 0
> to
> clear).
>
> Trying to call this function from the dll gives me and error 434
> "object
> required". I have a feeling I can not call the function from the dll.
> Is
> this a correct assumption, if not what am I doing wrong. If I can not
> call
> the function how can I modify the grid from the dll?
> Thanks,
> David



Ken Halter

2006-01-27, 6:56 pm

"David V. Fansler" <David V. Fansler@discussions.microsoft.com> wrote in
message news:2D595357-4369-4048-B3FF-DCAC0FFEBD73@microsoft.com...
>I am trying to make a contribution to an open program that was written in
> VB6. The main part of the program sets up a flexgrid, which gets filled
> with


As Saga mentioned, Raise an event.

Think of it this way.... a DLL is one heck of alot like a control. Can a
control (like a textbox) make calls into your project? Nope <g> It raises
events to tell you what it's doing.

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Freeware 4 color Gradient Frame? http://www.vbsight.com/GradFrameCTL.htm


David V. Fansler

2006-01-30, 6:55 pm

Thanks for both of your answers
David

"Ken Halter" wrote:

> "David V. Fansler" <David V. Fansler@discussions.microsoft.com> wrote in
> message news:2D595357-4369-4048-B3FF-DCAC0FFEBD73@microsoft.com...
>
> As Saga mentioned, Raise an event.
>
> Think of it this way.... a DLL is one heck of alot like a control. Can a
> control (like a textbox) make calls into your project? Nope <g> It raises
> events to tell you what it's doing.
>
> --
> Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
> DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
> Freeware 4 color Gradient Frame? http://www.vbsight.com/GradFrameCTL.htm
>
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com