[jawsscripts] Re: jawsscripts Digest V3 #129

  • From: "Paul Bonarrigo" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "pjbonarrigo@yahoo" for DMARC)
  • To: "jawsscripts@xxxxxxxxxxxxx" <jawsscripts@xxxxxxxxxxxxx>
  • Date: Mon, 20 Jul 2015 22:59:05 +0000 (UTC)

FSDN Question.  I don't understand the Index tab on the current FSDN. 
Somewhere around Jaws 13 the FSDN index was flat and I could type in a script
or function name.  It doesn't appear to work that way any more.  Has the
indexing method changed or am I doing something wrong?  For example, if I go
to the FSDN index tab and type FindString is the search box I would like
FindString to come up in the help pane.  Am I missing something?

On Thursday, July 16, 2015 10:09 PM, FreeLists Mailing List Manager
<ecartis@xxxxxxxxxxxxx> wrote:


jawsscripts Digest    Thu, 16 Jul 2015    Volume: 03  Issue: 129

In This Issue:
        [jawsscripts] Re: Creating a Com Object in JAWS scripts
        [jawsscripts] Re: Creating a Com Object in JAWS scripts
        [jawsscripts] Re: assigning custome highlights
        [jawsscripts] Re: Creating a Com Object in JAWS scripts
        [jawsscripts] Re: Creating a Com Object in JAWS scripts
        [jawsscripts] Re: Creating a Com Object in JAWS scripts

----------------------------------------------------------------------

From: "Peter Torpey" <ptorpey00@xxxxxxxxx>
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts
Date: Thu, 16 Jul 2015 09:39:46 -0400

Thanks for the info on dispatch objects and connecting a DLL to JAWS.

These Microsoft "help" pages are so full of links to links and connections to
sub topics and jargon that it is difficult to follow and get the high level
overview.  Anyway, I think I understand basically what has to be done.

I was hoping not to have to code up all of the interface requirements and that
there would be a simple way or wizard to generate an ATL project and make use
of COM.  I did find some tutorials (not Microsoft sites!) that describe how to
do this with older versions of Visual Studio, but I have VS 2013 and I didn't
see the same options / dialogs for creating such a project.  Maybe I need to
hunt around more and experiment.

If you have any suggestions for making a test project using some kind of ATL
wizard in VS 2013 that might give me a jump start.

Thanks.

--Pete


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
Sent: Tuesday, July 14, 2015 3:18 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts

It has everything to do with how the type is implemented in code. It
can also have a slight amount to do with how the project itself is
built if you use an IDL file to generate a type library (which I
recommend that you do) you will need to link that type library as a
resource when you build the project).

You can read about using ATL to ease several of the steps involved
with this process at
https://msdn.microsoft.com/en-us/library/ekfyh289.aspx

On 7/14/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:

I don't know what a dispatched object is.  How can I tell?  Is that
something to do with the coding in C++ or how the project is compiled in
Visual Studio?

--Pete




-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
Sent: Tuesday, July 14, 2015 2:15 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts

Is the object dispatch based? (either dual or purely an IDispatch
implementation)..

Jaws is not capable of dealing with non-dispatch based objects.

On 7/14/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:
I created a DLL using Visual Studio and would like to connect objects in
the
DLL in my JAWS scripts.


I am not seeing the object in JAWS and wonder if anyone has any pointers.
Here is what I did:



1.        Compiled test.DLL and made sure the manifest was embedded in
the
DLL (in the Visual Studio Properties dialog).

2.      Registered the DLL in Windows using:
regsvr32 (full path to DLL)
The return said that the DLL was properly registerd.

3.      In my JAWS scripts I have the lines:
var object o = CreateObjectEx( "ObjectName", false, "test.dll" )



Besides the fact that I am unable to access any of the methods of the DLL
from within JAWS, I have a test like:



If !o then

  SayString( "object was not created";

EndIf



That verifies that the object was not created.



What am I doing wrong here?  Is there something I'm missing in the call
to
CreateObjectEx or how one should set the properties inside VS to get this
to
work?



Thanks.



--Pete





__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts



------------------------------

Date: Thu, 16 Jul 2015 07:26:47 -0800
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts
From: Soronel Haetir <soronel.haetir@xxxxxxxxx>

I'm not sure that ATL is included with the free versions of VS, sorry
I forgot about that. I have Pro and it is definitely included there,
Along with the project wizards.

If the free versions do not have ATL you can do the IDispatch steps
that ATL helps with using DispGetIDsOfNames /DispCallFunc. Uou will
have to load the type library yourself in that case. (Loading the type
library thenusing those functions is how ATL deals with wiring the
implemtation of a dual interface to a request made through IDispatch).
And in case you haven't understood the term before, a dual interface
is one that dervives from IDispatch but can also be called directly.

On 7/16/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:
Thanks for the info on dispatch objects and connecting a DLL to JAWS.

These Microsoft "help" pages are so full of links to links and connections
to sub topics and jargon that it is difficult to follow and get the high
level overview.  Anyway, I think I understand basically what has to be
done.

I was hoping not to have to code up all of the interface requirements and
that there would be a simple way or wizard to generate an ATL project and
make use of COM.  I did find some tutorials (not Microsoft sites!) that
describe how to do this with older versions of Visual Studio, but I have VS
2013 and I didn't see the same options / dialogs for creating such a
project.  Maybe I need to hunt around more and experiment.

If you have any suggestions for making a test project using some kind of ATL
wizard in VS 2013 that might give me a jump start.

Thanks.

--Pete


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
Sent: Tuesday, July 14, 2015 3:18 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts

It has everything to do with how the type is implemented in code. It
can also have a slight amount to do with how the project itself is
built if you use an IDL file to generate a type library (which I
recommend that you do) you will need to link that type library as a
resource when you build the project).

You can read about using ATL to ease several of the steps involved
with this process at
https://msdn.microsoft.com/en-us/library/ekfyh289.aspx

On 7/14/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:
I don't know what a dispatched object is.  How can I tell?  Is that
something to do with the coding in C++ or how the project is compiled in
Visual Studio?

--Pete




-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
Sent: Tuesday, July 14, 2015 2:15 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts

Is the object dispatch based? (either dual or purely an IDispatch
implementation)..

Jaws is not capable of dealing with non-dispatch based objects.

On 7/14/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:
I created a DLL using Visual Studio and would like to connect objects in
the
DLL in my JAWS scripts.


I am not seeing the object in JAWS and wonder if anyone has any
pointers.
Here is what I did:



1.        Compiled test.DLL and made sure the manifest was embedded in
the
DLL (in the Visual Studio Properties dialog).

2.      Registered the DLL in Windows using:
regsvr32 (full path to DLL)
The return said that the DLL was properly registerd.

3.      In my JAWS scripts I have the lines:
var object o = CreateObjectEx( "ObjectName", false, "test.dll" )



Besides the fact that I am unable to access any of the methods of the
DLL
from within JAWS, I have a test like:



If !o then

  SayString( "object was not created";

EndIf



That verifies that the object was not created.



What am I doing wrong here?  Is there something I'm missing in the call
to
CreateObjectEx or how one should set the properties inside VS to get
this
to
work?



Thanks.



--Pete





__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx

------------------------------

From: "Bob" <temp@xxxxxxxxxxxxxxx>
Subject: [jawsscripts] Re: assigning custome highlights
Date: Thu, 16 Jul 2015 19:19:25 +0100

Does it give the correct colours when you try or does it say black on black?

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of GianniP46
Sent: 15 July 2015 02:51
To: JawsScriptsList
Subject: [jawsscripts] assigning custome highlights

Hi all,I am having an issue with assigning custom highlights in windows 8.1
with Jaws 16.  The two applications that I am working with are Serato
ScratchLIVE and Serato DJ.  In windows 7, I can assign highlights just fine,
but in windows 8.1, nothing will read like it does in windows 7.  Can anyone
please help?  I am considering downgrading my new laptop to windows 7 from
8.1.
Thanks!

Gian Carlo Pedulla
GianniP46@xxxxxxxxxxxxx

LETS! GO! METS!
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts



------------------------------

From: "Peter Torpey" <ptorpey00@xxxxxxxxx>
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts
Date: Thu, 16 Jul 2015 15:23:50 -0400

I started out using VS Express 2013 but recently upgraded to the Professional
version.  Yes, the Express version does lack many tools that the Pro version
has.

I did find the ability to make an ATL project, but didn't see any options for
having a Wizard create the necessary dual interface and/or automatically adding
the iDispatch items.  From the examples I found on the web, it seems like
there may be a wizard or checkbox that will do this, but the tutorials must
have been referencing an earlier version of Visual Studio and I can't seem to
find the check boxes or wizards referenced in any of the tutorials.  I don't
think just creating an ATL project enables this additional functionality
(although maybe it does), so I'm wondering how to enable these interfaces in my
ATL project without having to add all of these mysterious classes and
interfaces manually.  Is there a way?

Thanks.

--Pete


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
Sent: Thursday, July 16, 2015 11:27 AM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts

I'm not sure that ATL is included with the free versions of VS, sorry
I forgot about that. I have Pro and it is definitely included there,
Along with the project wizards.

If the free versions do not have ATL you can do the IDispatch steps
that ATL helps with using DispGetIDsOfNames /DispCallFunc. Uou will
have to load the type library yourself in that case. (Loading the type
library thenusing those functions is how ATL deals with wiring the
implemtation of a dual interface to a request made through IDispatch).
And in case you haven't understood the term before, a dual interface
is one that dervives from IDispatch but can also be called directly.

On 7/16/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:
Thanks for the info on dispatch objects and connecting a DLL to JAWS.

These Microsoft "help" pages are so full of links to links and connections
to sub topics and jargon that it is difficult to follow and get the high
level overview.  Anyway, I think I understand basically what has to be
done.

I was hoping not to have to code up all of the interface requirements and
that there would be a simple way or wizard to generate an ATL project and
make use of COM.  I did find some tutorials (not Microsoft sites!) that
describe how to do this with older versions of Visual Studio, but I have VS
2013 and I didn't see the same options / dialogs for creating such a
project.  Maybe I need to hunt around more and experiment.

If you have any suggestions for making a test project using some kind of ATL
wizard in VS 2013 that might give me a jump start.

Thanks.

--Pete


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
Sent: Tuesday, July 14, 2015 3:18 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts

It has everything to do with how the type is implemented in code. It
can also have a slight amount to do with how the project itself is
built if you use an IDL file to generate a type library (which I
recommend that you do) you will need to link that type library as a
resource when you build the project).

You can read about using ATL to ease several of the steps involved
with this process at
https://msdn.microsoft.com/en-us/library/ekfyh289.aspx

On 7/14/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:
I don't know what a dispatched object is.  How can I tell?  Is that
something to do with the coding in C++ or how the project is compiled in
Visual Studio?

--Pete




-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
Sent: Tuesday, July 14, 2015 2:15 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts

Is the object dispatch based? (either dual or purely an IDispatch
implementation)..

Jaws is not capable of dealing with non-dispatch based objects.

On 7/14/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:
I created a DLL using Visual Studio and would like to connect objects in
the
DLL in my JAWS scripts.


I am not seeing the object in JAWS and wonder if anyone has any
pointers.
Here is what I did:



1.        Compiled test.DLL and made sure the manifest was embedded in
the
DLL (in the Visual Studio Properties dialog).

2.      Registered the DLL in Windows using:
regsvr32 (full path to DLL)
The return said that the DLL was properly registerd.

3.      In my JAWS scripts I have the lines:
var object o = CreateObjectEx( "ObjectName", false, "test.dll" )



Besides the fact that I am unable to access any of the methods of the
DLL
from within JAWS, I have a test like:



If !o then

  SayString( "object was not created";

EndIf



That verifies that the object was not created.



What am I doing wrong here?  Is there something I'm missing in the call
to
CreateObjectEx or how one should set the properties inside VS to get
this
to
work?



Thanks.



--Pete





__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts



------------------------------

Date: Thu, 16 Jul 2015 12:32:39 -0800
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts
From: Soronel Haetir <soronel.haetir@xxxxxxxxx>

The functionality for creating the interface via wizard is there but
honestly it is a pain to use. It was a pain to use when I could see
and is worse now that I can not.

And really, now that you have VS Pro, if you use ATL creating the
interface by hand in the IDL file and then the implementation in your
c++ source is not that difficult.

Note that all of the following was written without attempting to
compile so there may well be stuff missing (and not just the uuid
values), but it should be close enough to give a good start at least.

IDL:

[uuid(...), version(1.0)]
library MyTypeLib
{
[object, uuid(...), oleautomation]
interface IMyInterface : IDispatch
{
[id(1)] HRESULT MyFunc();
[id(2), propget]
HRESULT Member([out, retval] int *);
[id(2), propput] HRESULT Member([in] int);
};

[uuid(...)]
coclass MyClass
{
[default] interface IMyInterface;
};
}
;
header:

#include <atlbase.h>
#include <atlcom.h>
#import "<path>mytypelib.tlb"

class MyClass
: public CComObjectRoot,
public CComCoClass<MyClass, &__uuidof(MyTypeLib::MyClass)>,
public IDispatchImpl<MyTypeLib::IMyInterface,
&__uuidof(MyTypeLib::IMyInterface), LIBID_MyTypeLib>
{
BEGIN_COM_MAP(MyClass)
COM_INTERFACE_ENTRY(MyTypeLib::IMyInterface)
COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()

HRESULT MyFunction();
HRESULT get_Member(int *);
HRESULT put_Member(int);
};
c++ source:

#include "stdafx.h"
#include "myclass.h"

HRESULT MyClass::MyFunction()
{
return S_OK;
}
HRESULT MyClass::get_Member(long * pVal)
{
if(!pVal)
return E_POINTER;

*pVal = 1;
return S_OK;
}
HRESULT MyClass::put_Member(long val)
{
// Do something with val
return S_OK;
}...

OBJECT_ENTRY_AUTO(__uuidof(MyTypeLib::MyClass), MyClass);



On 7/16/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:
I started out using VS Express 2013 but recently upgraded to the
Professional version.  Yes, the Express version does lack many tools that
the Pro version has.

I did find the ability to make an ATL project, but didn't see any options
for having a Wizard create the necessary dual interface and/or automatically
adding the iDispatch items.  From the examples I found on the web, it seems
like there may be a wizard or checkbox that will do this, but the tutorials
must have been referencing an earlier version of Visual Studio and I can't
seem to find the check boxes or wizards referenced in any of the tutorials.
I don't think just creating an ATL project enables this additional
functionality (although maybe it does), so I'm wondering how to enable these
interfaces in my ATL project without having to add all of these mysterious
classes and interfaces manually.  Is there a way?

Thanks.

--Pete


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
Sent: Thursday, July 16, 2015 11:27 AM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts

I'm not sure that ATL is included with the free versions of VS, sorry
I forgot about that. I have Pro and it is definitely included there,
Along with the project wizards.

If the free versions do not have ATL you can do the IDispatch steps
that ATL helps with using DispGetIDsOfNames /DispCallFunc. Uou will
have to load the type library yourself in that case. (Loading the type
library thenusing those functions is how ATL deals with wiring the
implemtation of a dual interface to a request made through IDispatch).
And in case you haven't understood the term before, a dual interface
is one that dervives from IDispatch but can also be called directly.

On 7/16/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:
Thanks for the info on dispatch objects and connecting a DLL to JAWS.

These Microsoft "help" pages are so full of links to links and
connections
to sub topics and jargon that it is difficult to follow and get the high
level overview.  Anyway, I think I understand basically what has to be
done.

I was hoping not to have to code up all of the interface requirements and
that there would be a simple way or wizard to generate an ATL project and
make use of COM.  I did find some tutorials (not Microsoft sites!) that
describe how to do this with older versions of Visual Studio, but I have
VS
2013 and I didn't see the same options / dialogs for creating such a
project.  Maybe I need to hunt around more and experiment.

If you have any suggestions for making a test project using some kind of
ATL
wizard in VS 2013 that might give me a jump start.

Thanks.

--Pete


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
Sent: Tuesday, July 14, 2015 3:18 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts

It has everything to do with how the type is implemented in code. It
can also have a slight amount to do with how the project itself is
built if you use an IDL file to generate a type library (which I
recommend that you do) you will need to link that type library as a
resource when you build the project).

You can read about using ATL to ease several of the steps involved
with this process at
https://msdn.microsoft.com/en-us/library/ekfyh289.aspx

On 7/14/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:
I don't know what a dispatched object is.  How can I tell?  Is that
something to do with the coding in C++ or how the project is compiled in
Visual Studio?

--Pete




-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
Sent: Tuesday, July 14, 2015 2:15 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts

Is the object dispatch based? (either dual or purely an IDispatch
implementation)..

Jaws is not capable of dealing with non-dispatch based objects.

On 7/14/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:
I created a DLL using Visual Studio and would like to connect objects
in
the
DLL in my JAWS scripts.


I am not seeing the object in JAWS and wonder if anyone has any
pointers.
Here is what I did:



1.        Compiled test.DLL and made sure the manifest was embedded in
the
DLL (in the Visual Studio Properties dialog).

2.      Registered the DLL in Windows using:
regsvr32 (full path to DLL)
The return said that the DLL was properly registerd.

3.      In my JAWS scripts I have the lines:
var object o = CreateObjectEx( "ObjectName", false, "test.dll" )



Besides the fact that I am unable to access any of the methods of the
DLL
from within JAWS, I have a test like:



If !o then

  SayString( "object was not created";

EndIf



That verifies that the object was not created.



What am I doing wrong here?  Is there something I'm missing in the call
to
CreateObjectEx or how one should set the properties inside VS to get
this
to
work?



Thanks.



--Pete





__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx

------------------------------

Date: Thu, 16 Jul 2015 12:59:38 -0800
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts
From: Soronel Haetir <soronel.haetir@xxxxxxxxx>

Also, I just tried it and I was able to use the visual studio class
view to select an interface definition found in an idl file and add a
member declaration. And that member was automatically created in the
implementation class in the c++ source.

The add member wizard was definitely a pain to use with jaws but it can be done.

I created an atl project, used the new item wizard to add an ATL
class. I used the wizard to select a dual interface class.

Next, I brought up class view (found on the view menu) then went down
to the interface that corresponded to the class I had just added.

On the right click menu there is Add, I selected member. The dialog
script came back with a error but I hit the yes button to continue.
After filling in the dialog I hit the finish button.

At that point the member was both added to the interface in the IDL
file and the class definition in the .h file as well as having a
skeleton implementation in the c++ source file.

On 7/16/15, Soronel Haetir <soronel.haetir@xxxxxxxxx> wrote:
The functionality for creating the interface via wizard is there but
honestly it is a pain to use. It was a pain to use when I could see
and is worse now that I can not.

And really, now that you have VS Pro, if you use ATL creating the
interface by hand in the IDL file and then the implementation in your
c++ source is not that difficult.

Note that all of the following was written without attempting to
compile so there may well be stuff missing (and not just the uuid
values), but it should be close enough to give a good start at least.

IDL:

[uuid(...), version(1.0)]
library MyTypeLib
{
[object, uuid(...), oleautomation]
interface IMyInterface : IDispatch
{
[id(1)] HRESULT MyFunc();
[id(2), propget]
HRESULT Member([out, retval] int *);
[id(2), propput] HRESULT Member([in] int);
};

[uuid(...)]
coclass MyClass
{
[default] interface IMyInterface;
};
}
;
header:

#include <atlbase.h>
#include <atlcom.h>
#import "<path>mytypelib.tlb"

class MyClass
: public CComObjectRoot,
public CComCoClass<MyClass, &__uuidof(MyTypeLib::MyClass)>,
public IDispatchImpl<MyTypeLib::IMyInterface,
&__uuidof(MyTypeLib::IMyInterface), LIBID_MyTypeLib>
{
BEGIN_COM_MAP(MyClass)
COM_INTERFACE_ENTRY(MyTypeLib::IMyInterface)
COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()

HRESULT MyFunction();
HRESULT get_Member(int *);
HRESULT put_Member(int);
};
c++ source:

#include "stdafx.h"
#include "myclass.h"

HRESULT MyClass::MyFunction()
{
return S_OK;
}
HRESULT MyClass::get_Member(long * pVal)
{
if(!pVal)
return E_POINTER;

*pVal = 1;
return S_OK;
}
HRESULT MyClass::put_Member(long val)
{
// Do something with val
return S_OK;
}...

OBJECT_ENTRY_AUTO(__uuidof(MyTypeLib::MyClass), MyClass);



On 7/16/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:
I started out using VS Express 2013 but recently upgraded to the
Professional version.  Yes, the Express version does lack many tools that
the Pro version has.

I did find the ability to make an ATL project, but didn't see any options
for having a Wizard create the necessary dual interface and/or
automatically
adding the iDispatch items.  From the examples I found on the web, it
seems
like there may be a wizard or checkbox that will do this, but the
tutorials
must have been referencing an earlier version of Visual Studio and I
can't
seem to find the check boxes or wizards referenced in any of the
tutorials.
I don't think just creating an ATL project enables this additional
functionality (although maybe it does), so I'm wondering how to enable
these
interfaces in my ATL project without having to add all of these
mysterious
classes and interfaces manually.  Is there a way?

Thanks.

--Pete


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
Sent: Thursday, July 16, 2015 11:27 AM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts

I'm not sure that ATL is included with the free versions of VS, sorry
I forgot about that. I have Pro and it is definitely included there,
Along with the project wizards.

If the free versions do not have ATL you can do the IDispatch steps
that ATL helps with using DispGetIDsOfNames /DispCallFunc. Uou will
have to load the type library yourself in that case. (Loading the type
library thenusing those functions is how ATL deals with wiring the
implemtation of a dual interface to a request made through IDispatch).
And in case you haven't understood the term before, a dual interface
is one that dervives from IDispatch but can also be called directly.

On 7/16/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:
Thanks for the info on dispatch objects and connecting a DLL to JAWS.

These Microsoft "help" pages are so full of links to links and
connections
to sub topics and jargon that it is difficult to follow and get the high
level overview.  Anyway, I think I understand basically what has to be
done.

I was hoping not to have to code up all of the interface requirements
and
that there would be a simple way or wizard to generate an ATL project
and
make use of COM.  I did find some tutorials (not Microsoft sites!) that
describe how to do this with older versions of Visual Studio, but I have
VS
2013 and I didn't see the same options / dialogs for creating such a
project.  Maybe I need to hunt around more and experiment.

If you have any suggestions for making a test project using some kind of
ATL
wizard in VS 2013 that might give me a jump start.

Thanks.

--Pete


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
Sent: Tuesday, July 14, 2015 3:18 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts

It has everything to do with how the type is implemented in code. It
can also have a slight amount to do with how the project itself is
built if you use an IDL file to generate a type library (which I
recommend that you do) you will need to link that type library as a
resource when you build the project).

You can read about using ATL to ease several of the steps involved
with this process at
https://msdn.microsoft.com/en-us/library/ekfyh289.aspx

On 7/14/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:
I don't know what a dispatched object is.  How can I tell?  Is that
something to do with the coding in C++ or how the project is compiled
in
Visual Studio?

--Pete




-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
Sent: Tuesday, July 14, 2015 2:15 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Creating a Com Object in JAWS scripts

Is the object dispatch based? (either dual or purely an IDispatch
implementation)..

Jaws is not capable of dealing with non-dispatch based objects.

On 7/14/15, Peter Torpey <ptorpey00@xxxxxxxxx> wrote:
I created a DLL using Visual Studio and would like to connect objects
in
the
DLL in my JAWS scripts.


I am not seeing the object in JAWS and wonder if anyone has any
pointers.
Here is what I did:



1.        Compiled test.DLL and made sure the manifest was embedded in
the
DLL (in the Visual Studio Properties dialog).

2.      Registered the DLL in Windows using:
regsvr32 (full path to DLL)
The return said that the DLL was properly registerd.

3.      In my JAWS scripts I have the lines:
var object o = CreateObjectEx( "ObjectName", false, "test.dll" )



Besides the fact that I am unable to access any of the methods of the
DLL
from within JAWS, I have a test like:



If !o then

  SayString( "object was not created";

EndIf



That verifies that the object was not created.



What am I doing wrong here?  Is there something I'm missing in the
call
to
CreateObjectEx or how one should set the properties inside VS to get
this
to
work?



Thanks.



--Pete





__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx



--
Soronel Haetir
soronel.haetir@xxxxxxxxx

------------------------------

End of jawsscripts Digest V3 #129
*********************************




__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts

Other related posts: