about MFC & .NET CF

  • Thread starter Thread starter rocio
  • Start date Start date
R

rocio

I finally received a SDK from the vendor of my camera to access the program
from within my program, but this SDK is written in embedded visual C++, it
includes a bunch of DLL's, .h files and a lib file. The instructions just
say to put some of these files in my project directory , compile & link.

But as you know I'm programming here with .NET. Readeing further some of the
txt files included with this SDK says something about using the Microsoft
Foundation Classes.....the little research I've done just tells me that
these classes can be used from within visual C++, is this correct? Can't I
access then this SDK form .NET CF?

I have requested the vendor for a .NET specific SDK, but they have none at
the moment.
 
We can't tell you, for certain, whether you can use the SDK or not. If it
displays a bunch of windows on the screen, probably not without a huge
amount of work. If it just provides some calls like TakePicture(), which
returns, say, an allocated block of memory containing the picture, then you
can p/invoke the function from your .NET CF program. You'd still have to
figure out what to *do* with the array of bytes you got back, of course.

Paul T.
 
If all they have are C interfaces (which it sounds like is the case) then
you'll have to P/Invoke everything.
 
I was thinking on that. The documentation I found on how to use P/Invoke
implies calling Dll's in the windows environemnet. Since these are DLL's
outside windows, do I need to register them first? Well I tried and I get
the error message:

"veocam.dll is not an executable file and no registration helper is
registered for this file type."

any ideas what this mean? Note that the SDK has as an instruction to "copy
veocam.dll to my /windows directory in the Pocket PC", assuming I'll be
using embedded visual c++

-rocio
 
What do you mean: outside windows? What other environment would the DLL be
running in on the PPC?

Are you sure that you copied the correct DLL for the processor your PPC has
to the \Windows directory on the device (you can use ActiveSync for this)?
Since you aren't copying the file from the eVC environment, you'll have to
manually register the DLL, unless it has an install program to run on the PC
which uses ActiveSync to handle registration for you. If you have to
register it manually, run the regsvrce.exe program with the DLL's file name
on the command line. Something like:

regsvrce.exe veocam.dll

Paul T.
 
Paul,

Let me understand well.

Where do I need to register this DLL, at the PPC, at my desktop PC or on
both?

I figured had to be on both, since I'm developing at my desktop PC testing
everything on the PPC emulator first.

To register this dll in my desktop I was using:

regsvr32 "C:\VEO\veocamapi.dll"

and getting that error I explained before.

I'm looking for regsvrce.exe to try it, but I believe this is something that
should be in the PPC, not in the desktop, correct?

The instructions that came with the SDK say very plainly:

1,How to use veo photo traveler CF Camera SDK.

a) Copy veocamapi.h and veocamapi.lib to your project directory, then
compile and link.

b) Copy veocamapi.dll to pocket pc \\Windows directory.

2,The detail description of SDK is in veocamapi.h

So I probably do not need to register anything.....just try P/Invoke and run
the program in the PPC not the emulator? I tried copying veocamapi.dll to
the emulator \\Windows directory, but was not successful.

Sorry for this, but I'm really new to some of this stuff.....your help will
be very appreciated.

Rocio
 
You don't have to do anything with the DLL on the PC. It wouldn't even run
on the PC if it's targeted at PPC. There's no surprise at all that you got
the error there.

Yes, regsvrce.exe is on the PPC. If you don't find it pre-installed, you'll
have to install eVC and the Pocket PC SDK and copy it with ActiveSync, also,
if you need it. If it doesn't require registration, yes, you should be able
to just try p/invoking the calls.

Paul T.
 
Back
Top