Re: How to Deploy a custom evc++ MFC based DLL into CE .Net device

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Paul G. Tobey [eMVP] (ptobey)
Date: 12/15/04


Date: Wed, 15 Dec 2004 09:11:52 -0700

I doubt that the problem is a missing DLL. It's *much* more likely that the
name it's looking for isn't there. Use the dependency viewer to look at the
native DLL and verify that the exported function name matches what you're
trying to call from your P/Invoke code. You *are* deploying a DLL which was
compiled for the right platform, right? You can't copy your PPC DLL to the
emulator and use it; it's compiled for the wrong processor. The opposite is
also true...

EXTERN_C probably is defined, in the case of C++ to extern "C".

Paul T.

"PJ" <PJ@discussions.microsoft.com> wrote in message
news:B82F4EA6-D523-4EDE-94D2-38FB15EC5DF8@microsoft.com...
> Thanks Paul,
>
> Yes you are right, deploying does not generate errors. When the
> application
> is executed, I receive the error (I hit the F5 button which deploys and
> runs
> the application). The Subclasser.cs module makes a call to the subclass
> method in the DLL file named CFNative.DLL. However when that is commented
> out, the error does not show up, but the keyboard functionality does not
> work
> as expected. So the problem does seem to be that the P/Invoking is not
> able
> to find CFNative.dll file and hence the method.
>
> Well I thought that the DLL should end up in the \Windows and I tried
> copying the DLL manually both in the emulator and on physical device but
> it
> does not seem to help. I did this by including the DLL in the applications
> as
> content file and then copying it manually into \Windows directory. Is that
> approach correct? OR is there any other alternative?
>
> Yes I did make sure that it was release build and also EXTERN_C was used.
> However the functions have definitions with expression EXTERN_C and not
> extern "c" as you have suggested. Does that make a difference? I will try
> it
> out too.
>
> Thanks for the response, but if you could help me through this I would
> appreciate.
>
> Regards
> PJ
>
> "Paul G. Tobey [eMVP]" wrote:
>
>> DLLs generally end up in \Windows. That does *not* sound like a
>> deployment
>> error to me. If you choose Deploy in the VS.NET environment, you don't
>> get
>> that error, right? It's just when you run the managed application?
>>
>> Make sure that you've followed the instructions about function
>> declarations
>> (extern "C"), and that you've paid close attention to building the DLL as
>> a
>> Release, not Debug, version (as indicated in the text).
>>
>> Paul T.
>>
>> "PJ" <PJ@discussions.microsoft.com> wrote in message
>> news:B18F4F7E-565C-4266-B54D-C2CB54C78646@microsoft.com...
>> > Hi,
>> >
>> > I have been trying to add keyboard support to windows CE based set top
>> > box.
>> > I found an article on MSDN site that provides code for keyboard support
>> > and
>> > explains how it works.
>> >
>> > http://msdn.microsoft.com/msdnmag/issues/04/04/KeyboardSupport/default.aspx
>> >
>> > I was able to compile both managed code on VS studio 2003 and unmanaged
>> > code
>> > on evc++ ( as a MFC shared dll). However none of the method suggested
>> > in
>> > the
>> > article or any other source works for deploying the DLLs neither into
>> > Emulator nor onto physical device. I keep receiving the
>> > 'MissingMethodException" when the application is deployed. Could
>> > someone
>> > please point out how to deploy a cutom built DLL using evc++ into a CE
>> > .net
>> > target device and emulator. I tried the following methods and failed.
>> >
>> > 1. Added the DLL as a content file into the Managed code application.
>> > Even
>> > tried copying the DLL from the \program file to \windows on both
>> > emulator
>> > and physical device but failed.
>> >
>> > 2. Tried to add the unmanaged code into platform builder and create an
>> > image, keep receiving fatal errors RC10.. Cannot find "afxres.h" and
>> > "afres.rc". Also get fatal error c1083: cannot open precomplied header
>> > files.
>> >
>> > Could any one please help or point out how to solve this problem.?
>> >
>> > In which folder should the DLL be typically placed on the target
>> > windows
>> > CE
>> > device?
>> >
>> > THanks in advance
>> > PJ
>>
>>
>>


Quantcast