CS0246 ControlExDevice and Desktop

micro

Well-Known Member
Licensed User
Longtime User
Hi Agraham,
I am using the object inbox of your library ControlExDevice(1.5) and ControlExDesktop(1.4) and all the code works fine on the desktop.
If compiling for the device (optimized mode) appears this error:
"Error CS0246"
The Type or Namespace name 'ControlExDesktop' could not be found (are you missing a using directive or an assembly reference?).

Why this error?
The ControlExDesktop is only for desktop and not for device.

Best Regards
 

agraham

Expert
Licensed User
Longtime User
You cannot use both ControlsExDesktop and ControlsExDevice in the same project as they are very different libraries. The compiler expects the desktop and the device libraries to look the same and implement the same objects, methods and properties. As each of these libraries uses controls that are specific to the desktop or device then they look completely different to the compiler.

To make a desktop app using ControlsExDesktop then add it as a component to the desktop only. This app cannot then be compiled for the device.

To make a device app using ControlsExDevice then add it as a component to the device and add ControlsExDeviceDummy as a component to the desktop. This app can then be developed on the desktop and will compile for both desktop and device. However the desktop library only simulates some of the controls as they are not present on the desktop and so the desktop app will not be fully functional. Also be aware of this pitfall http://www.b4x.com/forum/questions-help-needed/2834-cs0234.html
 

pda8888

New Member
I get a copy of your ControlExDesktop.dll and ControlExDevice.dll, and both of their version is 1.0, I complie the device side program follow your indication(to remove ControlExDesktop.dll and add ControlExDevice.dll to Desktop side at "tools"->"components"), and the program get an error when it running on device:"An error occured on sub __main_app_start. InvalidCastException".
BTW:
1. My source is: dtp.New1("pnlRecord",70,60,158) 'dtp is DateTimerPicker object
2. If I Use ControlExDesktop.dll on desktop, the program runs well.
Can you email me the newest version?
 

agraham

Expert
Licensed User
Longtime User
You appear on the forum as an unlicensed user of Basic4ppc. The additional libraries are only available to licensed users of Basic4ppc.

If you were a licensed user you would be able to download any additional libraries that you required. As an unlicensed user you do not have my permission to use any of my libraries and are in violation of my copyright in doing so.

If you are in fact a licensed user then you should email [email protected] to get your forum status amended so you can access any libraries you require.
 
Top