|
| |
Download Entire Document
At this point we are assuming your CE control has already been created.
Write down the names of the source code files in the CE Version of the project. These
files should have the following extensions: .cpp, .h, .odl, .idl, .rc, and .def.
Close the CE version of the project (If it is open)
Now, you will use Visual C++ to create a BRAND NEW "Win32" PROJECT with
the same name as the original control (Place the control in a different directory than the
original).

NOTE: For MFC controls, use the MFC ActiveX ControlWizard;
for ATL controls, use the ATL COM AppWizard. At this point you should have 1 project for
the CE version of the control and a 2nd project for the desktop
"Win32" project type.
Except for stdafx.cpp, delete all source files, headers, and dependencies from
the new "Win32" project and close the new project workspace.

Close the entire WorkSpace in Visual C++.
Using Windows Explorer, find the directory where you created the Win 32 Desktop version
of the CE control. Rename the .dsp and .dsw files by appending "_win32" to the
original filename.

With a text editor, such as Notepad, open the new .dsw file, change the
"*.dsp" text to whatever you renamed the .dsp file to in the step above, save
your changes, and then close the .dsw file when done editing.

Copy the new .dsp and .dsw files to the original CE control project directory. This
directory contains the original .dsp and .dsw files, plus the source files.

Open the new "_win32" .dsw file in Visual Studio as a workspace and add the
files from step 1 to this project.
NOTE: AT this point we are going to be getting ready to compile the application for
the Desktop version of the control. This version will only provide the method, properties,
and event stubs for the calling application. Therefore, to eliminate compile errors (Since
we are really compiling CE specific code in a Win 32 environment) you should add
conditional "CE". Surround the existing code with #ifdef UNDER_CE and #endif.
You should surround all code except the function header and return value.

Before you compile, change the output control name to the same name as the original
control project name. This control name is specified in Project, Settings, Link,
and Output file name.
In order to make the control a valid Windows CE Control, you must add a registry hack by
modifying the .rgs file in the _win32 project as seen here:

At this point, you may need to make misc changes to the project source code to account
for Unicode and ASCII string usage Windows CE is Unicode only, and Windows 95/98 is
ASCII only and to account for the differences between the Windows CE operating
system and Windows desktop operating systems. See Step 10 for conditional compilation.
Recompile and you should now have a Windows version of your Windows CE ActiveX control.
After compiling the CE version (For emulation and the Device), and the Win32 project
for the desktop, you should be able to add the control to the Visual Basic Toolbox.
If you try and add the control to your VB application and you get the familiar error:

Make sure you followed Step #12!
If step #12 did not work correctly, you must manually add a new key within the registry
to your control. Adding the key of "Windows CE Control" will allow your control
to be placed on a VB form.
1) Start RegEdit
2) Use the Find option (Under the Edit Menu) to search for the name of your custom
control.
3) Once the control is found, you must add a new key called "Windows CE
Control"

Final Steps
The final step in registering the CE desktop version of your
ActiveX control is to use the CE Control Manager. Register the desktop version of your
control in the appropriate environment (Palm-Size, H/PC, H/PC Pro, etc..) using the
Control/Add New Control menu.

Download Entire Document
License Agreement
This document is provided "as-is". Neither the author nor its suppliers makes
any warranty, express or implied with respect to the content of this software or the
accuracy of any information contained herein, including, without limitation, the implied
warranties of merchantability or fitness for a particular purpose. Because some states /
jurisdictions do not allow exclusions of implied warranties, the above limitation may not
apply to you.
In no event shall the author or its suppliers be liable for any damages whatsoever
(including, without limitation, damages for loss of business profits, business
interruption, loss of business information, or other pecuniary loss) arising out of the
use of or inability to use this product, even if the author has been advised of the
possibility of such damages. Because some states do not allow the exclusion or limitation
of liability for consequential or incidental damages, the above limitation may not apply
to you.
Distribution
Freeware - this document is provided "as-is". Neither the author nor its
suppliers makes any warranty, express or implied with respect to the content of this
document or the accuracy of any information contained herein, including, without
limitation, the implied warranties of merchantability or fitness for a particular purpose.
|