Macro Error Compilation (32-64 Bits)

Hello

As mentioned in a previous question, I want to modify a feature macro

See attached tutorial:

http://www.lynkoa.com/tutos/r%C3%A9alisation-dune-macro-fonction-dans-solidworks

The problem is that the example is not applied to my position. because it shows me the following error:

Is it possible on a workstation under 7 64 bits to launch a macro made in 32 Bits?

Or what needs to be changed in order to be able to launch it?

Thank you

Hello

Yes there may be compatibility issues, see this link:

http://www.mycadblog.fr/problemes-de-compatibilite-des-macros-vba-v6-3-avec-solidworks-2013/

 

1 Like

That's right, so I replaced  Declare with Declare Ptfsafe as below in 2 places in the frmMain code and it works again:

Private Declare PtrSafe Function FindWindow Lib "user32" aka "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare PtrSafe Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

 

I knew that there were compatibility problems due to the versions but I hadn't thought about that.

Thank you@.PL

1 Like