Re: How best for dll to "report progress"?




"J French" <erewhon@xxxxxxxxxx> wrote in message
news:45544cd0.945271240@xxxxxxxxxxxxxxxxxxx
On Fri, 10 Nov 2006 00:36:40 -0600, "MP" <nospam@xxxxxxxxxx> wrote:

<snip>

The dll is created by my vb6.exe app "in process" to the external
app(acad).
The dll can then "communicate" to the external app(in whose process it is
running) by calling that apps api methods etc.
Then it can return data back to my vb6 exe when I call it's properties,
right?
Sub()
Set oApp = CreateInstanceOfApp
Set cDll = oApp.GetInterfaceObject(mydll.myclass)
Call cDll.GatherInfo (oApp.Document)'dll communicates with app ???
ReturnData = cDll.ReturnInfo'dll communicates with me???
Call UseData (ReturnData) 'or whatever
End Sub

<snip>

This sounds as if:

1) You have AutoCad running and it has some sort of VB inside it

Yes, autocad is running but although it has a vba inside it I'm not using
that.

2) You have another pure VB EXE

Yes, That's my vb exe which can get a reference to the running instance of
acad via getobject or createobject

3) You want to make the things talk to each other

Well, I have this dll now, finally got it working, and that's what goes
"inside" the acad process via
acadobject.GetInterfaceObject("dllname.classname")

4) All this stuff about DLLs is a red herring

Sorry, don't know what a red herring is, I've heard the expression but
don't know what it means.

It sounds as if you and Ken are saying a dll can't Raise events in the way I
have read about and posted questions about.
However, neither of you have come right out and said it in so many words,
but that's the impression I'm getting,
Is that correct?

Now the dll is compiled and registered, and the exe is compiled, now it's
running at acceptable speed
800 objects "processed" in 1 second
versus pre-compiled in ide group or out of process (just vb without the dll)
at about 400 objects processed in 45 seconds or so.

so now the issue of communicating back progress isn't as dire as it was
before.
If the process is going to take 45 seconds it's nice to know it's actually
'doing' something instead of just having frozen up
:-)
at 1 second, that's no longer a big issue as i would have been happy to have
received notice every few seconds or so, so finishing the job in 1 second,
I'm excstatic <sp?>




Basically it sounds as if you either need to set up some form
communication such as WM_COPYDATA or 'Chat by Textbox' or you need to
turn your pure VB App into an AX EXE

Ken also mentioned Ax exe but said that was also Out of process...
Maybe it's just something special to acad but everyone over on that group
just says dll has to be in process to get speed.
anything out of process takes "forever" ie (45 seconds to 'process' 400
objects) <bg>


PostMessage is not going to be much use for all but the most trivial
things.

Cross Process Marshalling (which is really SendMessage in drag) is
slow, but 'slow' is a relative thing - unless you have two Apps stuck
in tight loops without processing their Windows Message Queue then
that 'slow' communication will be pretty darn quick in human terms.

well i don't know if half a minute or a minute is quick or not, depends on
perspective
In reality it would be fine if it took one minute or even 5 minutes,
compared to doing the job "manually" without this app/dll.
what's not fine is that during that time i can't see if anything is going on
or not.
:-)



Personally I would Shell your pure VB App with the HWND of a Textbox
in the Command Line and use WM_SETTEXT to talk back from the pure VB
App to the Textbox in AutoCad.

sorry, you really lost me there...Im not too savy, just trying to "learn"
myself in this here vb stuff...so
"I would Shell your pure VB App with the HWND of a Textbox
in the Command Line"
I have no clue what that means, but I want to learn. Sorry...what command
line?
I've heard of Shell...I use it to start notepad for instance to see my debug
log, Shell(Notepad.exe filename)
Somehow I think you mean something different...
"with the HWND of a textbox..."???
from the pure VB
App to the Textbox in AutoCad.

what textbox in autocad?


It is simple to set up, and will give you a good idea of 'speed'



I'd appreciate if you could elaborate in more detail on what you're
explaining.
Sorry Im such a beginner that I don't get it yet...but with a couple more
clarifications as above I think I could understand.

Thanks again to all for their help
Mark


.



Relevant Pages

  • Re: Mobile Service & Auto Start
    ... SYSTEMTIME is declared wrong. ... have never needed to write an app like this and I just figured ... just very dumb about the CeRunAppAtTime call and why it may not ... So I have an exe that I start 5 min after I push a button. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Mobile Service & Auto Start
    ... registry Init key is not going to work reliably. ... have never needed to write an app like this and I just figured ... I just played with what exe inits ... just very dumb about the CeRunAppAtTime call and why it may not ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Mobile Service & Auto Start
    ... The RegRestoreFile API is only supported by the object store-based registry. ... have never needed to write an app like this and I just figured ... So I have an exe that I start 5 min after I push a button. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Manifests and requestedExecutionLevel
    ... The existing app is a single executable, ... Since you already have the small .exe running, ... And Admin user priviledge is High MIC. ... The manifest has the capability of telling Vista that it needs to be started ...
    (microsoft.public.vc.mfc)
  • Re: Mobile Service & Auto Start
    ... Like I go in and change the owner information then use the RegRestoreFile ... SYSTEMTIME is declared wrong. ... have never needed to write an app like this and I just figured ... So I have an exe that I start 5 min after I push a button. ...
    (microsoft.public.dotnet.framework.compactframework)

Loading