using mfc libraries in cf

  • Thread starter Thread starter Emre Dincer
  • Start date Start date
E

Emre Dincer

i need to import CPtrList class to .net cf. is it possible to use dll's of
mfc in cf?
any help would be appreciated
regards
emre dincer
 
Not really. Classes are based on vtables. You will need to create a wrapper
that flattens calls to the class instances in a same way as people do for
COM objects. It's not worth it
 
Dear Feinman,
Is there any example or tutorial writing wrapper in CF?
Any help will be appreciated.
 
I'm not aware that there are any samples of wrapping an MFC class to use in
CF. However you'll be sure to have a much neater solution which will not be
platform and processor dependant - not to mention the effort and testing
required to build a wrapper round the mfc stuff - if you use the collection
classes available within .NETCF.

The .NET Compact Framework has built in support for Arrays, ArrayLists
(resisable arrays), Stacks, Queues and Hashtables - all of which are
mirrored in the full desktop .NET Framework. You also have the ability to
build your own collection classes deriving from the intrinsic collection
classes and interfaces provided. If you post some information on the type of
collection you are maintaining and the operations you want to perform on it
we can suggest some more specific examples.

Peter

--
Peter Foot
Windows Embedded MVP

In The Hand
http://www.inthehand.com
Handheld Interactive Reference Guides
 
cant I marshal them into .net framework?
Andrew McGrath said:
You can't use MFC in .NET or .NET Compact Framework.

Look up the System.Collections namespace in .NET for some help.

HTH

Andrew
 
Alex Feinman has already answered this question:

"You will need to create a wrapper
that flattens calls to the class instances in a same way
as people do for COM objects."

Which means that you'd need to create a DLL in eVC++ that
exports the functions that'd create a instance of your MFC
class and call it's methods and properties. You then will
be able to use this DLL from CF through P/Invoke.

HTH... Alex
 
Back
Top