1
votes

I have developed an MFC ActiveX control and created necessary cab files and inf file. It is working perfectly in 32 bit IE. When i try to access it in 64 bit IE, it is prompting me to install but when i try to access the function it fails with error message "Object does not support this property or method" in the line where i am calling the function. Should i need to do anything special for 64 bit IE?

Solution

As mentioned by yms i compiled my control in 64 bit mode and generated 2 CAB files. I modified by web page to download appropriate CAB file

<script language="jscript">
document.write("<OBJECT width='600' height='300' id='ActiveXPowUpload' " 
    + "CLASSID='CLSID:FB98CEED-9DE1-4517-B30C-CDA19C6D150B' ");
if(navigator.cpuClass.toLowerCase() == "x64") {
    document.write("codebase='ActiveXPowUpload-x64.cab#Version=1,0,0,1'>\n");
} else {
    document.write("codebase='ActiveXPowUpload-x86.cab#Version=1,0,0,1'>\n");
}
document.write("<param name='UploadURL' value='http://hostname/path/to/upload/script.aspx' />\n");
document.write("<param name='EnablePopupMenu' value='false' />\n");
<!-- other parameters -->
document.write("</OBJECT>\n");

1
I suppose you created two different dlls, one for each cpu architecture, right?yms
@yms no, i am just trying with one ocx fileJeeva

1 Answers

1
votes

32 bits dlls cannot be used directly in 64 bit applications.You need to create one dll for each CPU architecture.

64 bit versions of Windows provide two different registry storages, one for 32 bit applications and one for 64 bit ones, so you can register both dlls and type libraries with the same GUID and each application will peak the right dll depending on the CPU architecture for which it was built.