473,657 Members | 2,574 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to load a DLL from .NET Compact Framework. Originally used eVC 3.0

I've developed several programs for the Pocket PC in eMbedded Visual C
(API calls only, no MFC). All of these programs made use of a
third-party DLL called SecureTrial (www.zedev.com) to create 30-day
trial versions of the programs. The DLL was loaded dynamically at
run-time using LoadLibrary and GetProcAddress, as shown in the code
below. For the SecureTrial library, all I have are .DLL files
compiled for the MIPS, ARM, and SH3 processors (no source or
anything).

typedef DWORD (CALLBACK *ULPRET)(TRIALI NFO);

DWORD stCheckTrial(TR IALINFO ti) {

HINSTANCE hinstLib;
ULPRET lpfnDLLProc;

// get pointer to function stCheckTrial in strial.dll
// then call the function and return its return value
// ti is a struct containing integer and UNICODE string data
// I removed the error checking code (verifying that hinstLib and
// lpfnDLLProc aren't NULL)
// just to simplify things for this example
hinstLib = LoadLibrary(TEX T("strial.dll") );
lpfnDLLProc = (ULPRET)GetProc Address(hinstLi b,
TEXT("stCheckTr ial"));
retval = (*lpfnDLLProc)( ti);
FreeLibrary(hin stLib);

return retval;
}

I'm now considering switching over to Visual C++ .NET or Visual Basic
..NET, and I'm trying to gauge how difficult it will be to make this
new code call the old DLLs. I don't have any familiarity with those
environments, so I'm hoping someone can provide some insight. If it
can be done, what I'd really love to see are code snippets like the
one above but written in VC++.NET or VB.NET that will call the same
DLL. I'm just concerned about sinking a lot of time into learning one
or both of these environments, only to find that I won't be able to
use this existing library.

Will the fact that the DLLs were already compiled for specific
processors using eVC be a problem? What about building up the
TRIALINFO structure ti in Visual Basic .NET? I know this would be a
problem in eMbedded Visual Basic 3.0, since it's not possible to build
the struct in that language. I believe that there is an alternate
version of the function stCheckTrial that takes in multiple
parameters, instead of a single struct containing all of those
parameters, which would prevent the need to build the struct.

Thank you very much in advance!

By the way, I also posted this question on Expert Exchange. Feel free
to snag some points there:
http://www.experts-exchange.com/Prog..._20693106.html
Nov 22 '05 #1
0 819

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4960
by: boble | last post by:
Sorry, it's may be off topic ;_((( The following article http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k3/ht ml/winmob03.asp states that a.. Microsoft Windows .NET Compact Framework-The .NET Compact Framework is in ROM in all new Pocket PC 2003 devices, and can be installed in RAM in Pocket PC 2000 and Pocket PC 2002 devices. The question is: how? Answers would be greatly appreciated
0
2425
by: devgru | last post by:
I've developed several programs for the Pocket PC in eMbedded Visual C (API calls only, no MFC). All of these programs made use of a third-party DLL called SecureTrial (www.zedev.com) to create 30-day trial versions of the programs. The DLL was loaded dynamically at run-time using LoadLibrary and GetProcAddress, as shown in the code below. For the SecureTrial library, all I have are .DLL files compiled for the MIPS, ARM, and SH3...
2
2855
by: Duncan | last post by:
I am using the evaluation version of CE.NET 4.1. I had also installed the release version of the Compact Framework. I uninstalled the CE.NET 4.1, and then realized I needed it again and reinstalled it. I also installed all the QFEs. When I tried to reinstall the release Compact Framework, I get a message that it is already installed and the installation aborted.
13
10412
by: Larry L | last post by:
Access is noted for bloating a database when you add and delete records frequently. I have always had mine set to compact on close, and that works great. Now after everyone's advice I split my database, so the data is in a second (back-end) database with all the tables linked. However, now when I close the database, it compacts the front end, since that's what's open, and the back-end grows. I now have to manually open and close the...
0
1007
by: John Hunter | last post by:
I've recently had a nasty problem with the "Invalid reference to the property Form" error in subforms - nasty because it doesn't seem to consistently happen to all forms which contain the same structure and code. Judging by the forums I've researched, it's not an uncommon error. I'm happy to say I've found a simple solution. OVERVIEW: I have a main form (no record source) which contains two subforms. The subforms are not linked, but...
5
1464
by: Michal Rizek | last post by:
Hi, i need to use COM object in my application running on Pocket PC 2003. I used tlbimp utility to create clr assembly and added it into my project. But when i try to create instance of COM object BALSYSLib.BalSystemClass sys = new BALSYSLib.BalSystemClass(); InvalidOperationException is thrown. It is even thrown earlier then the program reaches that line - propably JIT compiler throws it (it is thrown while entering procedure...
1
276
by: Keith | last post by:
Someone was kind enough to send me a control that he developed that does precisely what I need it to do. However - the code was originally written in VB.NET for windows apps. I'm developing for the Compact Framework (CF). When I attempt to add the control under CF - the control is grayed out. However under a windows application I can use it fine. Obviously there is some sort of issue with the type of
2
1425
by: amplifier | last post by:
Hi all, I am new to c# programming. I want to ask what function I should use so as to check the currently used version of .net compact framework ? Thanks.
0
1256
by: sameer | last post by:
hey! guys i have a barcode scanner Symbol MC 9060 running windows CE .net with compact 1.1 framework installed on it. My application is done in Visual studio 2003, winforms with vb.net 2003 and uses webservices to connect to a remote webserver over the internet. Now the clinet is upgrading from a symbol MC9060 to MC9090 which runs windows mobile 5.0 premium(non-WAN) or Phone eidtion(WAN) with compact framwork 2.0. so here are couple...
0
961
by: phillin77 | last post by:
My library need to be used both on .NET Framework and .NET Compact Framework. In .NET Framework, I use Monitor.TryEnter(Object, millisecondsTimeout) to get into a lock or timeout. But in .NET Compact Framework, it doesn't support this method, only support Monitor.TryEnter(Object). Can anyone help to solve this problem: get a timeout-enabled lock !!! Thanks!
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1950
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.