473,651 Members | 2,987 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
Jul 19 '05 #1
0 2424

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
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
10411
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...
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
0
819
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
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
8361
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
8278
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
8807
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8701
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5615
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
4144
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
4290
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
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

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.