VB example runs on 32 bit but not 64 bit computer

Post your VB and VBA discussions here
Post Reply
jeff789
Newbie
Posts: 0
Joined: Fri Aug 17, 2012 11:12 pm

VB example runs on 32 bit but not 64 bit computer

Post by jeff789 »

My picoscope 4424 works using the Excel example that I downloaded off the Pico website but I can't seem to run the Visual Basic example on my 64 bit, Windows 7, 1 year old computer. The Visual Basic example does however work on my 32 bit laptop running Windows 7.

right near the beginning of the code, when it runs the following line:
status = ps4000OpenUnit(UnitModel.handle)
I get the following error message:
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

anyone know the answer?

Hitesh

Re: VB example runs on 32 bit but not 64 bit computer

Post by Hitesh »

Hi Jeff,

In your project setup, please ensure that the project compiles the application for an x86 platform (or possibly 'Any CPU'). If there any settings relating to 64-bit please change them to 'x86'.

The ps4000.dll file is a 32-bit dll so it will not be compatible if you try to run your application as a 64-bit process.

I hope this helps.

Regards,

jeff789
Newbie
Posts: 0
Joined: Fri Aug 17, 2012 11:12 pm

Re: VB example runs on 32 bit but not 64 bit computer

Post by jeff789 »

I found a good answer in another forum - and I've edited it to make it clearer using brackets for my edits [ ]

quoting from the other forum:

I believe the reason you don't see the Compile tab in the project properties is because you're using the Express edition. Optimization for a specific CPU type is not offically supported in this edition. However, you should be able to change the active solution platform in the following way:

From the "Tools" menu, select the "Options" item, and then select the "Projects and Solutions" option in the listbox on the left-hand side of the Options dialog. (You might have to check "Show all settings" first.) Check the box that says "Show advanced build configurations".

Then, on the "Build" menu, see if you have an item called "Configuration Manager". If not, you need to add the item to the menu (right-click on any area in the toolbar and choose "Customize" at the bottom of the list).

Once you've opened the Configuration Manager dialog, go to the "Active solution platform" drop-down box and choose "New" [it literally says ] . From the "New Solution Platform" dialog that appears, you should be able to choose "x86" from the first drop-down box. [in the box that says "Type or select the new platform", I changed it from "Itanium" to x86]

Alternatively, it looks like you can manually edit the project file to specify the CPU type. See here:


**Pico Technology Limited cannot be held responsible for the linked content of external websites**

http://www.onteorasoftware.net/post/Cha ... -2008.aspx.

It looks like it amounts to simply changing the under the first section to "x86".

Post Reply