From: Timo Kunze on
Hi,

I hope it's okay to post questions related to OLE and VB6 here. It's a
bit difficult to find appropriate newsgroups that are not dead yet.

I'm trying to use IMAPI2 (Image Mastering API) from VB6. I've ported
imapi2.idl and imapi2fs.idl from the Windows SDK to ODL and created a
typelib which I use in the VB6 app. I've two problems, that might be
related:

1) The IFileSystemImage::UDFRevisionsSupported property returns wrong
values. Since it works in C++, it must be a problem with my typelib.
2) The MsftFileSystemImage coclass can't be instanciated using VB's
"New" keyword.

Here's my definition of the MsftFileSystemImage coclass:

[
uuid(2C941FC5-975B-59BE-A960-9A2A262853A5),
helpstring("File system image")
]
coclass MsftFileSystemImage
{
[default] interface IVBFileSystemImage3;
interface IVBFileSystemImage2;
[default,source] interface DFileSystemImageEvents;
[source] interface DFileSystemImageImportEvents;
interface IVBConnectionPointContainer;
interface IVBFileSystemImage;
};

Calling "Set fsImage = New MsftFileSystemImage" produces the error
(translated from German) "Class does not support automation or does not
support expected interface".
If I remove the "default" attribute from IVBFileSystemImage3 and set it
for IVBFileSystemImage, it works. Can this change have side effects?

Now to the 1st problem. My definition of
IFileSystemImage::UDFRevisionsSupported is:

[
uuid(2C941FE1-975B-59BE-A960-9A2A262853A5),
helpstring("File system image"),
odl
]
interface IVBFileSystemImage : IDispatch
{
...
[propget, id(31), helpstring("UDF revision(s) supported")]
HRESULT UDFRevisionsSupported([out,retval] SAFEARRAY(VARIANT) *pVal);
...
}

When reading this property from VB6, I get an array of VARIANTs with 1
entry. This single entry is of type Long and has a value of 258, which
would be (nonexistent) UDF revision 2.58.
When reading this property from C++, I also get an array of VARIANTs
with 1 entry. This single entry is of type VT_I4 and has a value of 102,
which would be UDF revision 1.02. 1.02 is probably correct. I would have
expected support for newer revisions as well, but InfraRecorder reports
1.02 only, too.
Why doesn't the property have the expected value of 102?

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
From: Timo Kunze on
Timo Kunze schrieb:
> 1) The IFileSystemImage::UDFRevisionsSupported property returns wrong
> values. Since it works in C++, it must be a problem with my typelib.

I found out what's going on here. What is 258 as hex? Yeah, 0x102. How
can the debugger of Visual C++ display numbers? Yeah, it can display
them as hex - and usually I have this option activated. So there's
nothing wrong with 258... :)

However, the second problem still exists.

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
From: Alain on

"Timo Kunze" <TKunze71216(a)gmx.de> a �crit dans le message de news:
h9brpf$r55$1(a)aioe.org...
> I found out what's going on here. What is 258 as hex? Yeah, 0x102. How
> can the debugger of Visual C++ display numbers? Yeah, it can display
> them as hex - and usually I have this option activated. So there's
> nothing wrong with 258... :)
>
> However, the second problem still exists.

I don't think people use VB here...
For VB specific question, you should try a group like
microsoft.public.vc.language


From: Alain on
"Alain" <alain(a)al.com> a �crit dans le message de news:
h9cco3$hh3$1(a)news.albasani.net...

> I don't think people use VB here...
> For VB specific question, you should try a group like
> microsoft.public.vc.language

Ooops, wrong copy-paste : I meant microsoft.public.vb.general.discussion


From: Auric__ on
On Wed, 23 Sep 2009 05:52:07 GMT, Alain wrote:

> "Alain" <alain(a)al.com> a �crit dans le message de news:
> h9cco3$hh3$1(a)news.albasani.net...
>
>> I don't think people use VB here...
>> For VB specific question, you should try a group like
>> microsoft.public.vc.language
>
> Ooops, wrong copy-paste : I meant microsoft.public.vb.general.discussion

There's also comp.lang.basic.visual.*.

--
You know it was a good party when you're still hung over 2 days later.
You know it's an *AWESOME* party when the *DESIGNATED DRIVER* is still
hung over 2 days later.
 | 
Pages: 1
Prev: ReBar problem...
Next: Virtual Mouse + Keyboard