Test and Measurement Forum

VB example runs on 32 bit but not 64 bit computer

Post your VB and VBA discussions here

VB example runs on 32 bit but not 64 bit computer

Postby jeff789 » Mon Aug 20, 2012 11:01 pm

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?
jeff789
Newbie
 
Posts: 0
Joined: Fri Aug 17, 2012 11:12 pm

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

Postby Hitesh » Tue Aug 21, 2012 11:23 am

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,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

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

Postby jeff789 » Tue Aug 21, 2012 3:13 pm

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 <New...>] . 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/Changing-the-target-cpu-in-VB-express-2008.aspx.

It looks like it amounts to simply changing the <PlatformTarget> under the first <PropertyGroup> section to "x86".
jeff789
Newbie
 
Posts: 0
Joined: Fri Aug 17, 2012 11:12 pm


Return to VB and VBA (Excel, Access)

Who is online

Users browsing this forum: No registered users and 0 guests