loading library?

Post your C and C++ discussions here
Post Reply
greanie
Newbie
Posts: 0
Joined: Tue Jun 01, 2010 10:12 am

loading library?

Post by greanie »

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.

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: loading library?

Post by Robin »

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

Post Reply