EDN Admin
Well-known member
Porting to x64: MFC x86 DLL implementing OLE Automation for MS Word, Access, DAO
I have an app written several years ago that I am porting to x64.
It consists of a VB.Net GUI using .Net 1.1 and several unmanaged C++ DLLs.
Updating the program went well. The VB.Net program runs well on .Net 4.0 and all the DLLs, except one, run fine as 64 bit DLLs. For the DLL that doesnt run as 64 bit I created a stub with that just returns SUCCESS for every function call.
The DLL that I have trouble with as 64 bit uses MFC and creates MS Word documents using OLE automation and updates an Access database using DAO.
Since MS Word and DAO are only available on 32 bit I created a COM server using a DLL Surrogate to run the code. The issue I am concerned with is using pointers to pass parameters back and forth.
Here is an example C++ prototype I am using:
DWORD dtmDBaseToTags
( IN const struct UserData_t * pzUserData
, IN struct DataTag_t* pzDataTag
);
This function uses the names in pzDataTag to pull data from the Access database and put it into the struct pzUserData.
I dont think this will work over a COM / ActiveX boundary.
How can I access memory in a 32 bit process using a 64 bit pointer?
Will the ActiveX COM Server DLL be able to access the 64 bit memory?
What is the best course of action to take to port this code to 64 bit?
//========================== // Michael Fitzpatrick //==========================
View the full article
I have an app written several years ago that I am porting to x64.
It consists of a VB.Net GUI using .Net 1.1 and several unmanaged C++ DLLs.
Updating the program went well. The VB.Net program runs well on .Net 4.0 and all the DLLs, except one, run fine as 64 bit DLLs. For the DLL that doesnt run as 64 bit I created a stub with that just returns SUCCESS for every function call.
The DLL that I have trouble with as 64 bit uses MFC and creates MS Word documents using OLE automation and updates an Access database using DAO.
Since MS Word and DAO are only available on 32 bit I created a COM server using a DLL Surrogate to run the code. The issue I am concerned with is using pointers to pass parameters back and forth.
Here is an example C++ prototype I am using:
DWORD dtmDBaseToTags
( IN const struct UserData_t * pzUserData
, IN struct DataTag_t* pzDataTag
);
This function uses the names in pzDataTag to pull data from the Access database and put it into the struct pzUserData.
I dont think this will work over a COM / ActiveX boundary.
How can I access memory in a 32 bit process using a 64 bit pointer?
Will the ActiveX COM Server DLL be able to access the 64 bit memory?
What is the best course of action to take to port this code to 64 bit?
//========================== // Michael Fitzpatrick //==========================
View the full article