Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - dll in the wrong directory?!
Page 2 of 3

PostPosted: Tue Dec 31, 2002 12:40 pm
by guy
Correction to the above, the declaration should be:

Public Declare Function MyRasDial Lib "MyRAS.dll" (ByVal phone_number As String, ByVal domain As String, ByVal username As String, ByVal password As String) As Long


Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum

PostPosted: Thu Jan 02, 2003 6:55 am
by Cindy
happy new year to you and thanks for help.

Could it be another problem that my DllMain() was compiled for X86EMRel processor (because I used the emulator) and now Iam using the PDA?

cindy

PostPosted: Thu Jan 02, 2003 8:26 am
by Cindy
here is my DllMain()

// MyRAS.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include <ras.h>
#include <raserror.h>

#define DllExport extern "C" __declspec( dllexport )

HRASCONN g_hr = NULL; // Handle of the connection

BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}

// Exported function to use


// RasDial wrapper (to open the connection)
DllExport DWORD MyRASDial(LPTSTR phone_number, LPTSTR domain,
LPTSTR username, LPTSTR password)
{
RASDIALPARAMS rdp;
rdp.dwSize = sizeof(RASDIALPARAMS);
// Fill useless parameters
wcscpy(rdp.szPhoneNumber, phone_number);
wcscpy(rdp.szCallbackNumber, _T(""));

wcscpy(rdp.szDomain, domain);
/* wcscpy(rdp.szDomain, _T("")); // Null-terminated string
// that contains the domain
// on which authentication
// is to occur. An empty
// string specifies the
// domain in which the
// remote access server is
// a member. An asterisk
// specifies the domain
// stored in the phone book
// for the entry.*/

wcscpy(rdp.szUserName, username);
wcscpy(rdp.szPassword, password);

// Now try connect to the ISP
DWORD ret = RasDial(NULL, NULL, &rdp, NULL, NULL, &g_hr);
if (ret)
{
// Connection Failed
RasHangUp(g_hr);
g_hr = NULL;
return (0); // Return 0 to the caller warn the connection failed
}
else
{
// Connection Established
return (1); // Return 0 to the caller warn the connection is established
}
}

// RasHangUp wrapper (to close the connection)
DllExport DWORD MyRasHangUp()
{
if (g_hr)
{
// Connection Failed
RasHangUp(g_hr);
g_hr = NULL;
return (1); // Return 1 if there was a connection
}

return (0); // Return 0 if there was none
}

PostPosted: Thu Jan 02, 2003 8:42 am
by guy
Yes, the DLL must be compiled for the appropriate platform and CPU for your PDA.

From a quick look, the DLL source seems OK to me.


Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum

PostPosted: Thu Jan 02, 2003 8:48 am
by Cindy
how can I change the processor typ later?

PostPosted: Thu Jan 02, 2003 2:44 pm
by guy
You need to build a copy of the DLL for each platform and CPU on which you want it to run.

There are currently 16 different platform and cpu types for windows CE devices, excluding the BE300, the Smartphone and x86 emulation. You may not want to support all of them.

In evc, right click on one of the toolbars and make sure that you have a tick next to the "WCE Configuration" toolbar. You can then manually build for each platform and CPU that you want.

You can also use the batch build feature on the Build menu item. This will build for all CPUs for a particular platform.

If you are building for multiple platforms as well as multiple CPUs then you will need to rebuild everything from scratch for each platform, otherwise you'll get modules compiled for the wrong platform.

It helps to modify the link output file in the project settings so that it includes the symbols for the platform and cpu:

mydll_wce$(CEVersion)_$(CEPlatform)_ARM.dll

$(CEVersion) comes out as 200, 201, 211 or 300
$(CEPlatform) comes out as UNKNOWN (HPC and PPC on CE2.01), WIN32_PLATFORM_PSPC (PPC on 2.11 and PocketPC), WIN32_PLATFORM_HPCPRO, WIN32_PLATFORM_HPC2000 or WIN32_PLATFORM_PSPC=310 (PocketPC2002, yes, it does have an = sign in it)





Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum

PostPosted: Fri Jan 03, 2003 6:45 am
by Cindy
Thank you very much. Now I have a .dll for my device.
The last .dll was for the Emulator so I could not understand why the Erros occurs on the Emulator (of course with a different path). But the Error still occurs on the device (with the new .dll).

do you have a suggestion?

cindy

PostPosted: Fri Jan 03, 2003 8:15 am
by Cindy
after compiling and running again I got the ErrMsg: 87/ The Parameter is incorrect (on the device).
And after the MyRasDial call I got: Unable to load function MyRasDial

where the hell is the mistake?:twisted:

PostPosted: Fri Jan 03, 2003 8:53 am
by guy
On which line of your source code did you get the incorrect parameter error?



Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum

PostPosted: Fri Jan 03, 2003 9:02 am
by Cindy
Private Sub internet_Click()

Dim rc As Long
Dim szDomain As String
Dim szPhoneNumber As String
Dim szUserName As String
Dim szPassword As String
Dim libby As Long
Dim err As Long

szPhoneNumber = "xxxx-yyyy"
szUserName = "aaaa"
szPassword = "bbbb"
szDomain = Chr(0)

libby = LoadLibrary("\Windows\MyRAS.dll")
err = GetLastError()
MsgBox err
-----------------------> error 87

rc = MyRasDial(szPhoneNumber, szDomain, szUserName, szPassword)
-----------------------> unable to load function MyRasDial

End Sub

PostPosted: Fri Jan 03, 2003 10:27 am
by guy
Change the Msgbox line to:

Msgbox CStr(err)

This should fix the first problem

The second problem occurs because the Declare is wrong for the MyRasDial function. We know this anyway. The error number displayed by the Msgbox should help us work out why.



Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum

PostPosted: Fri Jan 03, 2003 11:05 am
by Cindy
I changed the MsgBox line but the error is still the same.
87/the parameter is incorrect and unable to load function MyRasDial

PostPosted: Fri Jan 03, 2003 12:44 pm
by guy
Try changing the name of the variable "err" to "MyErr" or something. Maybe it's because err is a built in object.

I'm not worried about the "unable to load" error. You'll get that until we work out what's wrong.


Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum

PostPosted: Fri Jan 03, 2003 12:58 pm
by Cindy
I changed it to "Fehler" (german word for error) but there is still the same result.

cindy

PostPosted: Fri Jan 03, 2003 1:27 pm
by guy
Is the Msgbox line generating an error in the code, or is the 87 being displayed by the Msgbox? ie is the "Invalid parameter" error an invalid parameter to "LoadLibrary" or an invalid parameter to "MsgBox"?





Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum