Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TWebBrowser problem 1

Status
Not open for further replies.

Berndt

Programmer
Dec 28, 2002
1
SE
Hi

Does anyone know why I get following error message?
"[Error] SHDocVw_TLB.pas(1502): Incompatible types: 'TControlData2' and 'TControlData'"

I am using Delphi4 (ok I know it is old but it works fine) and win2k, it was working fine a few months ago but now it does not compile anymore.

Below is the code where it fails.

Thankful for a quick answer, please.
//Berndt


From SHDocVw_TLB.pas

procedure TWebBrowser_V1.InitControlData;
const
CEventDispIDs: array [0..16] of DWORD = (
$00000064, $00000065, $00000066, $0000006C, $00000068, $00000069,
$0000006A, $0000006B, $00000071, $000000C8, $000000C9, $000000CC,
$00000067, $0000006D, $0000006E, $0000006F, $00000070);
CControlData: TControlData2 = (
ClassID: '{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B}';
EventIID: '{EAB22AC2-30C1-11CF-A7EB-0000C05BAE0B}';
EventCount: 17;
EventDispIDs: @CEventDispIDs;
LicenseKey: nil;
Flags: $00000000;
Version: 401);
begin
ControlData := @CControlData; !!!!!!!!!fails here
TControlData2(CControlData).FirstEventOfs :=
Cardinal(@@FOnBeforeNavigate) - Cardinal(Self);
end;

 
Where have you listed the var "ControlData"? (I see only CEventDispIDs and CControlData.) What type is it?

-D
 
Hi again,

The code is a cut-out from the ActiveX object from Windows (I think) so I have not declared any variables for this.
Strange thing is that on my laptop I get the same error message if I rebuild the project, but if I just compile it it works fine and no errors are seen, this is not the case on my desktop PC, here nothing works, so maybe it's a config thing on my desktop but I cannot figure it out.

//Berndt
 
Verify that "Project/Options/Compiler/Typed @ operator" is NOT checked in both compilers.

buho (A).

 
thanx buho, that fixed the compiler error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top