Test and Measurement Forum

loading library?

Post your C and C++ discussions here

loading library?

Postby greanie » Wed Jun 02, 2010 1:01 pm

Forgive me for this total n00bie question; I haven't programmed in MFC in a while. I compiled and ran the sample application no problem. Now I want to write my own in MFC. I wrote a wrapper class to you ps3000.c & .h. Right now, it has only a constructor and initialize function, which calls ps3000_open_unit. I get the following error:

error C2440: '=' : cannot convert from 'ps3000_open_unit' to 'INT'

on this line

g_Handle = ps3000_open_unit();

If I take that line out, my program compiles fine. Did I forget to load the library or something? I looked for a LoadLibrary call in your example but didn't find one. dll is in the same directory as the executable.

I'm sure this error has nothing to do with your code but help would be greatly appreciated.
greanie
Newbie
 
Posts: 0
Joined: Tue Jun 01, 2010 10:12 am

Re: loading library?

Postby Robin » Mon Jun 07, 2010 9:09 am

Hi

Have you included ps3000.h?

#include "ps3000.h"

is g_Handle a short?

You will also need to include the .lib file in your project. If the lib file is missing, it will cause a linker error rather than a compiler error.

Robin
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am


Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests