 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Tobias Guest
|
Posted: Tue May 08, 2007 3:03 pm Post subject: THandle to OleVariant under windows 2000 |
|
|
Hello, I'am having problem with assigning a THandle to Olevariant under
win2000?
Under winXP this works.
procedure AssignHandle(AHandle : THandle);
var
vHandle : OleVarinat;
begin
vHandle := AHandle; //vHandle is not a valid handle value.
//do some stuff with vHandle.
end;
PS: I'am using Delphi 5. |
|
| Back to top |
|
 |
Dmitry Streblechenko Guest
|
Posted: Tue May 08, 2007 10:02 pm Post subject: Re: THandle to OleVariant under windows 2000 |
|
|
THandle is nothing more than an unsigned 4 byte integer.
What exactly do you mean by "vHandle is not a valid handle value"?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Tobias" <tobias__a (AT) hotmail (DOT) com> wrote in message
news:46404ae8$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Hello, I'am having problem with assigning a THandle to Olevariant under
win2000?
Under winXP this works.
procedure AssignHandle(AHandle : THandle);
var
vHandle : OleVarinat;
begin
vHandle := AHandle; //vHandle is not a valid handle value.
//do some stuff with vHandle.
end;
PS: I'am using Delphi 5.
|
|
|
| Back to top |
|
 |
Tobias Guest
|
Posted: Wed May 09, 2007 8:13 am Post subject: Re: THandle to OleVariant under windows 2000 |
|
|
"Dmitry Streblechenko" <dmitry (AT) dimastr (DOT) com> skrev i meddelandet
news:4640ac6f$1 (AT) newsgroups (DOT) borland.com...
| Quote: | THandle is nothing more than an unsigned 4 byte integer.
What exactly do you mean by "vHandle is not a valid handle value"?
procedure AssignHandle(AHandle : THandle);
var
vHandle : OleVariant;
begin
//AHandle is a handle to a form or a Panel.
vHandle is a handle to a Panel. |
| Quote: | vHandle := AHandle; //vHandle is not a valid handle value.
//do some stuff with vHandle.
I'am using it to Initiat a ActiveX component(look below). MediaType is |
created using VarArrayCreate(..., varByte);
IViewer = dispinterface
procedure Init(NumberOfStreams: Integer; MediaType: OleVariant; hWnd:
{??Int64} OleVariant); dispid 2;
A Visual studio c++ exeple:
// Initialize our viewer
varMediaType = SafeArray.Detach();
viewer.Init(1, varMediaType, (INT64) GetSafeHwnd());
SafeArray.Attach(varMediaType);
Documentation says:
public: void Init(
[in] LONG NumberOfStreams,
[in] VARIANT MediaType,
[in] LONGLONG hWnd
);
Parameters
NumberOfStreams
Reserved. Set to 0.
MediaType
A byte array of media types describing the media sub streams.
hWnd
Handle to a window where video will be rendered. If NULL, video will not be
rendered.
//Tobias |
|
| Back to top |
|
 |
Karol Bieniaszewski Guest
|
Posted: Wed May 09, 2007 2:01 pm Post subject: Re: THandle to OleVariant under windows 2000 |
|
|
Użytkownik "Tobias" <tobias__a (AT) hotmail (DOT) com> napisał w wiadomości
news:46417a7e$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
"Dmitry Streblechenko" <dmitry (AT) dimastr (DOT) com> skrev i meddelandet
news:4640ac6f$1 (AT) newsgroups (DOT) borland.com...
THandle is nothing more than an unsigned 4 byte integer.
What exactly do you mean by "vHandle is not a valid handle value"?
procedure AssignHandle(AHandle : THandle);
var
vHandle : OleVariant;
begin
//AHandle is a handle to a form or a Panel.
vHandle is a handle to a Panel.
vHandle := AHandle; //vHandle is not a valid handle value.
//do some stuff with vHandle.
I'am using it to Initiat a ActiveX component(look below). MediaType is
created using VarArrayCreate(..., varByte);
end;
IViewer = dispinterface
procedure Init(NumberOfStreams: Integer; MediaType: OleVariant; hWnd:
{??Int64} OleVariant); dispid 2;
A Visual studio c++ exeple:
// Initialize our viewer
varMediaType = SafeArray.Detach();
viewer.Init(1, varMediaType, (INT64) GetSafeHwnd());
SafeArray.Attach(varMediaType);
Documentation says:
public: void Init(
[in] LONG NumberOfStreams,
[in] VARIANT MediaType,
[in] LONGLONG hWnd
);
Parameters
NumberOfStreams
Reserved. Set to 0.
MediaType
A byte array of media types describing the media sub streams.
hWnd
Handle to a window where video will be rendered. If NULL, video will not
be
rendered.
//Tobias
|
In this example i do not see any Handle as Variant - in your sample this is
LONGLONG i suppose that this is Int64(DELPHI).
I ommit something?
Karol Bieniaszewski |
|
| Back to top |
|
 |
Tobias Guest
|
Posted: Wed May 09, 2007 5:01 pm Post subject: Re: THandle to OleVariant under windows 2000 |
|
|
| Quote: | THandle is nothing more than an unsigned 4 byte integer.
What exactly do you mean by "vHandle is not a valid handle value"?
procedure AssignHandle(AHandle : THandle);
var
vHandle : OleVariant;
begin
//AHandle is a handle to a form or a Panel.
vHandle is a handle to a Panel.
vHandle := AHandle; //vHandle is not a valid handle value.
//do some stuff with vHandle.
I'am using it to Initiat a ActiveX component(look below). MediaType is
created using VarArrayCreate(..., varByte);
end;
IViewer = dispinterface
procedure Init(NumberOfStreams: Integer; MediaType: OleVariant; hWnd:
{??Int64} OleVariant); dispid 2;
A Visual studio c++ exeple:
// Initialize our viewer
varMediaType = SafeArray.Detach();
viewer.Init(1, varMediaType, (INT64) GetSafeHwnd());
SafeArray.Attach(varMediaType);
Documentation says:
public: void Init(
[in] LONG NumberOfStreams,
[in] VARIANT MediaType,
[in] LONGLONG hWnd
);
Parameters
NumberOfStreams
Reserved. Set to 0.
MediaType
A byte array of media types describing the media sub streams.
hWnd
Handle to a window where video will be rendered. If NULL, video will not
be
rendered.
//Tobias
In this example i do not see any Handle as Variant - in your sample this
is LONGLONG i suppose that this is Int64(DELPHI).
I ommit something?
|
In the file created with borland using import type library the decleration
is a OleVariant.
IViewer = dispinterface
['']
procedure Init(NumberOfStreams: Integer; MediaType: OleVariant; hWnd:
{??Int64}OleVariant); dispid 2;
//Tobias |
|
| Back to top |
|
 |
Karol Bieniaszewski Guest
|
Posted: Wed May 09, 2007 7:27 pm Post subject: Re: THandle to OleVariant under windows 2000 |
|
|
Użytkownik "Tobias" <tobias__a (AT) hotmail (DOT) com> napisał w wiadomości
news:4641b81a (AT) newsgroups (DOT) borland.com...
| Quote: | THandle is nothing more than an unsigned 4 byte integer.
What exactly do you mean by "vHandle is not a valid handle value"?
procedure AssignHandle(AHandle : THandle);
var
vHandle : OleVariant;
begin
//AHandle is a handle to a form or a Panel.
vHandle is a handle to a Panel.
vHandle := AHandle; //vHandle is not a valid handle value.
//do some stuff with vHandle.
I'am using it to Initiat a ActiveX component(look below). MediaType is
created using VarArrayCreate(..., varByte);
end;
IViewer = dispinterface
procedure Init(NumberOfStreams: Integer; MediaType: OleVariant; hWnd:
{??Int64} OleVariant); dispid 2;
A Visual studio c++ exeple:
// Initialize our viewer
varMediaType = SafeArray.Detach();
viewer.Init(1, varMediaType, (INT64) GetSafeHwnd());
SafeArray.Attach(varMediaType);
Documentation says:
public: void Init(
[in] LONG NumberOfStreams,
[in] VARIANT MediaType,
[in] LONGLONG hWnd
);
Parameters
NumberOfStreams
Reserved. Set to 0.
MediaType
A byte array of media types describing the media sub streams.
hWnd
Handle to a window where video will be rendered. If NULL, video will not
be
rendered.
//Tobias
In this example i do not see any Handle as Variant - in your sample this
is LONGLONG i suppose that this is Int64(DELPHI).
I ommit something?
In the file created with borland using import type library the
decleration is a OleVariant.
IViewer = dispinterface
['']
procedure Init(NumberOfStreams: Integer; MediaType: OleVariant; hWnd:
{??Int64}OleVariant); dispid 2;
//Tobias
|
may by you must change it to CARDINAL - 4Bytes or INT64 - 8 Bytes
in this imported type library.
I suppose that OleVariant is not good to store handle and autor of this
library use some number value.
Try change it to int64 if this is reali LONGLONG in documentation
Karol Bieniaszewski |
|
| Back to top |
|
 |
Tobias Guest
|
Posted: Thu May 10, 2007 3:43 pm Post subject: Re: THandle to OleVariant under windows 2000 |
|
|
| Quote: | may by you must change it to CARDINAL - 4Bytes or INT64 - 8 Bytes
in this imported type library.
I suppose that OleVariant is not good to store handle and autor of this
library use some number value.
Try change it to int64 if this is reali LONGLONG in documentation
|
Ole automation cant handle int64 in delphi 5
What can i do? |
|
| Back to top |
|
 |
|
|
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
|
|