![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Code Samples & Tips Share your recent discoveries and ideas with other users. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Cableguy,
Let' start over. An example: I want to build a B4P library DLL that provides .Net Event processing. Using their C++ names, I will use the .Net equivalent of CreateEvent, SetEvent, ResetEvent, WaitForMultipleObjects, and CloseHandle. All of those methods exist in both .Net for the PC and .Net CF (both 2.0) and have the same parameters. My assumption, which could be very wrong, is that I can write one piece of source code that provides the functionality for creating an event, waiting for event to be posted, posting the event, and destroying the event. In the simpliest case, I would have to compile that source twice, once for the PC and once for the device, in each case creating a DLL with the same name. So far, is my assumption correct? If so, how do I manage the source file, the two output files, and the project file? Or, is the simpliest way to simply treat them as two different projects (one for the PC and one for the device) and manually keep the source the same in both. Regards, Jim |
|
||||
|
Yes, let's...
Quote:
As I sayed before, any DLL targeting the Compact(ed) FrameWork, WILL run on bothe platforms. Quote:
So, Yes, Two (or more, since B4PPc has added support for Smartphone compilation) diferent EXE would have to be created, trough compilation on the IDE, targeting the especific platform as needed...Still all the other files (i.e. DLL, Txt, etc) would be the same.... In some cases, especially with the legacy and forcedQVGA Mode compiling, some extra files may be created during compilation. The souce file (.spb) does Not need to be provided with the compiled project...unless of course, you make it available for your own purposes.
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD |
|
|||
|
OK, I suppose the best course is just to manually manage the projects with a PC and Device folder structure where separate project files are maintained and possibly a common source folder.
But you said one thing that I don't completely understand. Quote:
Or are you saying that by targeting .Net CF they are functionally the same, guaranteed not to use incompatible classes, BUT the actual DLL generate code is different and thus there are two DLLs, one for PC and one for device. The only things they share are use of .Net CF, their name, and source. I had assumed that I had to have two versions of the DLL just like the B4P.exe files. If they are different then the manual management will be fine. Hope you have a nice weekend. Regards, Jim Last edited by obrienj : 05-30-2008 at 11:15 PM. |
|
||||
|
Quote:
If your DLL as been built to work with the Compact Framework, let say, 2.0, Then, as long as you also have the .Net Framework 2.0 installed in your Desktop, IT will work... Proof os that is some of the B4PPc packaged Dll's have only one file that works both in the device and the desktop, as the Sprite.DLL, you only have to be sure you have add it in the components, to both the device and the desktop.... Some other DLL's, like CryptoDevice and CryptoDesktop, have two version, specific to their platforms...So they should be added to the correct target in components... But the same object can be used in any case... for instance a cryptodevice object called crypt, can also be used with the cryptodesktop, without any problem...Because the compiled file will only be using the correct DLL....and in this particular case, you only need to keep in the folder, the targeted DLL...ie, a device targeted app, developed in the desktop, will have both DLL's added in design time, but in order to run, in the device, it only needs the device version DLL... I hope I'm beeing clear, but since english is not my mother language, I appologise for any missplelling, or missunderstanding i might have created... Quote:
Hope your's is twice as good... Happy codding!
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD |
|
|||
|
Cableguy,
Don't worry at all about your English, you do very well. In all the years I traveled internationally with a large computer company, it always embarrassed me to not be able to speak another language but I just don't have that talent. Fortunately during the last years with that company I traveled with a guy who spoke and wrote 11 languages and picked up new ones like I drink sodas. Anyway, I have been doing some testing and, quite frankly, playing. Is the following true? (I think you may have already said this but it didn't sink in.) If I compile my C# DLL targeting NET CF and I compile my B4P program as a device .exe, both will run on both platforms? OK, if that is true, why? Is C# coupled with Net CF interpreted like Java? If not, I really need an explanation. Regards, Jim |
|
||||
|
Quote:
Quote:
The main difference is that not All controls, properties, method,etc... have been provided by all those languages, as it was a prerrogative of their own developers/implementers... the main reason that c# is so far spread in the community, is thet it seems to have the more broad coverage of the .Net Framework, thus giving the more flexible programing eviroment...
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD |
|
|||
|
Cableguy,
Quote:
I compiled the DLL (MyDLL) targeting NET CF. I then compiled the B4P test program specifing Device EXE as the target. As a reult I have only 1 MYDll.DLL and 1 test_MyDLL.exe. I copied both to my device using ActiveSync's Explore Pocket PC and successfully ran the application. This was as expected. I then went back to the PC, and executed the exact same test_myDLL.exe as I had just copied to the device and IT RAN PERFECTLY. I don't understand this. Regards, Jim |
|
||||
|
If you use optimised compile your device EXE will run on your desktop also. Non optimised EXE will not.
.NETCF is a subset of .NET so targeting .NETCF and staying inside the borders (do not P/Invoke for example) lets your DLL to be compatible with both device and desktop. .NET EXEs are not platform/processor dependent (a kind like java but not exactly the same) Last edited by dzt : 05-31-2008 at 09:50 AM. |
|
|||
|
dzt,
Thank you for the explanation, I thought I was going bonkers as it was not what I expected to be the case. But having a common denominator is a good thing in some cases. This has been fun. I guess it's what keeps me playing with computers long past my retirement. But over a 45 year career, I always enjoyed learning a new system or language. I did notice that policing of what is and is not supported isn't all that good in either .NET or #develop. For example, System.Threading.Mutex defines that creating a named Mutex in .Net CF isn't supported, yet if I target Net CF 2.0 (only one I tried), it compiles with no issue. I realize that the doc on MSDN maybe wrong, but either way it makes it a bit of a guessing game. Have you had this experience? Regards, Jim |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to create .cab file for Smartphone? | RCC2k7 | Questions & Help Needed | 1 | 05-30-2008 07:02 AM |
| How to create a new appointment | willisgt | Questions & Help Needed | 2 | 05-15-2008 08:21 PM |
| how to create a database ? | gjoisa | Questions & Help Needed | 27 | 02-14-2008 05:38 PM |
| Can you help me create B4P lib? | conf | Questions & Help Needed | 7 | 08-20-2007 07:41 PM |
| how to create spreadsheetlike function? | Stellaferox | Questions & Help Needed | 10 | 06-30-2007 01:09 PM |