473,503 Members | 11,783 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)(TRIALINFO);

DWORD stCheckTrial(TRIALINFO 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(TEXT("strial.dll"));
lpfnDLLProc = (ULPRET)GetProcAddress(hinstLib,
TEXT("stCheckTrial"));
retval = (*lpfnDLLProc)(ti);
FreeLibrary(hinstLib);

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 2414

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

Similar topics

1
4948
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...
2
2834
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...
13
10390
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...
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...
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...
0
816
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...
2
1417
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
1245
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...
0
946
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...
0
7070
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...
0
7316
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...
0
7449
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...
0
5566
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,...
1
4993
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...
0
4666
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...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
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 ...
1
729
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.