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

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[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?!

dll in the wrong directory?!

Discuss PocketC for CE (including Desktop Edition)

Postby Cindy on Fri Dec 20, 2002 1:15 pm

hi,

i created a DLL in eVC++ and want to call it from eVB.
So far, so good: i got the error message 'unable to load library MyRas.dll needed for call MyRasDial'. I think, I copied the dll in the wrong directory...is it right?

Where is the right directory?

Thanks,
Cindy
Cindy
 
Posts: 19
Joined: Fri Dec 20, 2002 9:14 am
Location: Germany

Postby guy on Fri Dec 20, 2002 1:26 pm

It should be in the windows directory unless you include a path when you load 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
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
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby Cindy on Fri Dec 20, 2002 1:28 pm

thank you for aswering my posting.

i am brand new an that field...can describe it a bit more plase? :evil:

thanks
cindy

p.s.
i want to test it on the emulator
Cindy
 
Posts: 19
Joined: Fri Dec 20, 2002 9:14 am
Location: Germany

Postby guy on Fri Dec 20, 2002 1:45 pm

> i want to test it on the emulator

Ah.

I don't know.

You need to build the DLL specifically for the emulator, but I have no idea where you would have to put it. I don't use the emulator, I have a windows CE device permanently attached.



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
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
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby Cindy on Fri Dec 20, 2002 1:49 pm

o.k.: now i have my pda attached and i copied it directly to the windows directory. i get the same error message.

where is my mistake?

cindy

p.s.
unbelievable how fast i get an answer WOW [:0]
Cindy
 
Posts: 19
Joined: Fri Dec 20, 2002 9:14 am
Location: Germany

Postby guy on Sun Dec 22, 2002 1:28 pm

What does the Declare Function... line in your evb program look like?

It should be something like:

Declare Function MyRasDial Lib "MyRas.dll" (parameters...) As Long

The quoted string after the Lib should contain the whole path to your library unless its in the Windows directory.



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
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
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby Cindy on Mon Dec 23, 2002 6:38 am

hi guy,

thanks you for your answer...

my declaration now looks like this: *Public Declare Function MyRasDial Lib "C:\Programme\Microsoft eMbedded Tools\EVB\MyRAS.dll" (ByVal phone_number As String, ByVal domain As String, ByVal username As String, ByVal password) As Long* and it doesnt work. I copied the .dll in every directory I could found but it is still the same. By the way: there is no differens between the emulator and the real pda. I got the same message.
Cindy
 
Posts: 19
Joined: Fri Dec 20, 2002 9:14 am
Location: Germany

Postby guy on Mon Dec 23, 2002 7:59 pm

The bit in quotes after the <b>Lib</b> is wrong.

Change the path so that it references where the DLL is on the target device. Instead of the "C:\Programme...." it should just read "\Windows\MyRAS.dll".

The Lib bit is where the DLL is.



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
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
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby Cindy on Mon Dec 30, 2002 2:02 pm

hi,

hope you had a nice Xmas :)

I changed the path in the declaration but the problem is still the same: unable to load library....

the .dll is in the windows directory, the path is set in the declaration like \Windows\MyRas.dll and the error is still there.
what can I do?

thanks,
Cindy
Cindy
 
Posts: 19
Joined: Fri Dec 20, 2002 9:14 am
Location: Germany

Postby guy on Mon Dec 30, 2002 2:33 pm

Try to load the library yourself by calling the LoadLibrary() function. You will need to get the definition from the API Text Viewer tool that is installed with evb.

After your call to LoadLibrary(), call GetLastError() (again get the definition from the API text viewer).

Post the result of GetLastError() here. This may give me a clue as to what is happening.


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
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
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby Cindy on Tue Dec 31, 2002 6:56 am

morning,

I cant figure out which .dll I have to declarade to call LoadLibrary()
Can you help me?

Cindy
Cindy
 
Posts: 19
Joined: Fri Dec 20, 2002 9:14 am
Location: Germany

Postby guy on Tue Dec 31, 2002 7:54 am

Run up the API text viewer, search for LoadLibrary() and copy the definition into your code.

(It's probably in coredll.dll)


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
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
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby Cindy on Tue Dec 31, 2002 8:06 am

O.K. I declared like the GetLastError. But now there is the Message: unable to load LoadLibrary.dll
Next Feature:
When I run the API text viewer there is nothing in!
Cindy
 
Posts: 19
Joined: Fri Dec 20, 2002 9:14 am
Location: Germany

Postby Cindy on Tue Dec 31, 2002 8:55 am

Here is the ErrorCode from GetLastError: 126/The specified modul could not be found/ERROR_MOD_NOT_FOUND

my programm now looks like this

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 String
Dim err As String

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

libby = LoadLibrary("Windows \ MyRas.dll")
err = GetLastError()
MsgBox err

rc = MyRasDial(szPhoneNumber, szDomain, szUserName, szDomain)

End Sub
Cindy
 
Posts: 19
Joined: Fri Dec 20, 2002 9:14 am
Location: Germany

Postby guy on Tue Dec 31, 2002 12:30 pm

The path\name for the LoadLibrary() should be:

"\Windows\MyRas.dll"

You have spaces in your version and no leading backslash. On Windows CE there are no relative paths, all file name strings must start with a backslash and contain a full path.

You seem to have declared libby as a string, but LoadLibrary() returns a Long.

You have declared err as a string, but Err is a built-in object.

What follows is mostly a reiteration of my other suggestions, along with some other suggestions.

LoadLibrary() will apply a default of "\Windows" to any library string that you pass to it.

I can understand error 126.


To use the API Text viewer:

Run it

First time run:
On file menu choose "Load Text File"
In file open dialogue box select "WINCEAPI.TXT" file
On file menu choose "Convert Text to Database"
In file save dialogue box accept "WINCEAPI.MDB" file
On file menu, choose "Load Database File"
In file open dialogue box select "WINCEAPI.MDB" file

On subsequent runs:
On file menu, choose "Load Database File"
In file open dialogue box select "WINCEAPI.MDB" file

Then, select "Declares" from drop down box
Type "LoadLibrary" in the "Type the first few..." box
Double click on LoadLibrary in the list box
Copy the string:

<b>Public Declare Function LoadLibrary Lib "Coredll" Alias "LoadLibraryW" (ByVal lpLibFileName As String) As Long</b>

from the lower box into your program.

Your declare for your MyRasDial 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 Long

If your DLL is in the \Windows directory on your windows CE device.

You should be able to test this by loading MyRAS.DLL yourself with LoadLibrary().

If this doesn't succeed then either the DLL isn't there, or the code in the DLL is wrong. What does the DllMain() function in your Dll look like?

It should have a structure similar to:

Code: Select all


BOOL APIENTRY DllMain(HANDLE hModule, DWORD  dwReason, LPVOID lpReserved) {


   switch (dwReason) {


   case DLL_PROCESS_ATTACH:
   case DLL_THREAD_ATTACH:
   case DLL_THREAD_DETACH:
   case DLL_PROCESS_DETACH:
      break;
    }
    return TRUE;
}




If the load of the library succeeds then you should check that you have the correct enrty point by calling GetProcAddress() for your function.

If the call to GetProcAddress() fails then perhaps you haven't got the library exports setup correctly.

How do you declare your MyRasDial() function in your DLL source?





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
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
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Next

Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 1 guest

cron